Skip to content

Commit 1b5b211

Browse files
fix: update build system, drop csgo build, win support, latest sdk (#15)
1 parent 102ba54 commit 1b5b211

24 files changed

Lines changed: 471 additions & 1587 deletions

.github/workflows/ci.yml

Lines changed: 63 additions & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -1,175 +1,74 @@
1-
name: CI
1+
name: Build AlliedModders Extension
22

33
on:
44
push:
55
branches:
6-
- main
76
- master
7+
- main
88
tags:
9-
- '*'
9+
- "*"
1010
pull_request:
1111
branches:
12-
- main
1312
- master
13+
- main
1414

1515
jobs:
16-
build:
17-
name: Build
18-
runs-on: ${{ matrix.os }}
19-
strategy:
20-
fail-fast: false
21-
matrix:
22-
os: [ubuntu-20.04]
23-
sourcemod-version: [1.11-dev]
24-
protobuf-version: [v2.5.0]
25-
# Before Counter strike 2 changes
26-
protobuf-valve-version: [02c5c94089d46fb14d8d94a4791e8cad7eef2d63]
27-
include:
28-
- os: ubuntu-20.04
29-
target-archs: x86,x86_64
30-
sdks: css,csgo
31-
32-
steps:
33-
- name: Install Linux packages
34-
if: runner.os == 'Linux'
35-
run: |
36-
sudo apt update
37-
sudo apt install -yq --no-install-recommends g++-multilib
38-
39-
- name: Set up Python
40-
uses: actions/setup-python@v5
41-
42-
- name: Checkout
43-
uses: actions/checkout@v4
44-
with:
45-
path: extension
46-
47-
- name: Checkout SourceMod
48-
uses: actions/checkout@v4
49-
with:
50-
repository: alliedmodders/sourcemod
51-
ref: ${{ matrix.sourcemod-version }}
52-
path: sourcemod
53-
submodules: recursive
54-
55-
- name: Checkout AMBuild
56-
uses: actions/checkout@v4
57-
with:
58-
repository: alliedmodders/ambuild
59-
path: ambuild
60-
61-
- name: Checkout sm-ext-common
62-
uses: actions/checkout@v4
63-
with:
64-
repository: srcdslab/sm-ext-common
65-
path: sourcemod/extensions/sm-ext-common
66-
67-
- name: Checkout valve protobuf
68-
uses: actions/checkout@v4
69-
with:
70-
repository: SteamDatabase/Protobufs
71-
ref: ${{ matrix.protobuf-valve-version }}
72-
path: protobuf-valve
73-
submodules: recursive
74-
75-
- name: Checkout protobuf
76-
uses: actions/checkout@v4
77-
with:
78-
repository: protocolbuffers/protobuf
79-
ref: ${{ matrix.protobuf-version }}
80-
path: protobuf
81-
submodules: recursive
82-
83-
- name: Install AMBuild
84-
run: |
85-
pip install --user ./ambuild
86-
87-
- name: Install sourcemod dependencies
88-
run: |
89-
bash sourcemod/tools/checkout-deps.sh -m -s ${{ matrix.sdks }}
90-
91-
- name: Install protobuf
92-
shell: bash
93-
run: |
94-
export EXTENSION_ROOT_DIR=$(pwd)
95-
cd protobuf
96-
97-
# sh autogen.sh
98-
99-
# Fix because autogen in protobuf 2.5.0 doesnt work anymore
100-
autoreconf -f -i -Wall,no-obsolete
101-
rm -rf autom4te.cache config.h.in~
102-
103-
# Make sure to compile for 32bit with old ABI for std::string compatibility
104-
./configure --prefix=$EXTENSION_ROOT_DIR/protobuf --build=i686-pc-linux-gnu "CFLAGS=-m32 -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14" "CXXFLAGS=-m32 -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14" "LDFLAGS=-m32 -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14" --disable-shared --enable-static
105-
make -j 8
106-
make install
107-
108-
# Compile .proto files to c++
109-
110-
cd ../protobuf-valve
111-
112-
# Counter strike 2 ?
113-
# ../protobuf/bin/protoc -I=$PWD -I=$PWD/csgo $PWD/csgo/networksystem_protomessages.proto --cpp_out=$PWD
114-
# ../protobuf/bin/protoc -I=$PWD -I=$PWD/csgo $PWD/csgo/network_connection.proto --cpp_out=$PWD
115-
# ../protobuf/bin/protoc -I=$PWD -I=$PWD/csgo $PWD/csgo/networkbasetypes.proto --cpp_out=$PWD
116-
117-
# CSGO
118-
../protobuf/bin/protoc -I=$PWD $PWD/google/protobuf/descriptor.proto --cpp_out=$PWD
119-
../protobuf/bin/protoc -I=$PWD -I=$PWD/csgo $PWD/csgo/netmessages.proto --cpp_out=$PWD
120-
ls -all
121-
122-
- name: Build
123-
working-directory: extension
124-
shell: bash
125-
env:
126-
BREAKPAD_SYMBOL_SERVER: ${{ secrets.BREAKPAD_SYMBOL_SERVER }}
127-
run: |
128-
mkdir build && cd build
129-
python ../configure.py --enable-optimize --targets=${{ matrix.target-archs }} --sdks=${{ matrix.sdks }}
130-
ambuild
131-
132-
- name: Upload artifact
133-
uses: actions/upload-artifact@v4
134-
with:
135-
name: ${{ runner.os }}
136-
path: extension/build/package
137-
138-
139-
release:
140-
name: Release
141-
if: startsWith(github.ref, 'refs/tags/')
142-
needs: build
143-
runs-on: ubuntu-latest
144-
145-
steps:
146-
- name: Download artifacts
147-
uses: actions/download-artifact@v4
148-
149-
- name: Package
150-
run: |
151-
version=`echo $GITHUB_REF | sed "s/refs\/tags\///"`
152-
ls -Rall
153-
if [ -d "./Linux/" ]; then
154-
cd ./Linux/
155-
tar -czf ../${{ github.event.repository.name }}-${version}-linux.tar.gz -T <(\ls -1)
156-
cd -
157-
fi
158-
if [ -d "./macOS/" ]; then
159-
cd ./macOS/
160-
tar -czf ../${{ github.event.repository.name }}-${version}-mac.tar.gz -T <(\ls -1)
161-
cd -
162-
fi
163-
if [ -d "./Windows/" ]; then
164-
cd ./Windows/
165-
tar -czf ../${{ github.event.repository.name }}-${version}-windows.tar.gz -T <(\ls -1)
166-
cd -
167-
fi
168-
169-
- name: Release
170-
uses: svenstaro/upload-release-action@v2
171-
with:
172-
repo_token: ${{ secrets.GITHUB_TOKEN }}
173-
file: '*.tar.gz'
174-
tag: ${{ github.ref }}
175-
file_glob: true
16+
# install-protobuf:
17+
# runs-on: ubuntu-20.04
18+
# env:
19+
# PROTOBUF_REF: 'v2.5.0'
20+
# # Before Counter strike 2 changes
21+
# PROTOBUF_VALVE_REF: '02c5c94089d46fb14d8d94a4791e8cad7eef2d63'
22+
# steps:
23+
# - name: Checkout valve protobuf
24+
# uses: actions/checkout@v4
25+
# with:
26+
# repository: SteamDatabase/Protobufs
27+
# ref: ${{ env.PROTOBUF_VALVE_REF }}
28+
# path: protobuf-valve
29+
# submodules: recursive
30+
31+
# - name: Checkout protobuf
32+
# uses: actions/checkout@v4
33+
# with:
34+
# repository: protocolbuffers/protobuf
35+
# ref: ${{ env.PROTOBUF_REF }}
36+
# path: protobuf
37+
# submodules: recursive
38+
39+
# - name: Install protobuf
40+
# shell: bash
41+
# run: |
42+
# export EXTENSION_ROOT_DIR=$(pwd)
43+
# cd protobuf
44+
45+
# # sh autogen.sh
46+
47+
# # Fix because autogen in protobuf 2.5.0 doesnt work anymore
48+
# autoreconf -f -i -Wall,no-obsolete
49+
# rm -rf autom4te.cache config.h.in~
50+
51+
# # Make sure to compile for 32bit with old ABI for std::string compatibility
52+
# ./configure --prefix=$EXTENSION_ROOT_DIR/protobuf --build=i686-pc-linux-gnu "CFLAGS=-m32 -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14" "CXXFLAGS=-m32 -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14" "LDFLAGS=-m32 -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14" --disable-shared --enable-static
53+
# make -j 8
54+
# make install
55+
56+
# # Compile .proto files to c++
57+
58+
# cd ../protobuf-valve
59+
60+
# # Counter strike 2 ?
61+
# # ../protobuf/bin/protoc -I=$PWD -I=$PWD/csgo $PWD/csgo/networksystem_protomessages.proto --cpp_out=$PWD
62+
# # ../protobuf/bin/protoc -I=$PWD -I=$PWD/csgo $PWD/csgo/network_connection.proto --cpp_out=$PWD
63+
# # ../protobuf/bin/protoc -I=$PWD -I=$PWD/csgo $PWD/csgo/networkbasetypes.proto --cpp_out=$PWD
64+
65+
# # CSGO
66+
# ../protobuf/bin/protoc -I=$PWD $PWD/google/protobuf/descriptor.proto --cpp_out=$PWD
67+
# ../protobuf/bin/protoc -I=$PWD -I=$PWD/csgo $PWD/csgo/netmessages.proto --cpp_out=$PWD
68+
# ls -all
69+
70+
build-release-extension:
71+
uses: srcdslab/ci-workflows/.github/workflows/shared_build_release_am_extension.yml@v1
72+
# needs: install-protobuf
73+
with:
74+
sdks: "css"

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
build
2+
Containerfile
3+
.venv
4+
safetyhook
5+
ambuild
6+
*.env
7+
*.ps1

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "sm-ext-common"]
2+
path = sm-ext-common
3+
url = git@github.com:srcdslab/sm-ext-common.git

0 commit comments

Comments
 (0)