-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update.sh: port to nushell, move git push into script
- Loading branch information
1 parent
201d737
commit 49d8153
Showing
4 changed files
with
53 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ jobs: | |
github_access_token: ${{ secrets.GITHUB_TOKEN }} | ||
extra_nix_config: | | ||
system-features = kvm nixos-test | ||
experimental-features = nix-command flakes | ||
- uses: cachix/cachix-action@v12 | ||
with: | ||
name: nixpkgs-wayland | ||
|
@@ -26,13 +27,10 @@ jobs: | |
run: | | ||
git config --global user.name 'Cole Botkens' | ||
git config --global user.email '[email protected]' | ||
- name: pre-load-devshell | ||
run: | | ||
nix build '.#devShell.x86_64-linux.default' | ||
- name: update | ||
env: | ||
CACHIX_SIGNING_KEY: "${{ secrets.cachix_key_nixpkgs_wayland }}" | ||
run: | | ||
set -xeuo pipefail | ||
nix develop -c nix flake update --commit-lock-file | ||
nix develop -c ./update.sh | ||
- name: push | ||
run: | | ||
git push origin HEAD | ||
nix develop -c ./update.nu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,6 +85,7 @@ | |
git | ||
jq | ||
mercurial | ||
nushell | ||
openssh | ||
ripgrep | ||
]) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env nu | ||
|
||
let DIR = ($env.FILE_PWD) | ||
let cache = "nixpkgs-wayland" | ||
|
||
print -e $"::group::flake-lock-update" | ||
do { | ||
nix flake lock --recreate-lock-file --commit-lock-file | ||
} | ||
print -e $"::endgroup::" | ||
|
||
print -e $"::group::firefox-update" | ||
let commitmsg = do { | ||
let oldversion = (cat latest.json | ||
| jq -r '.["x86_64-linux"].versionInfo["firefox-nightly-bin"].chksum' | ||
| grep -Eo '[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}') | ||
|
||
print -e $"::notice ::oldversion=($oldversion)" | ||
|
||
rm latest.json | ||
nix eval --impure '.#latest' --json | jq out> latest.json | ||
|
||
let newversion = (cat latest.json | ||
| jq -r '.["x86_64-linux"].versionInfo["firefox-nightly-bin"].chksum' | ||
| grep -Eo '[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}') | ||
|
||
print -e $"::notice ::newversion=($newversion)" | ||
|
||
return $"firefox-nightly-bin: ($oldversion) -> ($newversion)" | ||
} | ||
print -e "::endgroup::" | ||
|
||
print -e $"::group::nix-flake-check" | ||
do { | ||
nix flake check -j1 -L | ||
} | ||
print -e $"::endgroup::" | ||
|
||
print -e $"::group::git-commit-push" | ||
if ("GITHUB_ACTIONS" in $env) { | ||
print -e $"::notice ::commitmsg=($commitmsg)" | ||
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::" |