Skip to content

Commit 0b5a118

Browse files
authored
feat(ci): build plugins with setup-sp instead of sourceknight (#159)
1 parent 564b23b commit 0b5a118

2 files changed

Lines changed: 37 additions & 71 deletions

File tree

.github/workflows/ci.yml

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,61 @@
11
name: CI
2-
32
on: [push, pull_request, workflow_dispatch]
4-
53
jobs:
64
build:
7-
name: "Build"
8-
runs-on: ${{ matrix.os }}
9-
strategy:
10-
fail-fast: false
11-
matrix:
12-
os: [ubuntu-24.04]
13-
include:
14-
- os: ubuntu-24.04
5+
name: Build
6+
runs-on: ubuntu-latest
157
steps:
168
- uses: actions/checkout@v7
17-
- name: Build sourcemod plugin
18-
uses: maxime1907/action-sourceknight@v1
9+
- name: Setup SourcePawn compiler
10+
uses: rumblefrog/setup-sp@v1.3.1
1911
with:
20-
cmd: build
21-
12+
version: "1.12.x"
13+
github-token: ${{ secrets.GITHUB_TOKEN }}
14+
- name: Install dependencies
15+
run: |
16+
set -euo pipefail
17+
mkdir -p addons/sourcemod/scripting/include
18+
git clone --depth=1 https://github.com/srcdslab/sm-plugin-MultiColors.git deps/multicolors
19+
cp -R deps/multicolors/addons/sourcemod/scripting/include/* addons/sourcemod/scripting/include/
20+
git clone --depth=1 https://github.com/srcdslab/sm-plugin-AFKManager.git deps/afkmanager
21+
cp -R deps/afkmanager/addons/sourcemod/scripting/include/* addons/sourcemod/scripting/include/
22+
git clone --depth=1 https://github.com/srcdslab/sm-plugin-TeamManager.git deps/teammanager
23+
cp -R deps/teammanager/addons/sourcemod/scripting/include/* addons/sourcemod/scripting/include/
24+
- name: Build sourcemod plugin
25+
working-directory: src/addons/sourcemod/scripting
26+
run: |
27+
set -euo pipefail
28+
mkdir -p ../plugins
29+
spcomp -i include -i "$GITHUB_WORKSPACE/addons/sourcemod/scripting/include" -o ../plugins/zombiereloaded.smx zombiereloaded.sp
2230
- name: Create package
2331
run: |
24-
mkdir -p /tmp/package
25-
cp -R .sourceknight/package/* /tmp/package
26-
cp -R common /tmp/package
27-
32+
set -euo pipefail
33+
mkdir -p /tmp/package/addons/sourcemod/plugins
34+
cp src/addons/sourcemod/plugins/*.smx /tmp/package/addons/sourcemod/plugins/
35+
if [ -d "common" ]; then
36+
cp -R common/* /tmp/package/
37+
fi
2838
- name: Upload build archive for test runners
2939
uses: actions/upload-artifact@v7
3040
with:
3141
name: ${{ runner.os }}
3242
path: /tmp/package
33-
3443
tag:
3544
name: Tag
3645
needs: build
46+
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
3747
runs-on: ubuntu-latest
3848
steps:
39-
- uses: actions/checkout@v7
40-
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
41-
4249
- uses: dev-drprasad/delete-tag-and-release@v1.1
43-
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
4450
with:
4551
delete_release: true
4652
tag_name: latest
4753
env:
4854
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49-
5055
- uses: rickstaa/action-create-tag@v1
51-
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
5256
with:
53-
tag: "latest"
57+
tag: latest
5458
github_token: ${{ secrets.GITHUB_TOKEN }}
55-
5659
release:
5760
name: Release
5861
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
@@ -64,28 +67,25 @@ jobs:
6467
with:
6568
name: ${{ runner.os }}
6669
path: artifacts
67-
6870
- name: Versioning
6971
run: |
72+
set -euo pipefail
7073
version="latest"
71-
if [[ "${{ github.ref_type }}" == 'tag' ]]; then
72-
version=`echo $GITHUB_REF | sed "s/refs\/tags\///"`;
74+
if [[ "${{ github.ref_type }}" == "tag" ]]; then
75+
version="${GITHUB_REF_NAME}"
7376
fi
74-
echo "RELEASE_VERSION=$version" >> $GITHUB_ENV
75-
77+
echo "RELEASE_VERSION=$version" >> "$GITHUB_ENV"
7678
- name: Package
7779
run: |
80+
set -euo pipefail
7881
cd artifacts
79-
ls -Rall
80-
tar -czf ../${{ github.event.repository.name }}-${{ env.RELEASE_VERSION }}.tar.gz .
82+
tar -czf "../${{ github.event.repository.name }}-${{ env.RELEASE_VERSION }}.tar.gz" .
8183
cd ..
82-
ls -la *.tar.gz
83-
8484
- name: Release
8585
uses: svenstaro/upload-release-action@v2
8686
with:
8787
repo_token: ${{ secrets.GITHUB_TOKEN }}
88-
file: '*.tar.gz'
88+
file: "*.tar.gz"
8989
tag: ${{ env.RELEASE_VERSION }}
9090
file_glob: true
9191
overwrite: true

sourceknight.yaml

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)