From b8ab4d78ed22c1b7ed64dc8daf389cdb859cd3a4 Mon Sep 17 00:00:00 2001 From: Mikusch Date: Fri, 29 Mar 2024 16:18:30 +0100 Subject: [PATCH] Add CI and bump version --- .github/workflows/main.yml | 76 +++++++++++++++++++++++++++ addons/sourcemod/scripting/tf-bhop.sp | 4 +- 2 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..15ba3b0 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,76 @@ +name: Compile and release + +on: + push: + branches: + master + +env: + PLUGIN_NAME: tf-bhop + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + sm-version: [ '1.11.x' ] + permissions: + contents: write + + steps: + - uses: actions/checkout@v4 + + - name: Set environment variables + run: echo SCRIPTS_PATH=$(pwd) >> $GITHUB_ENV + + - name: Download includes + run: | + wget -P ${{ env.SCRIPTS_PATH }}/addons/sourcemod/scripting/include https://raw.githubusercontent.com/FlaminSarge/tf2attributes/master/scripting/include/tf2attributes.inc + wget -P ${{ env.SCRIPTS_PATH }}/addons/sourcemod/scripting/include https://raw.githubusercontent.com/nosoop/SMExt-SourceScramble/master/scripting/include/sourcescramble.inc + + - name: Setup SourcePawn Compiler ${{ matrix.sm-version }} + id: setup_sp + uses: rumblefrog/setup-sp@master + with: + version: ${{ matrix.sm-version }} + version-file: ./addons/sourcemod/scripting/${{ env.PLUGIN_NAME }}.sp + define-name: PLUGIN_VERSION + + - name: Compile plugins + run: | + mkdir ../plugins + spcomp -v2 -E -i "include" -o"../plugins/${{ env.PLUGIN_NAME }}.smx" ${{ env.PLUGIN_NAME }}.sp + echo "===OUT FILES===" + ls ../plugins + echo "===VERSION===" + echo ${{ steps.setup_sp.outputs.plugin-version }} + working-directory: ${{ env.SCRIPTS_PATH }}/addons/sourcemod/scripting + + - name: Install zip + uses: montudor/action-zip@v1 + + - name: Zip output + run: | + zip -qq -y -r ${{ github.event.repository.name }}.zip configs plugins scripting extensions gamedata translations data + working-directory: ${{ env.SCRIPTS_PATH }}/addons/sourcemod + + - name: List files in the directory + run: ls -R + working-directory: ${{ env.SCRIPTS_PATH }}/addons/sourcemod + + - name: List files in the zip + run: unzip -l ${{ github.event.repository.name }}.zip + working-directory: ${{ env.SCRIPTS_PATH }}/addons/sourcemod + + - name: Create Release + uses: ncipollo/release-action@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + token: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ steps.setup_sp.outputs.plugin-version }} + artifacts: addons/sourcemod/${{ github.event.repository.name }}.zip + draft: true + allowUpdates: true + updateOnlyUnreleased: true + skipIfReleaseExists: true diff --git a/addons/sourcemod/scripting/tf-bhop.sp b/addons/sourcemod/scripting/tf-bhop.sp index 4b57be4..5e10903 100644 --- a/addons/sourcemod/scripting/tf-bhop.sp +++ b/addons/sourcemod/scripting/tf-bhop.sp @@ -26,6 +26,8 @@ #pragma semicolon 1 #pragma newdecls required +#define PLUGIN_VERSION "1.7.1" + enum { WL_NotInWater = 0, @@ -55,7 +57,7 @@ public Plugin myinfo = name = "[TF2] Simple Bunnyhop", author = "Mikusch", description = "Simple TF2 bunnyhopping plugin", - version = "1.7.0", + version = PLUGIN_VERSION, url = "https://github.com/Mikusch/tf-bhop" }