nochat/.github/workflows/compile.yml
2026-10-28 22:08:47 +01:00

41 lines
1.1 KiB
YAML

name: Build sourcepawn and commit
on:
push:
paths:
- "**.sp"
- ".forgejo/workflows/**"
jobs:
build:
runs-on: nix
steps:
- uses: actions/checkout@v6
- uses: https://codeberg.org/icewind/attic-action@v1
with:
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 --global user.email ""
git config --global user.name "Compile from CI"
git commit -m "Compile sourcepawn" -a
git push