ReviewOS

also looking at this

craft-native/craft

fix(release): gate registry notification on final artifact checks

#305
Merged glennmichael123 wants to merge codex/release-integration-checks into main
6 files +104 -14
.github/workflows/release.ymlmodified+11-2
Changes to .github/workflows/release.yml
@@ -397,6 +397,12 @@ jobs:
397397 gh release download "$TAG" --repo "$GITHUB_REPOSITORY" --pattern release-manifest.json --dir "$ARCHIVE_DIR/verified"
398398 bun scripts/release-manifest.ts verify "$ARCHIVE_DIR" "$ARCHIVE_DIR/verified/release-manifest.json"
399399
400 notify-registry:
401 name: notify registry after artifact verification
402 needs: [verify-release, verify-macos-downloads, attach-release-sbom]
403 runs-on: ubuntu-latest
404 permissions: {}
405 steps:
400406 # Tell the registry this version exists, with the token this workflow
401407 # already holds to publish to it.
402408 #
@@ -421,11 +427,14 @@ jobs:
421427 exit 0
422428 fi
423429
424 code=$(curl -sS -o /tmp/index.out -w '%{http_code}' --max-time 30 \
430 if ! code=$(curl -sS -o /tmp/index.out -w '%{http_code}' --max-time 30 \
425431 -X POST https://registry.pantry.dev/api/rebuild \
426432 -H "Authorization: Bearer $PANTRY_TOKEN" \
427433 -H 'Content-Type: application/json' \
428 -d '{"domain":"craft-native.org"}')
434 -d '{"domain":"craft-native.org"}'); then
435 echo "::warning::Registry request failed — it will index this on its next sweep."
436 exit 0
437 fi
429438
430439 if [ "$code" = "200" ]; then
431440 echo "Registry notified: craft-native.org queued for indexing."