fix v2 release gate determinism

This commit is contained in:
ajnart committed 2026-07-28 14:19:34 +02:00
1 parent 723b46926a
commit 4ac9d21bc1
2 files changed
+38 -6

No files matched your search

+37 -6
View File
@@ -397,7 +397,8 @@ jobs:
needs: [container, preview-arm64] needs: [container, preview-arm64]
if: | if: |
( (
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || github.event_name == 'merge_group' ||
github.event_name == 'pull_request' ||
(github.event_name == 'workflow_dispatch' && inputs.operation == 'publish') (github.event_name == 'workflow_dispatch' && inputs.operation == 'publish')
) )
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -410,7 +411,12 @@ jobs:
PREVIEW_TAG: pr-${{ github.event.pull_request.number || inputs.pr_number }} PREVIEW_TAG: pr-${{ github.event.pull_request.number || inputs.pr_number }}
steps: steps:
- name: Log in to GHCR - name: Log in to GHCR
if: "!env.ACT" if: |
!env.ACT &&
(
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) ||
(github.event_name == 'workflow_dispatch' && inputs.operation == 'publish')
)
uses: docker/login-action@v4 uses: docker/login-action@v4
with: with:
registry: ${{ env.REGISTRY }} registry: ${{ env.REGISTRY }}
@@ -418,12 +424,17 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx - name: Set up Docker Buildx
if: "!env.ACT" if: |
!env.ACT &&
(
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) ||
(github.event_name == 'workflow_dispatch' && inputs.operation == 'publish')
)
uses: docker/setup-buildx-action@v4 uses: docker/setup-buildx-action@v4
- name: Verify PR head before publication - name: Verify PR head before publication
id: publication-preflight id: publication-preflight
if: github.event_name == 'pull_request' if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
uses: actions/github-script@v8 uses: actions/github-script@v8
env: env:
EXPECTED_HEAD_SHA: ${{ github.event.pull_request.head.sha }} EXPECTED_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
@@ -449,7 +460,14 @@ jobs:
- name: Publish preview manifest - name: Publish preview manifest
if: | if: |
!env.ACT && !env.ACT &&
(github.event_name != 'pull_request' || steps.publication-preflight.outputs.publish == 'true') (
(
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository &&
steps.publication-preflight.outputs.publish == 'true'
) ||
(github.event_name == 'workflow_dispatch' && inputs.operation == 'publish')
)
env: env:
AMD64_DIGEST: ${{ needs.container.outputs.digest }} AMD64_DIGEST: ${{ needs.container.outputs.digest }}
ARM64_DIGEST: ${{ needs.preview-arm64.outputs.digest }} ARM64_DIGEST: ${{ needs.preview-arm64.outputs.digest }}
@@ -461,7 +479,14 @@ jobs:
- name: Verify preview manifest platforms - name: Verify preview manifest platforms
if: | if: |
!env.ACT && !env.ACT &&
(github.event_name != 'pull_request' || steps.publication-preflight.outputs.publish == 'true') (
(
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository &&
steps.publication-preflight.outputs.publish == 'true'
) ||
(github.event_name == 'workflow_dispatch' && inputs.operation == 'publish')
)
run: | run: |
image="${PREVIEW_IMAGE}:${PREVIEW_TAG}" image="${PREVIEW_IMAGE}:${PREVIEW_TAG}"
manifest="$(docker buildx imagetools inspect "$image" --raw)" manifest="$(docker buildx imagetools inspect "$image" --raw)"
@@ -472,6 +497,12 @@ jobs:
done done
docker buildx imagetools inspect "$image" docker buildx imagetools inspect "$image"
- name: Confirm multi-platform preview validation
if: |
github.event_name == 'merge_group' ||
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
run: echo "Both platform image builds completed; registry publication is intentionally disabled for this event."
cleanup: cleanup:
name: Clean up preview image name: Clean up preview image
if: github.event_name == 'pull_request_target' || (github.event_name == 'workflow_dispatch' && inputs.operation == 'cleanup') if: github.event_name == 'pull_request_target' || (github.event_name == 'workflow_dispatch' && inputs.operation == 'cleanup')
+1
View File
@@ -7,6 +7,7 @@ const repositoryRoot = resolve(import.meta.dirname, "..");
const outfile = resolve(repositoryRoot, "apps/workshop/pb_hooks/widget-validator.bundle.cjs"); const outfile = resolve(repositoryRoot, "apps/workshop/pb_hooks/widget-validator.bundle.cjs");
await build({ await build({
absWorkingDir: repositoryRoot,
entryPoints: [resolve(repositoryRoot, "packages/workshop/src/pocketbase-validator.ts")], entryPoints: [resolve(repositoryRoot, "packages/workshop/src/pocketbase-validator.ts")],
bundle: true, bundle: true,
platform: "neutral", platform: "neutral",