Skip to content

Commit 5e60e5c

Browse files
authored
Update workflow file
1 parent 3c373ba commit 5e60e5c

File tree

1 file changed

+39
-30
lines changed

1 file changed

+39
-30
lines changed

.github/workflows/main.yml

Lines changed: 39 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,73 +3,82 @@ name: Compile and release
33
on:
44
push:
55
branches:
6-
master
6+
- master
77

88
env:
99
PLUGIN_NAME: tf-bhop
10+
SCRIPTS_PATH: addons/sourcemod/scripting
1011

1112
jobs:
1213
build:
1314
runs-on: ubuntu-latest
1415
strategy:
1516
matrix:
16-
sm-version: [ '1.11.x' ]
17-
permissions:
18-
contents: write
17+
sm-version: [ '1.12.x' ]
1918

2019
steps:
21-
- uses: actions/checkout@v4
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
2222

23-
- name: Set environment variables
24-
run: echo SCRIPTS_PATH=$(pwd) >> $GITHUB_ENV
23+
- name: Prepare include directory
24+
run: mkdir -p ${{ env.SCRIPTS_PATH }}/include
2525

26-
- name: Download includes
26+
- name: Download include files
2727
run: |
28-
wget -P ${{ env.SCRIPTS_PATH }}/addons/sourcemod/scripting/include https://raw.githubusercontent.com/FlaminSarge/tf2attributes/master/scripting/include/tf2attributes.inc
29-
wget -P ${{ env.SCRIPTS_PATH }}/addons/sourcemod/scripting/include https://raw.githubusercontent.com/nosoop/SMExt-SourceScramble/master/scripting/include/sourcescramble.inc
28+
includes=(
29+
"https://raw.githubusercontent.com/FlaminSarge/tf2attributes/refs/heads/master/scripting/include/tf2attributes.inc"
30+
"https://raw.githubusercontent.com/nosoop/SMExt-SourceScramble/refs/heads/master/scripting/include/sourcescramble.inc"
31+
)
3032
31-
- name: Setup SourcePawn Compiler ${{ matrix.sm-version }}
33+
mkdir -p "${{ env.SCRIPTS_PATH }}/include"
34+
35+
for url in "${includes[@]}"; do
36+
echo "Downloading $url"
37+
curl -sSL -O --output-dir "${{ env.SCRIPTS_PATH }}/include" "$url"
38+
done
39+
40+
- name: Setup SourcePawn compiler ${{ matrix.sm-version }}
3241
id: setup_sp
3342
uses: rumblefrog/setup-sp@master
3443
with:
3544
version: ${{ matrix.sm-version }}
36-
version-file: ./addons/sourcemod/scripting/${{ env.PLUGIN_NAME }}.sp
45+
version-file: ${{ env.SCRIPTS_PATH }}/${{ env.PLUGIN_NAME }}.sp
3746
define-name: PLUGIN_VERSION
3847

39-
- name: Compile plugins
48+
- name: Compile plugin
4049
run: |
41-
mkdir ../plugins
42-
spcomp -v2 -E -i "include" -o"../plugins/${{ env.PLUGIN_NAME }}.smx" ${{ env.PLUGIN_NAME }}.sp
43-
echo "===OUT FILES==="
50+
mkdir -p ../plugins
51+
spcomp -v2 -E -i "include" -o "../plugins/${{ env.PLUGIN_NAME }}.smx" "${{ env.PLUGIN_NAME }}.sp"
52+
echo "=== OUT FILES ==="
4453
ls ../plugins
45-
echo "===VERSION==="
54+
echo "=== VERSION ==="
4655
echo ${{ steps.setup_sp.outputs.plugin-version }}
47-
working-directory: ${{ env.SCRIPTS_PATH }}/addons/sourcemod/scripting
56+
working-directory: ${{ env.SCRIPTS_PATH }}
4857

49-
- name: Install zip
58+
- name: Install zip utility
5059
uses: montudor/action-zip@v1
5160

5261
- name: Zip output
5362
run: |
54-
zip -qq -y -r ${{ github.event.repository.name }}.zip configs plugins scripting extensions gamedata translations data
55-
working-directory: ${{ env.SCRIPTS_PATH }}/addons/sourcemod
63+
zip -qq -r ${{ github.event.repository.name }}.zip addons/sourcemod
5664
57-
- name: List files in the directory
58-
run: ls -R
59-
working-directory: ${{ env.SCRIPTS_PATH }}/addons/sourcemod
60-
61-
- name: List files in the zip
62-
run: unzip -l ${{ github.event.repository.name }}.zip
63-
working-directory: ${{ env.SCRIPTS_PATH }}/addons/sourcemod
65+
- name: List build outputs
66+
run: |
67+
echo "::group::Directory contents"
68+
ls -R
69+
echo "::endgroup::"
70+
echo "::group::Zip contents"
71+
unzip -l ${{ github.event.repository.name }}.zip
72+
echo "::endgroup::"
6473
65-
- name: Create Release
74+
- name: Create GitHub release
6675
uses: ncipollo/release-action@v1
6776
env:
6877
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6978
with:
7079
token: ${{ secrets.GITHUB_TOKEN }}
7180
tag: ${{ steps.setup_sp.outputs.plugin-version }}
72-
artifacts: addons/sourcemod/${{ github.event.repository.name }}.zip
81+
artifacts: ./${{ github.event.repository.name }}.zip
7382
draft: true
7483
allowUpdates: true
7584
updateOnlyUnreleased: true

0 commit comments

Comments
 (0)