nix based ci

This commit is contained in:
Robin Appelman 2025-05-04 00:43:44 +02:00
commit 55f8357128
2 changed files with 11 additions and 7 deletions

View file

@ -4,20 +4,24 @@ on:
push:
paths:
- "**.sp"
- ".github/workflows/*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Compile sourcepawn
uses: spiretf/spcomp@v0.1
- uses: cachix/install-nix-action@v20
- uses: icewind1991/attic-action@v1
with:
source: "./plugin/who.sp"
target: "./plugin/who.smx"
name: ci
instance: https://cache.icewind.me
authToken: "${{ secrets.ATTIC_TOKEN }}"
- run: nix build .#who
- run: cp result plugin/who.smx
- name: Commit files
run: |
git add plugin/who.smx
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -m "Compile sourcepawn" -a

View file

@ -22,11 +22,11 @@
in {
packages = rec {
inherit spEnv;
sdrconnect = pkgs.buildSourcePawnScript {
who = pkgs.buildSourcePawnScript {
name = "who";
src = ./plugin/who.sp;
};
default = sdrconnect;
default = who;
};
devShells.default = pkgs.mkShell {
nativeBuildInputs = [spEnv];