mirror of
https://github.com/kittywitch/nixfiles.git
synced 2026-02-09 04:19:19 -08:00
fix: add back CI module dependent functionality to CI
This commit is contained in:
parent
c5e8103b6b
commit
9d219f6d63
12 changed files with 226 additions and 25 deletions
|
|
@ -6,5 +6,7 @@ wrapShellScriptBin "nf-update" ./update.sh {
|
|||
depsRuntimePath = with pkgs; [
|
||||
git
|
||||
cachix
|
||||
jq
|
||||
curl
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,24 @@
|
|||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
|
||||
DISCORD_WEBHOOK_LINK=${DISCORD_WEBHOOK_LINK:-""}
|
||||
|
||||
# Helper functions
|
||||
send_discord_message() {
|
||||
local message="$1"
|
||||
local escaped_message=$(printf '%s' "$message" | jq -R -s '.')
|
||||
curl -s -H "Accept: application/json" -H "Content-Type: application/json" \
|
||||
-X POST --data "{\"content\": $escaped_message}" "$DISCORD_WEBHOOK_LINK"
|
||||
}
|
||||
|
||||
if [[ -n ${CACHIX_SIGNING_KEY-} ]]; then
|
||||
export NF_UPDATE_CACHIX_PUSH=1
|
||||
fi
|
||||
|
||||
cd "$NF_CONFIG_ROOT"
|
||||
|
||||
send_discord_message "Beginning flake update cron job"
|
||||
|
||||
nix flake update "$@"
|
||||
|
||||
if [[ -n $(git status --porcelain ./flake.lock) ]]; then
|
||||
|
|
@ -23,6 +35,7 @@ fi
|
|||
nf-actions-test -L
|
||||
|
||||
if [[ -n ${NF_UPDATE_CACHIX_PUSH-} ]]; then
|
||||
send_discord_message "Cachix pushing"
|
||||
cachix push kittywitch "./${NF_ACTIONS_TEST_OUTLINK}"*/ &
|
||||
CACHIX_PUSH=$!
|
||||
fi
|
||||
|
|
@ -44,6 +57,7 @@ git commit --message="chore(ci): flake update"
|
|||
|
||||
if [[ ${GITHUB_REF-} = refs/heads/${NF_UPDATE_BRANCH-main} ]]; then
|
||||
git push origin HEAD:${NF_UPDATE_BRANCH-main}
|
||||
send_discord_message "Pushed a new commit!"
|
||||
fi
|
||||
|
||||
wait ${CACHIX_PUSH-}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue