Skip to content

Merge branch 'main' of https://github.com/blueblur0730/modified-plugins #111

Merge branch 'main' of https://github.com/blueblur0730/modified-plugins

Merge branch 'main' of https://github.com/blueblur0730/modified-plugins #111

# This is a basic workflow that is manually triggered
# Is it a ci?
name: Compile or Release
on:
pull_request:
paths: ["source/**", "include/**"]
branches: [master, main, workflow]
push:
paths: ["source/**", "include/**"]
branches: [master, main, workflow]
workflow_dispatch:
jobs:
build:
name: Build with sm-${{ matrix.sm_version }}
strategy:
fail-fast: false
matrix:
sm_version: ["1.12", "1.13"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout Repo
with:
submodules: recursive
- name: Retrive Date
run: echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- uses: actions/setup-python@v5
name: Prepare Python
with:
python-version: 3.11
- name: Install NinjaBuild
run: sudo apt-get update && sudo apt-get install -y ninja-build
- uses: rumblefrog/setup-sp@master
name: Install SourcePawn Compiler
with:
version: ${{ matrix.sm_version }}
- name: Configure and Build
run: |
python3 configure.py --spcomp-dir "$scriptingPath"
ninja
- uses: actions/upload-artifact@v4
name: Upload the Package
with:
name: modified-plugins-sm-${{ matrix.sm_version }}-${{ env.DATE }}
path: |
build/source/
build/include/
LICENSE
README.md
README-cn.md
delete:
name: delete old assets
runs-on: ubuntu-latest
steps:
- name: Delete current release assets
uses: andreaswilli/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# tagPrefix:
tag: release
deleteOnlyFromDrafts: false
release:
strategy:
fail-fast: false
matrix:
sm_version: ["1.12", "1.13"]
name: Release with sm-${{ matrix.sm_version }}
# only release if the workflow is manually triggered
# if: contains(fromJson('["workflow_dispatch"]'), github.event_name)
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout Repo
with:
submodules: recursive
- name: Retrive Date
run: echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Download package
uses: actions/download-artifact@v4
with:
path: tmp/
pattern: modified-plugins-sm-${{ matrix.sm_version }}-${{ env.DATE }}
- name: Prepare Release
working-directory: tmp/
run: |
for i in */;
do
zip -0 -r "${i%/}.zip" "$i" &
done;
wait
- name: Release
uses: xresloader/upload-to-github-release@v1
with:
file: tmp/modified-plugins-sm-${{ matrix.sm_version }}-*.zip
# delete_file: modified-plugins-sm-${{ matrix.sm_version }}-*.zip
draft: false
prerelease: false
branches: main
tag_name: release
tags: true
update_latest_release: true
# verbose: true
overwrite: true
default_release_name: modified-plugins
token: ${{ secrets.GITHUB_TOKEN }}