Skip to content

Commit

Permalink
Prepare for release
Browse files Browse the repository at this point in the history
  • Loading branch information
BoomShotKapow committed Oct 9, 2023
1 parent 66780a9 commit 670c7c0
Show file tree
Hide file tree
Showing 3 changed files with 775 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Compile and release

on: [push, pull_request, workflow_dispatch]

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sm-version: [ "1.11.x", "1.12.x" ]
permissions:
contents: write

steps:
- uses: actions/checkout@v4

- 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: ${{ matrix.sm-version }}
version-file: ./scripting/shavit-myroute.sp

- name: Checkout Shavit's bhoptimer
uses: actions/checkout@v4
with:
repository: shavitush/bhoptimer
ref: master
path: bhoptimer

- name: Compile plugins
run: |
mkdir ../plugins
spcomp -w234 -O2 -v2 -i"include" -i"${{ github.workspace }}/bhoptimer/addons/sourcemod/scripting/include" -o"../plugins/shavit-myroute.smx" shavit-myroute.sp
echo "===OUT FILES==="
ls ../plugins
echo "===VERSION==="
echo ${{ steps.setup_sp.outputs.plugin-version }}
working-directory: ${{ env.SCRIPTS_PATH }}/scripting

- 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 }}-sm${{ matrix.sm-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: ${{ steps.setup_sp.outputs.plugin-version }}
artifacts: "${{ github.event.repository.name }}-${{ steps.setup_sp.outputs.plugin-version }}-sm${{ matrix.sm-version }}.zip"
draft: false
allowUpdates: true
prerelease: false
replacesArtifacts: true
Loading

0 comments on commit 670c7c0

Please sign in to comment.