From 8dc035b391c9a21e78df366cb1d9ef8c4649229c Mon Sep 17 00:00:00 2001 From: Khaliq Date: Sun, 15 Nov 2026 10:49:51 -0800 Subject: [PATCH 1/3] ci: approval-gated fast path on Blacksmith runners Add a workflow_dispatch fast-path workflow that runs on Blacksmith runners instead of the shared GitHub-hosted queue. The first job is gated on the fast-path environment, so nothing runs until Khaliq approves it. It mirrors ci.yml (turbo build, typecheck, test) and the SDK contract check, then publishes the multi-platform image to ghcr.io/agentworkforce/relayauth tagged fast- and sha- only (with provenance, SBOM and attestation, as container.yml does), and packs the npm packages as an artifact. npm publishing uses trusted publishing bound to publish.yml, so the fast path does not publish to npm. No channel tag moves. Existing workflows are unchanged. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/fast-path.yml | 158 ++++++++++++++++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 .github/workflows/fast-path.yml diff --git a/.github/workflows/fast-path.yml b/.github/workflows/fast-path.yml new file mode 100644 index 0000000..410ac02 --- /dev/null +++ b/.github/workflows/fast-path.yml @@ -0,0 +1,158 @@ +# Fast path: run the CI checks, publish the container image and pack the npm +# packages on Blacksmith runners, outside the shared GitHub-hosted queue. +# Anyone with write access (people or agents) may start it; nothing runs until +# Khaliq approves the fast-path environment. +# The image goes to ghcr.io/agentworkforce/relayauth tagged fast- and +# sha- only; it never moves :latest or a semver tag, and deployments pin +# the digest printed in the run summary. +# npm publishing uses trusted publishing (OIDC bound to publish.yml), so the +# fast path does not publish to npm: it packs the packages with `npm pack` and +# uploads the tarballs as a workflow artifact. No dist-tag, git tag or GitHub +# release is created or moved. +name: fast-path +run-name: fast-path ${{ inputs.ref }} (${{ inputs.reason }}) +on: + workflow_dispatch: + inputs: + ref: + description: Branch, tag or commit to build (a PR branch is fine) + required: true + default: main + reason: + description: Why this needs the fast path + required: true +permissions: + contents: read +concurrency: + group: fast-path-${{ inputs.ref }} + cancel-in-progress: false +env: + IMAGE: ghcr.io/agentworkforce/relayauth +jobs: + test: + name: Build & Test + environment: fast-path + runs-on: blacksmith-4vcpu-ubuntu-2404 + outputs: + sha: ${{ steps.sha.outputs.sha }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.ref }} + - id: sha + run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" + - uses: actions/setup-node@v4 + with: + node-version: "22" + cache: npm + - run: npm ci + - name: Build all packages + run: npx turbo build --filter='!@relayauth/landing' + - name: Typecheck + run: npx turbo typecheck --filter='!@relayauth/landing' + - name: Test + run: npx turbo test --filter='!@relayauth/landing' --force + - name: SDK contract check + run: bash scripts/check-contract-surface.sh + + image: + name: Publish multi-platform image + needs: test + runs-on: blacksmith-4vcpu-ubuntu-2404 + permissions: + contents: read + packages: write + id-token: write + attestations: write + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ needs.test.outputs.sha }} + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 + - uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and publish image + id: build + uses: docker/build-push-action@v6 + with: + context: . + file: docker/Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: | + ${{ env.IMAGE }}:fast-${{ needs.test.outputs.sha }} + ${{ env.IMAGE }}:sha-${{ needs.test.outputs.sha }} + labels: | + org.opencontainers.image.title=RelayAuth + org.opencontainers.image.description=Self-hosted RelayAuth server + org.opencontainers.image.revision=${{ needs.test.outputs.sha }} + cache-from: type=gha + cache-to: type=gha,mode=max + provenance: mode=max + sbom: true + - name: Attest published image + uses: actions/attest-build-provenance@v2 + with: + subject-name: ${{ env.IMAGE }} + subject-digest: ${{ steps.build.outputs.digest }} + push-to-registry: true + - name: Summary + env: + REF: ${{ inputs.ref }} + SHA: ${{ needs.test.outputs.sha }} + REASON: ${{ inputs.reason }} + DIGEST: ${{ steps.build.outputs.digest }} + run: | + { + echo "### relayauth fast path: image" + echo "- ref: \`$REF\` at \`$SHA\`" + echo "- reason: $REASON" + echo "- image: \`$IMAGE@$DIGEST\` (tags \`fast-$SHA\`, \`sha-$SHA\`)" + } >> "$GITHUB_STEP_SUMMARY" + + pack: + name: Pack npm packages + needs: test + runs-on: blacksmith-4vcpu-ubuntu-2404 + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ needs.test.outputs.sha }} + - uses: actions/setup-node@v4 + with: + node-version: "22.14.0" + cache: npm + cache-dependency-path: package-lock.json + - run: npm ci + - run: npx turbo build --filter='!@relayauth/landing' + - name: Pack packages + run: | + set -euo pipefail + mkdir -p "$GITHUB_WORKSPACE/fast-path-packs" + # Same set as publish.yml's "all" (relayauth is packages/cli). + for dir in types core sdk/typescript migrate server cli; do + (cd "packages/$dir" && npm pack --ignore-scripts --pack-destination "$GITHUB_WORKSPACE/fast-path-packs") + done + - uses: actions/upload-artifact@v4 + with: + name: npm-packages-${{ needs.test.outputs.sha }} + path: fast-path-packs/*.tgz + if-no-files-found: error + - name: Summary + env: + REF: ${{ inputs.ref }} + SHA: ${{ needs.test.outputs.sha }} + REASON: ${{ inputs.reason }} + run: | + { + echo "### relayauth fast path: npm packages" + echo "- ref: \`$REF\` at \`$SHA\`" + echo "- reason: $REASON" + echo "- artifact: \`npm-packages-$SHA\` (not published to npm; trusted publishing is bound to publish.yml)" + echo "- tarballs:" + for f in fast-path-packs/*.tgz; do echo " - \`$(basename "$f")\`"; done + } >> "$GITHUB_STEP_SUMMARY" From 4af2f0601d814137411085292319666caf296742 Mon Sep 17 00:00:00 2001 From: Khaliq Date: Sun, 15 Nov 2026 11:06:55 -0800 Subject: [PATCH 2/3] ci(fast-path): no persisted checkout credentials; drop the misleading attestation The fast path builds inputs.ref, but attest-build-provenance derives the source commit from the dispatch OIDC claims, so it would attest the wrong commit. BuildKit provenance (mode=max) and the revision label already record the commit actually built. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/fast-path.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/fast-path.yml b/.github/workflows/fast-path.yml index 410ac02..26a8296 100644 --- a/.github/workflows/fast-path.yml +++ b/.github/workflows/fast-path.yml @@ -4,7 +4,9 @@ # Khaliq approves the fast-path environment. # The image goes to ghcr.io/agentworkforce/relayauth tagged fast- and # sha- only; it never moves :latest or a semver tag, and deployments pin -# the digest printed in the run summary. +# the digest printed in the run summary. The image carries BuildKit provenance +# (mode=max), which records the commit actually built; no GitHub attestation is +# issued, because it would name the dispatch commit instead. # npm publishing uses trusted publishing (OIDC bound to publish.yml), so the # fast path does not publish to npm: it packs the packages with `npm pack` and # uploads the tarballs as a workflow artifact. No dist-tag, git tag or GitHub @@ -39,6 +41,7 @@ jobs: - uses: actions/checkout@v4 with: ref: ${{ inputs.ref }} + persist-credentials: false - id: sha run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" - uses: actions/setup-node@v4 @@ -62,12 +65,11 @@ jobs: permissions: contents: read packages: write - id-token: write - attestations: write steps: - uses: actions/checkout@v4 with: ref: ${{ needs.test.outputs.sha }} + persist-credentials: false - uses: docker/setup-qemu-action@v3 - uses: docker/setup-buildx-action@v3 - uses: docker/login-action@v3 @@ -94,12 +96,6 @@ jobs: cache-to: type=gha,mode=max provenance: mode=max sbom: true - - name: Attest published image - uses: actions/attest-build-provenance@v2 - with: - subject-name: ${{ env.IMAGE }} - subject-digest: ${{ steps.build.outputs.digest }} - push-to-registry: true - name: Summary env: REF: ${{ inputs.ref }} @@ -122,6 +118,7 @@ jobs: - uses: actions/checkout@v4 with: ref: ${{ needs.test.outputs.sha }} + persist-credentials: false - uses: actions/setup-node@v4 with: node-version: "22.14.0" From 0c4be340a6d7775b4b85f85477ad8c8e24bd34f8 Mon Sep 17 00:00:00 2001 From: Khaliq Date: Sun, 15 Nov 2026 11:25:00 -0800 Subject: [PATCH 3/3] ci(fast-path): never save shared caches; keep pending dispatches The fast path builds unreviewed refs, so it must not write into caches that normal CI or release workflows restore: - drop the setup-node `cache:` inputs (they save on success, keyed only on lockfiles); setup-go `cache: false`; setup-uv `enable-cache: false` - Swatinem/rust-cache `save-if: false`; actions/cache -> actions/cache/restore - setup-bun `no-cache: true`, setup-zig `use-cache: false` - no docker `cache-to`; Blacksmith docker builder cache key namespaced with a fast-path- prefix The concurrency group also carries github.run_id, so a run waiting for approval is never cancelled by a later dispatch of the same ref. Where the repo already tests its workflows, a property test pins the gate: workflow_dispatch only, contents: read, fast-path environment on the first job only, every other job needs it, and the rules above. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/fast-path.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/fast-path.yml b/.github/workflows/fast-path.yml index 26a8296..8016893 100644 --- a/.github/workflows/fast-path.yml +++ b/.github/workflows/fast-path.yml @@ -26,7 +26,7 @@ on: permissions: contents: read concurrency: - group: fast-path-${{ inputs.ref }} + group: fast-path-${{ inputs.ref }}-${{ github.run_id }} cancel-in-progress: false env: IMAGE: ghcr.io/agentworkforce/relayauth @@ -47,7 +47,6 @@ jobs: - uses: actions/setup-node@v4 with: node-version: "22" - cache: npm - run: npm ci - name: Build all packages run: npx turbo build --filter='!@relayauth/landing' @@ -93,7 +92,6 @@ jobs: org.opencontainers.image.description=Self-hosted RelayAuth server org.opencontainers.image.revision=${{ needs.test.outputs.sha }} cache-from: type=gha - cache-to: type=gha,mode=max provenance: mode=max sbom: true - name: Summary @@ -122,8 +120,6 @@ jobs: - uses: actions/setup-node@v4 with: node-version: "22.14.0" - cache: npm - cache-dependency-path: package-lock.json - run: npm ci - run: npx turbo build --filter='!@relayauth/landing' - name: Pack packages