Build with SourceMod 1.12 and 1.13 too #47
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
sm-version: [ '1.10.x', '1.11.x', '1.12.x', '1.13.x' ] | |
include: | |
- sm-version: '1.10.x' | |
sm-main-version: '1.10' | |
experimental: false | |
- sm-version: '1.11.x' | |
sm-main-version: '1.11' | |
experimental: true | |
- sm-version: '1.12.x' | |
sm-main-version: '1.12' | |
experimental: true | |
- sm-version: '1.13.x' | |
sm-main-version: '1.13' | |
experimental: true | |
fail-fast: false | |
continue-on-error: ${{ matrix.experimental }} | |
name: SM version ${{ matrix.sm-version }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
path: smrpg | |
- name: Setup SP | |
uses: rumblefrog/[email protected] | |
with: | |
version: ${{ matrix.sm-version }} | |
# Checkout all dependencies | |
- uses: actions/checkout@v4 | |
with: | |
repository: bcserv/smlib | |
ref: transitional_syntax | |
path: smlib | |
- uses: actions/checkout@v4 | |
with: | |
repository: Impact123/AutoExecConfig | |
path: AutoExecConfig | |
- uses: actions/checkout@v4 | |
with: | |
repository: Drifter321/DHooks2 | |
path: DHooks2 | |
- uses: actions/checkout@v4 | |
with: | |
repository: Drixevel/Chat-Processor | |
path: Chat-Processor | |
- run: git clone https://bitbucket.org/minimoney1/simple-chat-processor.git | |
- uses: actions/checkout@v4 | |
with: | |
repository: peace-maker/ColorVariables | |
ref: sm111 | |
path: ColorVariables | |
- uses: actions/checkout@v4 | |
with: | |
repository: peace-maker/mapzonelib | |
path: mapzonelib | |
- name: Setup package structure | |
shell: bash | |
run: | | |
mkdir -p package/plugins/upgrades | |
cp -R smrpg/configs package | |
cp -R smrpg/gamedata/ package/ | |
cp -R smrpg/scripting/ package/ | |
cp -R smrpg/translations/ package/ | |
GITREVCOUNT=$(cd smrpg;git rev-list --count HEAD) | |
echo "GITREVCOUNT=$GITREVCOUNT" >> $GITHUB_ENV | |
echo -e "#if defined _smrpg_version_included\n#endinput\n#endif\n#define _smrpg_version_included\n\n" > smrpg/scripting/include/smrpg/smrpg_autoversion.inc | |
echo -e "#define SMRPG_VERSION \"1.0-$GITREVCOUNT\"\n" >> smrpg/scripting/include/smrpg/smrpg_autoversion.inc | |
- name: Compile plugins | |
shell: bash | |
env: | |
PACKAGE_PATH: ${{ github.workspace }}/package | |
INCLUDE_PATHS: -i${{ github.workspace }}/smrpg/scripting/include -i${{ github.workspace }}/smlib/scripting/include -i${{ github.workspace }}/AutoExecConfig -i${{ github.workspace }}/DHooks2/sourcemod/scripting/include -i${{ github.workspace }}/ColorVariables/addons/sourcemod/scripting/include -i${{ github.workspace }}/Chat-Processor/scripting/include -i${{ github.workspace }}/simple-chat-processor/scripting/include -i${{ github.workspace }}/mapzonelib/scripting/include | |
run: | | |
cd smrpg/scripting | |
# compile base plugins | |
for f in *.sp | |
do | |
if [ "$f" != "smrpg_chattags.sp" ]; then | |
echo -e "\nCompiling $f..." | |
smxfile="`echo $f | sed -e 's/\.sp$/\.smx/'`" | |
spcomp -E $INCLUDE_PATHS $f -o$PACKAGE_PATH/plugins/$smxfile | |
fi | |
done | |
# compile both versions of chattags for both chat processors.. | |
echo -e "\nCompiling smrpg_chattags.sp for Chat Processor..." | |
spcomp -E $INCLUDE_PATHS smrpg_chattags.sp -o$PACKAGE_PATH/plugins/smrpg_chattags_cp.smx | |
echo -e "\nCompiling smrpg_chattags.sp for Simple Chat Processor..." | |
spcomp -E $INCLUDE_PATHS smrpg_chattags.sp -o$PACKAGE_PATH/plugins/smrpg_chattags_scp.smx USE_SIMPLE_PROCESSOR= | |
# compile all upgrades | |
for f in upgrades/*.sp | |
do | |
# skip the skeleton | |
if [ "$f" != "upgrades/smrpg_upgrade_example.sp" ]; then | |
echo -e "\nCompiling upgrade $f..." | |
smxfile="`echo $f | sed -e 's/\.sp$/\.smx/'`" | |
spcomp -E $INCLUDE_PATHS $f -o$PACKAGE_PATH/plugins/$smxfile | |
fi | |
done | |
rm include/smrpg/smrpg_autoversion.inc | |
# - name: Upload build | |
# if: github.event_name == 'push' && github.ref_type == 'branch' && github.ref_name == 'master' | |
# env: | |
# DROPURL: ${{ secrets.DROPURL }} | |
# UPLOADKEY: ${{ secrets.UPLOADKEY }} | |
# SMVERSION: ${{ matrix.sm-main-version }} | |
# shell: bash | |
# run: | | |
# ARCHIVE=smrpg-rev$GITREVCOUNT.tar.gz | |
# cd package | |
# tar -zcvf ../$ARCHIVE * | |
# cd .. | |
# if [ ! -z "$DROPURL" ]; then | |
# curl -F "sm=$SMVERSION" -F "key=$UPLOADKEY" -F "drop=@$ARCHIVE" $DROPURL | |
# fi | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: smrpg-rev${{ env.GITREVCOUNT }}-sm${{ matrix.sm-main-version }} | |
path: package |