-
Notifications
You must be signed in to change notification settings - Fork 1
135 lines (115 loc) · 4.21 KB
/
build-action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Build Extension
on:
push:
jobs:
build_ext:
name: Build for ${{ matrix.identifier }}
runs-on: ${{ matrix.os_version }}
strategy:
fail-fast: false
matrix:
buildjobs:
- windows-x86
- windows-x64
- linux-latest
include:
- meta_branch: "master"
sm_branch: "master"
sdks_to_fetch: 'tf2 css hl2dm dods orangebox sdk2013 bms l4d l4d2 eye'
- buildjobs: windows-x86
os_version: windows-latest
identifier: 'Windows Latest (x86)'
msvc_arch: 'x86'
ambuild_target: 'x86'
package_name: 'windows-x86'
build_sdks: 'tf2,dods,css,hl2dm,orangebox,sdk2013,bms,l4d,l4d2,eye'
dbgsym_ext: 'pdb'
- buildjobs: windows-x64
os_version: windows-latest
identifier: 'Windows Latest (x86-64)'
msvc_arch: 'x64'
ambuild_target: 'x86_64'
package_name: 'windows-x86-64'
build_sdks: 'tf2'
dbgsym_ext: 'pdb'
- buildjobs: linux-latest
os_version: ubuntu-latest
identifier: 'Linux Latest (x86, x86-64)'
cc: clang-15
cxx: clang++-15
ambuild_target: 'x86,x86_64'
package_name: 'linux-latest'
build_sdks: 'tf2,dods,css,hl2dm,orangebox,sdk2013,bms,l4d,l4d2'
dbgsym_ext: 'dbg'
steps:
- name: Install Packages (Linux)
if: runner.os == 'Linux'
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y ${{ matrix.cc }} ${{ matrix.cxx }} g++-multilib
echo "CC=${{ matrix.cc }}" >> $GITHUB_ENV
echo "CXX=${{ matrix.cxx }}" >> $GITHUB_ENV
- name: Install MSVC for ${{ matrix.identifier }}
if: runner.os == 'Windows'
uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: ${{ matrix.msvc_arch }}
- name: Setup Python
uses: actions/[email protected]
with:
python-version: '3.11'
- name: Setup ambuild
run: |
python -m pip install wheel
pip install git+https://github.com/alliedmodders/ambuild
- name: Fetch Metamod:Source ${{ matrix.meta_branch }}
uses: actions/[email protected]
with:
repository: alliedmodders/metamod-source
ref: ${{ matrix.meta_branch }}
path: mmsource
submodules: recursive
- name: Fetch SourceMod ${{ matrix.sm_branch }}
uses: actions/[email protected]
with:
repository: alliedmodders/sourcemod
ref: ${{ matrix.sm_branch }}
path: sourcemod
submodules: recursive
- name: Fetch SDKs
shell: bash
run: |
git clone --mirror https://github.com/alliedmodders/hl2sdk hl2sdk-proxy-repo
sdks=(${{ matrix.sdks_to_fetch }})
for sdk in "${sdks[@]}"
do
git clone hl2sdk-proxy-repo -b $sdk hl2sdk-$sdk
done
- name: Fetch Extension
uses: actions/[email protected]
with:
path: navbot
submodules: recursive
- name: Build Extension For ${{ matrix.ambuild_target }}
working-directory: navbot
run: |
mkdir build
cd build
python3 ../configure.py --sdks="${{ matrix.build_sdks }}" --sm-path="${{ github.workspace }}/sourcemod" --mms-path="${{ github.workspace }}/mmsource" --enable-optimize --enable-lto --targets "${{ matrix.ambuild_target }}" --symbol-files
ambuild
- name: Get commit SHA
uses: benjlevesque/[email protected]
id: short-sha
- name: Upload Extension Build Artifact
uses: actions/[email protected]
with:
name: navbot-${{ matrix.package_name }}-${{ steps.short-sha.outputs.sha }}
path: |
navbot/build/package/*
- name: Upload Debugging Symbols Artifact
uses: actions/[email protected]
with:
name: navbot-dbgsym-${{ matrix.package_name }}-${{ steps.short-sha.outputs.sha }}
path: |
navbot/build/extension/**/*.${{ matrix.dbgsym_ext }}