ReviewOS

also looking at this

craft-native/craft

fix(release): publish one complete platform manifest

#293
Merged glennmichael123 wants to merge codex/complete-release-manifest into main
4 files +145 -2
.github/workflows/release.ymlmodified+18-2
Changes to .github/workflows/release.yml
@@ -346,9 +346,11 @@ jobs:
346346 if: ${{ !cancelled() && needs.validate-release.result == 'success' }}
347347 runs-on: ubuntu-latest
348348 permissions:
349 contents: read
349 contents: write
350350
351351 steps:
352 - uses: actions/checkout@v6
353 - uses: oven-sh/setup-bun@v2
352354 - name: Every platform pantry installs must have shipped
353355 env:
354356 GH_TOKEN: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }}
@@ -358,7 +360,7 @@ jobs:
358360
359361 # Kept in step with the `required` list in pantry's recipe:
360362 # packages/ts-pantry/src/recipes/craft-native.org.ts
361 REQUIRED="craft-darwin-arm64.zip craft-darwin-x64.zip craft-linux-x64.zip"
363 REQUIRED="craft-darwin-arm64.zip craft-darwin-x64.zip craft-linux-x64.zip craft-windows-x64.zip"
362364
363365 echo "Assets on $TAG:"
364366 ASSETS=$(gh release view "$TAG" --repo "$GITHUB_REPOSITORY" --json assets -q '.assets[].name')
@@ -377,6 +379,20 @@ jobs:
377379
378380 echo "All required assets present."
379381
382 - name: Publish and verify the complete release manifest
383 env:
384 GH_TOKEN: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }}
385 TAG: ${{ github.ref_name }}
386 run: |
387 set -euo pipefail
388 ARCHIVE_DIR=$(mktemp -d)
389 gh release download "$TAG" --repo "$GITHUB_REPOSITORY" --pattern 'craft-*.zip' --dir "$ARCHIVE_DIR"
390 bun scripts/release-manifest.ts create "$ARCHIVE_DIR" "$ARCHIVE_DIR/release-manifest.json"
391 gh release upload "$TAG" --repo "$GITHUB_REPOSITORY" "$ARCHIVE_DIR/release-manifest.json" --clobber
392 mkdir "$ARCHIVE_DIR/verified"
393 gh release download "$TAG" --repo "$GITHUB_REPOSITORY" --pattern release-manifest.json --dir "$ARCHIVE_DIR/verified"
394 bun scripts/release-manifest.ts verify "$ARCHIVE_DIR" "$ARCHIVE_DIR/verified/release-manifest.json"
395
380396 # Tell the registry this version exists, with the token this workflow
381397 # already holds to publish to it.
382398 #