flake reorg

This commit is contained in:
Robin Appelman 2026-10-28 22:08:24 +01:00
commit bbc940cdfe
Signed by: robin
SSH key fingerprint: SHA256:kifqgrqnut7q1YUIrI0AdMNC23qiKAS/T9uGFmIYvbE
3 changed files with 69 additions and 82 deletions

View file

@ -3,25 +3,39 @@ name: Build sourcepawn and commit
on:
push:
paths:
- '**.sp'
- "**.sp"
- ".forgejo/workflows/**"
jobs:
build:
runs-on: ubuntu-latest
runs-on: nix
steps:
- uses: actions/checkout@v4
- name: Compile sourcepawn
uses: spiretf/spcomp@v0.1
- uses: actions/checkout@v6
- uses: https://codeberg.org/icewind/attic-action@v1
with:
source: './plugin/nochat.sp'
target: './plugin/nochat.smx'
name: link
instance: https://cache.icewind.link
authToken: "${{ secrets.ATTIC_TOKEN }}"
- name: Build
run: nix build && cp -L result/* ./plugin/
- id: check_file_outdated
name: Check if compiled smx needs committing
run: |
git status --porcelain
if [ -n "$(git status --porcelain)" ]; then
echo "compiled output has changed"
echo "outdated=true" >> $GITHUB_OUTPUT
else
echo "compiled output has unchanged"
echo "outdated=false" >> $GITHUB_OUTPUT
fi
- name: Commit files
if: steps.check_file_outdated.outputs.outdated == 'true'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git config --global user.email ""
git config --global user.name "Compile from CI"
git commit -m "Compile sourcepawn" -a
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
git push