🤖 codex: update app pin helper + docs channel

What:
- accept Clawdbot/Clawdis app zip names in update-pins
- auto-fix app hash when fetchzip differs
- rename Discord channel reference in README

Why:
- upstream release assets renamed
- keep pin updates reliable

Tests:
- not run (script change only)
This commit is contained in:
DJTBOT 2026-01-17 20:21:49 +01:00
parent fe14084d16
commit f7a287fb28
2 changed files with 23 additions and 6 deletions

View File

@ -4,7 +4,7 @@
>
> macOS + Linux (headless). Windows is out of scope for now.
>
> <sub>Questions? Join the Clawdbot Discord and ask in **#nix-packaging**: https://discord.com/channels/1456350064065904867/1457003026412736537</sub>
> <sub>Questions? Join the Clawdbot Discord and ask in **#golden-path-deployments**: https://discord.com/channels/1456350064065904867/1457003026412736537</sub>
## Table of Contents

View File

@ -135,16 +135,16 @@ if [[ -z "$release_json" ]]; then
echo "Failed to fetch release metadata" >&2
exit 1
fi
release_tag=$(printf '%s' "$release_json" | jq -r '[.[] | select([.assets[]?.name | (test("^Clawdis-.*\\.zip$") and (test("dSYM") | not))] | any)][0].tag_name // empty')
release_tag=$(printf '%s' "$release_json" | jq -r '[.[] | select([.assets[]?.name | (test("^(Clawdbot|Clawdis)-.*\\.zip$") and (test("dSYM") | not))] | any)][0].tag_name // empty')
if [[ -z "$release_tag" ]]; then
echo "Failed to resolve a release tag with a Clawdis app asset" >&2
echo "Failed to resolve a release tag with a Clawdbot app asset" >&2
exit 1
fi
log "Latest app release tag with asset: $release_tag"
app_url=$(printf '%s' "$release_json" | jq -r '[.[] | select([.assets[]?.name | (test("^Clawdis-.*\\.zip$") and (test("dSYM") | not))] | any)][0].assets[] | select(.name | (test("^Clawdis-.*\\.zip$") and (test("dSYM") | not))) | .browser_download_url' | head -n 1 || true)
app_url=$(printf '%s' "$release_json" | jq -r '[.[] | select([.assets[]?.name | (test("^(Clawdbot|Clawdis)-.*\\.zip$") and (test("dSYM") | not))] | any)][0].assets[] | select(.name | (test("^(Clawdbot|Clawdis)-.*\\.zip$") and (test("dSYM") | not))) | .browser_download_url' | head -n 1 || true)
if [[ -z "$app_url" ]]; then
echo "Failed to resolve Clawdis app asset URL from latest release" >&2
echo "Failed to resolve Clawdbot app asset URL from latest release" >&2
exit 1
fi
log "App asset URL: $app_url"
@ -199,7 +199,24 @@ trap - EXIT
log "Building app to validate fetchzip hash"
current_system=$(nix eval --impure --raw --expr 'builtins.currentSystem' 2>/dev/null || true)
if [[ "$current_system" == *darwin* ]]; then
nix build .#clawdbot-app --accept-flake-config
app_build_log=$(mktemp)
if ! nix build .#clawdbot-app --accept-flake-config >"$app_build_log" 2>&1; then
app_hash_mismatch=$(grep -Eo 'got: *sha256-[A-Za-z0-9+/=]+' "$app_build_log" | head -n 1 | sed 's/.*got: *//' || true)
if [[ -n "$app_hash_mismatch" ]]; then
log "App hash mismatch detected: $app_hash_mismatch"
perl -0pi -e "s|hash = \"[^\"]+\";|hash = \"${app_hash_mismatch}\";|" "$app_file"
if ! nix build .#clawdbot-app --accept-flake-config >"$app_build_log" 2>&1; then
tail -n 200 "$app_build_log" >&2 || true
rm -f "$app_build_log"
exit 1
fi
else
tail -n 200 "$app_build_log" >&2 || true
rm -f "$app_build_log"
exit 1
fi
fi
rm -f "$app_build_log"
else
log "Skipping app build on non-darwin system (${current_system:-unknown})"
fi