Skip to content

Compile and release

Compile and release #2

name: Compile and release
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Set environment variables
run: echo SCRIPTS_PATH=$(pwd) >> $GITHUB_ENV
- name: Setup SourcePawn Compiler ${{ matrix.SM_VERSION }}
id: setup_sp
uses: rumblefrog/setup-sp@master
with:
version: "1.11.x"
version-file: ./scripting/attr_knockback_modifier.sp
- name: Download SourcePawn plugin dependencies
uses: Zabaniya001/SPDependy@v2
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
- name: Compile plugins
run: |
mkdir plugins
spcomp -w234 -O2 -v2 -i"scripting/include" -i".temp/include" -o"plugins/attribute_viewmodel_override.smx" scripting/attribute_viewmodel_override.sp
working-directory: ${{ env.SCRIPTS_PATH }}
- name: Changelog
id: changelog
uses: mindsers/changelog-reader-action@v2
- name: Install zip
uses: montudor/action-zip@v1
- name: Zip output
run: |
zip -qq -y -r ${{ github.event.repository.name }}-${{ steps.setup_sp.outputs.plugin-version }}.zip configs plugins scripting extensions gamedata translations data
working-directory: ${{ env.SCRIPTS_PATH }}
- name: Create Release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
artifacts: "${{ github.event.repository.name }}-${{ steps.setup_sp.outputs.plugin-version }}.zip"
body: ${{ steps.changelog.outputs.changes }}
draft: false
allowUpdates: true
prerelease: false
replacesArtifacts: true