@@ -3,77 +3,86 @@ name: Compile and release
3
3
on :
4
4
push :
5
5
branches :
6
- master
6
+ - master
7
7
8
8
env :
9
9
PLUGIN_NAME : prophunt
10
+ SCRIPTS_PATH : addons/sourcemod/scripting
10
11
11
12
jobs :
12
13
build :
13
14
runs-on : ubuntu-latest
14
15
strategy :
15
16
matrix :
16
17
sm-version : [ '1.12.x' ]
17
- permissions :
18
- contents : write
19
18
20
19
steps :
21
- - uses : actions/checkout@v4
20
+ - name : Checkout repository
21
+ uses : actions/checkout@v4
22
22
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
25
25
26
- - name : Download includes
26
+ - name : Download include files
27
27
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/asherkin/TF2Items/master/pawn/tf2items.inc
30
- wget -P ${{ env.SCRIPTS_PATH }}/addons/sourcemod/scripting/include https://raw.githubusercontent.com/nosoop/SM-TFUtils/master/scripting/include/tf2utils.inc
31
- wget -P ${{ env.SCRIPTS_PATH }}/addons/sourcemod/scripting/include https://raw.githubusercontent.com/nosoop/SM-TFEconData/master/scripting/include/tf_econ_data.inc
32
- wget -P ${{ env.SCRIPTS_PATH }}/addons/sourcemod/scripting/include https://raw.githubusercontent.com/DoctorMcKay/sourcemod-plugins/master/scripting/include/morecolors.inc
33
- wget -P ${{ env.SCRIPTS_PATH }}/addons/sourcemod/scripting/include https://raw.githubusercontent.com/sigsegv-mvm/StaticProps/master/scripting/include/StaticProps.inc
28
+ includes=(
29
+ "https://raw.githubusercontent.com/FlaminSarge/tf2attributes/master/scripting/include/tf2attributes.inc"
30
+ "https://raw.githubusercontent.com/asherkin/TF2Items/master/pawn/tf2items.inc"
31
+ "https://raw.githubusercontent.com/nosoop/SM-TFUtils/master/scripting/include/tf2utils.inc"
32
+ "https://raw.githubusercontent.com/nosoop/SM-TFEconData/master/scripting/include/tf_econ_data.inc"
33
+ "https://raw.githubusercontent.com/DoctorMcKay/sourcemod-plugins/master/scripting/include/morecolors.inc"
34
+ "https://raw.githubusercontent.com/sigsegv-mvm/StaticProps/master/scripting/include/StaticProps.inc"
35
+ )
36
+
37
+ mkdir -p "${{ env.SCRIPTS_PATH }}/include"
38
+
39
+ for url in "${includes[@]}"; do
40
+ echo "Downloading $url"
41
+ curl -sSL -O --output-dir "${{ env.SCRIPTS_PATH }}/include" "$url"
42
+ done
34
43
35
44
- name : Setup SourcePawn Compiler ${{ matrix.sm-version }}
36
45
id : setup_sp
37
46
uses : rumblefrog/setup-sp@master
38
47
with :
39
48
version : ${{ matrix.sm-version }}
40
- version-file : ./addons/sourcemod/scripting /${{ env.PLUGIN_NAME }}.sp
49
+ version-file : ${{ env.SCRIPTS_PATH }} /${{ env.PLUGIN_NAME }}.sp
41
50
define-name : PLUGIN_VERSION
42
51
43
- - name : Compile plugins
52
+ - name : Compile plugin
44
53
run : |
45
- mkdir ../plugins
46
- spcomp -v2 -E -i "include" -o"../plugins/${{ env.PLUGIN_NAME }}.smx" ${{ env.PLUGIN_NAME }}.sp
47
- echo "===OUT FILES==="
54
+ mkdir -p ../plugins
55
+ spcomp -v2 -E -i "include" -o "../plugins/${{ env.PLUGIN_NAME }}.smx" " ${{ env.PLUGIN_NAME }}.sp"
56
+ echo "=== OUT FILES ==="
48
57
ls ../plugins
49
- echo "===VERSION==="
58
+ echo "=== VERSION ==="
50
59
echo ${{ steps.setup_sp.outputs.plugin-version }}
51
- working-directory : ${{ env.SCRIPTS_PATH }}/addons/sourcemod/scripting
60
+ working-directory : ${{ env.SCRIPTS_PATH }}
52
61
53
- - name : Install zip
62
+ - name : Install zip utility
54
63
uses : montudor/action-zip@v1
55
64
56
65
- name : Zip output
57
66
run : |
58
- zip -qq -y -r ${{ github.event.repository.name }}.zip addons scripts
59
- working-directory : ${{ env.SCRIPTS_PATH }}
67
+ zip -qq -r ${{ github.event.repository.name }}.zip addons/sourcemod
60
68
61
- - name : List files in the directory
62
- run : ls -R
63
- working-directory : ${{ env.SCRIPTS_PATH }}
64
-
65
- - name : List files in the zip
66
- run : unzip -l ${{ github.event.repository.name }}.zip
67
- working-directory : ${{ env.SCRIPTS_PATH }}
69
+ - name : List build outputs
70
+ run : |
71
+ echo "::group::Directory contents"
72
+ ls -R
73
+ echo "::endgroup::"
74
+ echo "::group::Zip contents"
75
+ unzip -l ${{ github.event.repository.name }}.zip
76
+ echo "::endgroup::"
68
77
69
- - name : Create Release
78
+ - name : Create GitHub Release
70
79
uses : ncipollo/release-action@v1
71
80
env :
72
81
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
73
82
with :
74
83
token : ${{ secrets.GITHUB_TOKEN }}
75
84
tag : ${{ steps.setup_sp.outputs.plugin-version }}
76
- artifacts : ${{ github.event.repository.name }}.zip
85
+ artifacts : ./ ${{ github.event.repository.name }}.zip
77
86
draft : true
78
87
allowUpdates : true
79
88
updateOnlyUnreleased : true
0 commit comments