Bump version #5
This file contains hidden or 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: Compile and release | |
| on: | |
| push: | |
| branches: | |
| - master | |
| env: | |
| PLUGIN_NAME: tf-bhop | |
| SCRIPTS_PATH: addons/sourcemod/scripting | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| sm-version: [ '1.12.x' ] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Prepare include directory | |
| run: mkdir -p ${{ env.SCRIPTS_PATH }}/include | |
| - name: Download include files | |
| run: | | |
| includes=( | |
| "https://raw.githubusercontent.com/FlaminSarge/tf2attributes/refs/heads/master/scripting/include/tf2attributes.inc" | |
| "https://raw.githubusercontent.com/nosoop/SMExt-SourceScramble/refs/heads/master/scripting/include/sourcescramble.inc" | |
| ) | |
| mkdir -p "${{ env.SCRIPTS_PATH }}/include" | |
| for url in "${includes[@]}"; do | |
| echo "Downloading $url" | |
| curl -sSL -O --output-dir "${{ env.SCRIPTS_PATH }}/include" "$url" | |
| done | |
| - name: Setup SourcePawn compiler ${{ matrix.sm-version }} | |
| id: setup_sp | |
| uses: rumblefrog/setup-sp@master | |
| with: | |
| version: ${{ matrix.sm-version }} | |
| version-file: ${{ env.SCRIPTS_PATH }}/${{ env.PLUGIN_NAME }}.sp | |
| define-name: PLUGIN_VERSION | |
| - name: Compile plugin | |
| run: | | |
| mkdir -p ../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 }} | |
| - name: Install zip utility | |
| uses: montudor/action-zip@v1 | |
| - name: Zip output | |
| run: | | |
| zip -qq -r ${{ github.event.repository.name }}.zip addons/sourcemod | |
| - name: List build outputs | |
| run: | | |
| echo "::group::Directory contents" | |
| ls -R | |
| echo "::endgroup::" | |
| echo "::group::Zip contents" | |
| unzip -l ${{ github.event.repository.name }}.zip | |
| echo "::endgroup::" | |
| - name: Create GitHub 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: ./${{ github.event.repository.name }}.zip | |
| draft: true | |
| allowUpdates: true | |
| updateOnlyUnreleased: true | |
| skipIfReleaseExists: true |