Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikusch committed Feb 22, 2024
1 parent 3aa17b9 commit 4f1baf0
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 63 deletions.
63 changes: 0 additions & 63 deletions .github/workflows/compile.yml

This file was deleted.

71 changes: 71 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Compile and release

on:
push:
branches:
master

env:
PLUGIN_NAME: hwn_cosmetic_enabler

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: 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

0 comments on commit 4f1baf0

Please sign in to comment.