-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathupdate.nu
executable file
·49 lines (40 loc) · 1.14 KB
/
update.nu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env nu
print -e $"::group::flake-lock-update"
do {
nix flake update --commit-lock-file
}
print -e $"::endgroup::"
print -e $"::group::firefox-update"
let commitmsg = do {
let oldversion = (cat latest.json | jq -r '."linux-x86_64".nightly.date')
print -e $"::notice ::oldversion=($oldversion)"
./generate.nu
let newversion = (cat latest.json | jq -r '."linux-x86_64".nightly.date')
print -e $"::notice ::newversion=($newversion)"
$"firefox-nightly-bin: ($oldversion) -> ($newversion)"
}
print -e "::endgroup::"
print -e $"::group::nix-build"
do {
nix build . --keep-going -L
}
print -e $"::endgroup::"
print -e $"::group::nix-flake-check"
try {
nix flake check --keep-going -j1 -L
print -e $"::notice ::nix flake check = pass"
} catch {
print -e $"::warning ::nix flake check = FAIL"
}
print -e $"::endgroup::"
print -e $"::group::git-commit-push"
if ("GITHUB_ACTIONS" in $env) {
print -e $"::notice ::commitmsg=($commitmsg)"
do -i {
git commit ./latest.json -m $commitmsg
git push origin HEAD
}
} else {
print -e $"skipping git actions, we're not running in GitHub Actions"
}
print -e $"::endgroup::"