-
Notifications
You must be signed in to change notification settings - Fork 94
78 lines (67 loc) · 2.42 KB
/
ci.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
name: Compile
on: [push, pull_request, workflow_dispatch]
jobs:
compile:
runs-on: ubuntu-latest
strategy:
matrix:
sm-version: [ '1.11' ] #, '1.12'
name: "Build SM ${{ matrix.sm-version }}"
steps:
- name: Prepare env
shell: bash
run: echo "GITHUB_SHA_SHORT=${GITHUB_SHA::7}" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Setup SP
uses: rumblefrog/setup-sp@master
with:
version: ${{ matrix.sm-version }}
- name: Download and extract dependencies
shell: bash
run: |
# Mac zip just because it's smaller & we don't repack the extensions...
wget https://github.com/ErikMinekus/sm-ripext/releases/download/1.3.1/sm-ripext-1.3.1-mac.zip
unzip sm-ripext-1.3.1-mac.zip "addons/sourcemod/scripting/include/*"
wget https://github.com/clugg/sm-json/archive/refs/tags/v5.0.0.tar.gz
tar --strip-components=1 -xvzf v5.0.0.tar.gz sm-json-5.0.0/addons/sourcemod/scripting/include
wget https://github.com/hermansimensen/eventqueue-fix/archive/refs/tags/1.3.2.tar.gz
tar --strip-components=1 -xvzf 1.3.2.tar.gz -C addons/sourcemod
rm -rf *.zip *.tar.gz addons/sourcemod/.git* addons/sourcemod/LICENSE
- name: Run compiler
shell: bash
run: |
cd addons/sourcemod
mkdir plugins
for src in $(find scripting -maxdepth 1 -type f -name "*.sp");
do
spcomp $src -o=plugins/$(basename $src .sp)'.smx' -i=scripting/include -v2
done
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: bhoptimer-${{ github.head_ref || github.ref_name }}-sm${{ matrix.sm-version }}-${{ env.GITHUB_SHA_SHORT }}
path: |
addons
materials
sound
CHANGELOG.md
LICENSE
README.md
retention-days: 14
release:
name: Release
if: github.ref_type == 'tag'
needs: compile
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Archive artifacts
shell: bash
run: find * -maxdepth 0 -type d -exec zip -rq {}.zip {} \;
- uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
draft: true
name: ${{ github.ref_name }}
artifacts: "*.zip"