@@ -3,77 +3,86 @@ name: Compile and release
33on :
44 push :
55 branches :
6- master
6+ - master
77
88env :
99 PLUGIN_NAME : prophunt
10+ SCRIPTS_PATH : addons/sourcemod/scripting
1011
1112jobs :
1213 build :
1314 runs-on : ubuntu-latest
1415 strategy :
1516 matrix :
1617 sm-version : [ '1.12.x' ]
17- permissions :
18- contents : write
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/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
3443
3544 - name : Setup SourcePawn Compiler ${{ matrix.sm-version }}
3645 id : setup_sp
3746 uses : rumblefrog/setup-sp@master
3847 with :
3948 version : ${{ matrix.sm-version }}
40- version-file : ./addons/sourcemod/scripting /${{ env.PLUGIN_NAME }}.sp
49+ version-file : ${{ env.SCRIPTS_PATH }} /${{ env.PLUGIN_NAME }}.sp
4150 define-name : PLUGIN_VERSION
4251
43- - name : Compile plugins
52+ - name : Compile plugin
4453 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 ==="
4857 ls ../plugins
49- echo "===VERSION==="
58+ echo "=== VERSION ==="
5059 echo ${{ steps.setup_sp.outputs.plugin-version }}
51- working-directory : ${{ env.SCRIPTS_PATH }}/addons/sourcemod/scripting
60+ working-directory : ${{ env.SCRIPTS_PATH }}
5261
53- - name : Install zip
62+ - name : Install zip utility
5463 uses : montudor/action-zip@v1
5564
5665 - name : Zip output
5766 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
6068
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::"
6877
69- - name : Create Release
78+ - name : Create GitHub Release
7079 uses : ncipollo/release-action@v1
7180 env :
7281 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
7382 with :
7483 token : ${{ secrets.GITHUB_TOKEN }}
7584 tag : ${{ steps.setup_sp.outputs.plugin-version }}
76- artifacts : ${{ github.event.repository.name }}.zip
85+ artifacts : ./ ${{ github.event.repository.name }}.zip
7786 draft : true
7887 allowUpdates : true
7988 updateOnlyUnreleased : true
0 commit comments