Skip to content

Commit 4d5b06e

Browse files
authored
Update CI (#208)
* use working-directory * use setup-amxxpawn action
1 parent e0407a2 commit 4d5b06e

File tree

1 file changed

+23
-43
lines changed

1 file changed

+23
-43
lines changed

.github/workflows/CI.yml

Lines changed: 23 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -44,27 +44,13 @@ jobs:
4444
echo "::set-output name=sha::$SHA"
4545
echo "::set-output name=semver::${{ steps.semver_parser.outputs.fullversion }}"
4646
47-
- name: Setup latest AMXModX
48-
env:
49-
AMXMODX_VERSION_MINOR: "1.10"
50-
run: |
51-
LAST_VERSION_NAME=$( \
52-
curl \
53-
--silent \
54-
https://www.amxmodx.org/amxxdrop/$AMXMODX_VERSION_MINOR/amxmodx-latest-base-linux \
55-
)
56-
57-
curl \
58-
--remote-name \
59-
--remote-header-name \
60-
https://www.amxmodx.org/amxxdrop/$AMXMODX_VERSION_MINOR/$LAST_VERSION_NAME
61-
62-
tar xzf *.tar.gz
63-
6447
- name: Setup latest ReAPI includes
6548
env:
6649
REPO: "s1lentq/reapi"
6750
run: |
51+
mkdir -p dep/reapi
52+
cd dep/reapi
53+
6854
curl \
6955
--silent \
7056
https://api.github.com/repos/$REPO/releases/latest | \
@@ -74,56 +60,50 @@ jobs:
7460
7561
7z x *.zip
7662
77-
- name: Clean compiler
78-
run: |
79-
mkdir -p compiler/compiled
80-
cp -Rf addons/amxmodx/scripting/* compiler/
81-
rm -rf compiler/*.sma
82-
rm -rf compiler/testsuite/
83-
84-
rm -rf addons/
63+
echo "REAPI_INCLUDE_PATH=$(pwd)/addons/amxmodx/scripting/include" >> $GITHUB_ENV
8564
8665
- name: Update versions for plugins (release)
66+
working-directory: cstrike/addons/amxmodx/scripting/include/
8767
if: |
8868
github.event_name == 'release' &&
8969
github.event.action == 'published' &&
9070
startsWith(github.ref, 'refs/tags/')
9171
env:
9272
PLUGIN_VERSION: "v${{ steps.semver_parser.outputs.fullversion }}"
93-
run: |
94-
cd cstrike/addons/amxmodx/scripting/include/
95-
sed -i "s|%CA_VERSION%|$PLUGIN_VERSION|g" ChatAdditions.inc
73+
run: sed -i "s|%CA_VERSION%|$PLUGIN_VERSION|g" ChatAdditions.inc
9674

97-
- name: Update versions for plugins
75+
- name: Update versions for plugins (only for artifacts builds)
76+
working-directory: cstrike/addons/amxmodx/scripting/include/
9877
env:
9978
PLUGIN_VERSION: "${{ env.COMMIT_SHA }}"
100-
run: |
101-
cd cstrike/addons/amxmodx/scripting/include/
102-
sed -i "s|%CA_VERSION%|$PLUGIN_VERSION|g" ChatAdditions.inc
79+
run: sed -i "s|%CA_VERSION%|$PLUGIN_VERSION|g" ChatAdditions.inc
10380

104-
- name: Build
81+
- name: Setup AMXXPawn Compiler
82+
uses: wopox1337/setup-amxxpawn@v1
83+
with:
84+
version: "1.10.5428"
85+
86+
- name: Compile AMXX plugins
87+
working-directory: cstrike/addons/amxmodx/scripting/
10588
env:
106-
COMPILER_PATH: "compiler"
89+
REAPI_INCLUDE: ${{env.REAPI_INCLUDE_PATH}}
10790
run: |
108-
cp -Rf cstrike/addons/amxmodx/scripting/* compiler/
109-
cd compiler
91+
mkdir ../plugins/
11092
11193
for sourcefile in *.sma;
11294
do
11395
amxxfile="`echo $sourcefile | sed -e 's/\.sma$/.amxx/'`"
114-
echo -n "Compiling $sourcefile ..."
115-
./amxxpc $sourcefile -ocompiled/$amxxfile >> temp.txt
116-
echo "done"
117-
done
96+
echo -n "Compiling $sourcefile ... "
11897
119-
cat temp.txt
120-
rm temp.txt
98+
amxxpc $sourcefile -o"../plugins/$amxxfile" \
99+
-i"include" \
100+
-i"$REAPI_INCLUDE"
101+
done
121102
122103
- name: Move files
123104
run: |
124105
mkdir publish
125106
mv cstrike/ publish/
126-
mv compiler/compiled/ publish/cstrike/addons/amxmodx/plugins/
127107
128108
- name: Upload artifact
129109
uses: actions/upload-artifact@v2

0 commit comments

Comments
 (0)