mirror of
https://codeberg.org/spire/autoexec.git
synced 2026-08-02 12:14:52 +02:00
42 lines
1.1 KiB
YAML
42 lines
1.1 KiB
YAML
name: Build sourcepawn and commit
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- '**.sp'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: nix
|
|
env:
|
|
PLUGIN: "autoexec"
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- 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/${{ env.PLUGIN }}.smx
|
|
|
|
- id: check_file_outdated
|
|
name: Check if compiled smx needs committing
|
|
run: |
|
|
git status --porcelain
|
|
if [ -n "$(git status --porcelain)" ]; then
|
|
echo "${{ env.PLUGIN }}.smx is changed"
|
|
echo "outdated=true" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "${{ env.PLUGIN }}.smx is 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
|