feat: add release scripts

This commit is contained in:
eric
2026-03-04 05:32:21 +01:00
parent 1549f7637b
commit b7bc8ec713
16 changed files with 2591 additions and 1 deletions

View File

@@ -0,0 +1,56 @@
# release.nix
{
pkgs,
readVersion,
writeVersion,
postVersion ? "",
versionFiles ? [ ],
channels ? [
"alpha"
"beta"
"rc"
"internal"
],
extraRuntimeInputs ? [ ],
}:
let
channelList = pkgs.lib.concatStringsSep " " channels;
versionFilesScript = pkgs.lib.concatMapStrings (f: ''
mkdir -p "$(dirname "${f.path}")"
${f.content} > "${f.path}"
log "Generated version file: ${f.path}"
'') versionFiles;
script =
builtins.replaceStrings
[
"__CHANNEL_LIST__"
"__VERSION_FILES__"
"__READ_VERSION__"
"__WRITE_VERSION__"
"__POST_VERSION__"
]
[
channelList
versionFilesScript
readVersion
writeVersion
postVersion
]
(builtins.readFile ./release.sh);
in
pkgs.writeShellApplication {
name = "release";
runtimeInputs =
with pkgs;
[
git
gnugrep
gawk
gnused
coreutils
]
++ extraRuntimeInputs;
text = script;
}