also looking at this
fix(release): publish one complete platform manifest
#293
4 files
+145
-2
| @@ -346,9 +346,11 @@ jobs: | ||
| 346 | 346 | if: ${{ !cancelled() && needs.validate-release.result == 'success' }} |
| 347 | 347 | runs-on: ubuntu-latest |
| 348 | 348 | permissions: |
| 349 | contents: read | |
| 349 | contents: write | |
| 350 | 350 | |
| 351 | 351 | steps: |
| 352 | - uses: actions/checkout@v6 | |
| 353 | - uses: oven-sh/setup-bun@v2 | |
| 352 | 354 | - name: Every platform pantry installs must have shipped |
| 353 | 355 | env: |
| 354 | 356 | GH_TOKEN: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }} |
| @@ -358,7 +360,7 @@ jobs: | ||
| 358 | 360 | |
| 359 | 361 | # Kept in step with the `required` list in pantry's recipe: |
| 360 | 362 | # 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" | |
| 362 | 364 | |
| 363 | 365 | echo "Assets on $TAG:" |
| 364 | 366 | ASSETS=$(gh release view "$TAG" --repo "$GITHUB_REPOSITORY" --json assets -q '.assets[].name') |
| @@ -377,6 +379,20 @@ jobs: | ||
| 377 | 379 | |
| 378 | 380 | echo "All required assets present." |
| 379 | 381 | |
| 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 | ||
| 380 | 396 | # Tell the registry this version exists, with the token this workflow |
| 381 | 397 | # already holds to publish to it. |
| 382 | 398 | # |