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

View file

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