fix handy workflow and add push trigger for testing
handy update / update-handy (push) Failing after 8s
handy update / update-handy (push) Failing after 8s
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
name: handy update
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
schedule:
|
||||
- cron: "40 6 * * *"
|
||||
workflow_dispatch:
|
||||
@@ -56,12 +58,16 @@ jobs:
|
||||
url="https://github.com/cjpais/Handy/releases/download/v${latest_version}/Handy_${latest_version}_amd64.AppImage"
|
||||
new_hash=$(nix store prefetch-file --json "$url" | python -c 'import json,sys; print(json.load(sys.stdin)["hash"])')
|
||||
|
||||
export LATEST_VERSION="$latest_version"
|
||||
export NEW_HASH="$new_hash"
|
||||
|
||||
python - <<PY
|
||||
import re
|
||||
import os
|
||||
p='modules/pkgs/handy.nix'
|
||||
s=open(p).read()
|
||||
s=re.sub(r'version\s*=\s*"[^"]+"', f'version = "{latest_version}"', s, count=1)
|
||||
s=re.sub(r'hash\s*=\s*"[^"]+"', f'hash = "{new_hash}"', s, count=1)
|
||||
s=re.sub(r'version\s*=\s*"[^"]+"', f'version = "{os.environ["LATEST_VERSION"]}"', s, count=1)
|
||||
s=re.sub(r'hash\s*=\s*"[^"]+"', f'hash = "{os.environ["NEW_HASH"]}"', s, count=1)
|
||||
open(p,'w').write(s)
|
||||
PY
|
||||
|
||||
|
||||
Reference in New Issue
Block a user