mirror of
https://codeberg.org/spire/nochat.git
synced 2026-11-30 02:00:46 +01:00
flake reorg
This commit is contained in:
parent
7c161d4eef
commit
bbc940cdfe
3 changed files with 69 additions and 82 deletions
40
.github/workflows/compile.yml
vendored
40
.github/workflows/compile.yml
vendored
|
|
@ -3,25 +3,39 @@ name: Build sourcepawn and commit
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
- '**.sp'
|
- "**.sp"
|
||||||
|
- ".forgejo/workflows/**"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: nix
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- name: Compile sourcepawn
|
- uses: https://codeberg.org/icewind/attic-action@v1
|
||||||
uses: spiretf/spcomp@v0.1
|
|
||||||
with:
|
with:
|
||||||
source: './plugin/nochat.sp'
|
name: link
|
||||||
target: './plugin/nochat.smx'
|
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
|
- name: Commit files
|
||||||
|
if: steps.check_file_outdated.outputs.outdated == 'true'
|
||||||
run: |
|
run: |
|
||||||
git config --local user.email "action@github.com"
|
git config --global user.email ""
|
||||||
git config --local user.name "GitHub Action"
|
git config --global user.name "Compile from CI"
|
||||||
git commit -m "Compile sourcepawn" -a
|
git commit -m "Compile sourcepawn" -a
|
||||||
- name: Push changes
|
git push
|
||||||
uses: ad-m/github-push-action@master
|
|
||||||
with:
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
|
||||||
89
flake.lock
generated
89
flake.lock
generated
|
|
@ -7,11 +7,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1759818365,
|
"lastModified": 1793039426,
|
||||||
"narHash": "sha256-N8jwqZ9T1ZBznv4gJ6aaHV3FZiYyErbIqeY3cxNQ07E=",
|
"narHash": "sha256-h1ltnuVmtdXZAruOMxMVfiacB43PA/Srwrr4+iuWNuo=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "flakelight",
|
"repo": "flakelight",
|
||||||
"rev": "eda172d7ead89292cb7f9e136a482e97e00873a4",
|
"rev": "b3da3d82a9f10f306551eb586cce0e49428b1d8f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -22,16 +22,16 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1760048741,
|
"lastModified": 1793015021,
|
||||||
"narHash": "sha256-Jj+2qvTpPwU+KD2y2QSiqg4J3vsA3as6YsPl/s/6EzQ=",
|
"narHash": "sha256-Ee5BWo8sh3pGt70QUdRajnaginqFmWvrtdBc4gJzhks=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "86aeb8a48968515e7e5625252e79137ccee0af8f",
|
"rev": "718f670e845328e9c2cecdd832835712b2cbd065",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"id": "nixpkgs",
|
"id": "nixpkgs",
|
||||||
"ref": "release-25.05",
|
"ref": "nixos-26.05",
|
||||||
"type": "indirect"
|
"type": "indirect"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -39,60 +39,51 @@
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flakelight": "flakelight",
|
"flakelight": "flakelight",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"spire": "spire",
|
"spire": "spire"
|
||||||
"utils": "utils"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"spire": {
|
"spire": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flakelight": [
|
"flakelight": [
|
||||||
"flakelight"
|
"flakelight"
|
||||||
|
],
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"steam-fetcher": "steam-fetcher"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1793221599,
|
||||||
|
"narHash": "sha256-0RdekqEwbNuR0ve/jEEwh6QQvQXfaSRRofL0E65+Y/A=",
|
||||||
|
"ref": "refs/heads/main",
|
||||||
|
"rev": "520cf4e47ef47efec3f1ba2341ab0f7af68cd477",
|
||||||
|
"revCount": 99,
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://codeberg.org/spire/nix"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://codeberg.org/spire/nix"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"steam-fetcher": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"spire",
|
||||||
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1750433696,
|
"lastModified": 1758622040,
|
||||||
"narHash": "sha256-UVtSgRUzgHKUWcjsVQQM/6J8x35ly/7+P9/xbXeGLtc=",
|
"narHash": "sha256-BRUZZoQDCD1qByJjHm4YKipQlB2PburWLG9Iaggr8XQ=",
|
||||||
"ref": "refs/heads/main",
|
"owner": "nix-community",
|
||||||
"rev": "f3b763c6b9c0c31924ac2ba1b6541c2b08ed9852",
|
"repo": "steam-fetcher",
|
||||||
"revCount": 33,
|
"rev": "ab5e3a0828b4b179feb548c57be584ce812956a8",
|
||||||
"type": "git",
|
|
||||||
"url": "https://codeberg.org/spire/nix"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://codeberg.org/spire/nix"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"systems": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1681028828,
|
|
||||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nix-systems",
|
"owner": "nix-community",
|
||||||
"repo": "default",
|
"repo": "steam-fetcher",
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"utils": {
|
|
||||||
"inputs": {
|
|
||||||
"systems": "systems"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1731533236,
|
|
||||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
44
flake.nix
44
flake.nix
|
|
@ -1,36 +1,18 @@
|
||||||
{
|
{
|
||||||
inputs = {
|
inputs = {
|
||||||
utils.url = "github:numtide/flake-utils";
|
nixpkgs.url = "nixpkgs/nixos-26.05";
|
||||||
nixpkgs.url = "nixpkgs/release-25.05";
|
flakelight = {
|
||||||
flakelight.url = "github:nix-community/flakelight";
|
url = "github:nix-community/flakelight";
|
||||||
spire.url = "git+https://codeberg.org/spire/nix";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
flakelight.inputs.nixpkgs.follows = "nixpkgs";
|
};
|
||||||
spire.inputs.flakelight.follows = "flakelight";
|
spire = {
|
||||||
|
url = "git+https://codeberg.org/spire/nix";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
inputs.flakelight.follows = "flakelight";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs =
|
||||||
self,
|
{ spire, ... }:
|
||||||
nixpkgs,
|
spire ./. { };
|
||||||
utils,
|
|
||||||
spire,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
utils.lib.eachSystem ["x86_64-linux" "i686-linux"] (system: let
|
|
||||||
overlays = [spire.overlays.default];
|
|
||||||
pkgs = (import nixpkgs) {
|
|
||||||
inherit system overlays;
|
|
||||||
};
|
|
||||||
spEnv = pkgs.sourcepawn.buildEnv (with pkgs.sourcepawn.includes; [sourcemod]);
|
|
||||||
in rec {
|
|
||||||
packages = rec {
|
|
||||||
nochat = pkgs.buildSourcePawnScript {
|
|
||||||
name = "nochat";
|
|
||||||
src = ./plugin/nochat.sp;
|
|
||||||
};
|
|
||||||
default = nochat;
|
|
||||||
};
|
|
||||||
devShells.default = pkgs.mkShell {
|
|
||||||
nativeBuildInputs = with pkgs; [spEnv];
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue