Skip to content

ci: migrate npm release workflow to OSS Exit Gate - #1534

Open
alonsopf89 wants to merge 5 commits into
google:mainfrom
alonsopf89:oss-exit-gate-migration
Open

alonsopf89 wants to merge 5 commits into
google:mainfrom
alonsopf89:oss-exit-gate-migration

Conversation

@alonsopf89

Copy link
Copy Markdown

Summary

Migrates the `npm` package publishing workflow to **Google OSS Exit Gate** (`go/oss-exit-gate`) using Workload Identity Federation (`google-github-actions/auth@v3`) + Artifact Registry staging (`https://us-npm.pkg.dev/oss-exit-gate-prod/zx--npm/`) + GCS release manifest upload (`gs://oss-exit-gate-prod-projects-bucket/zx/npm/manifests/`).

### Key Changes
- **Keyless OIDC Authentication (`google-github-actions/auth@v3`)**: Authenticates via Workload Identity Pool `projects/305452601764/locations/global/workloadIdentityPools/builders/providers/github` (removing the need for long-lived publishing tokens).
- **Artifact Registry Staging**: Publishes release artifacts to the dedicated OSS Exit Gate staging registry (`https://us-npm.pkg.dev/oss-exit-gate-prod/zx--npm/`).
- **Release Manifest Trigger (`google-github-actions/setup-gcloud@v3`)**: Uploads `manifest.json` (`{"publish_all": true}`) to `gs://oss-exit-gate-prod-projects-bucket/zx/npm/manifests/` so OSS Exit Gate scans, signs/attests, and publishes the package upstream.

### Onboarding & Verification Context
- **Buganizer Tracking Issues:** `b/576708064`, `b/576673325`
- **Internal Onboarding CLs:** `cl/1004336531, cl/1004941344` (submitted; Smoke Test verified in OSS Exit Gate prod)
- **Maintainers / Recent Workflow Contributors:** cc @antongolub @salmanmkc

@antongolub antongolub added the infra Repo configurations, CICD automations label Nov 4, 2026
@antongolub

antongolub commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

@alonsopf89

  1. Take a look on dev-publish.yaml too. We also have a snapshot cicd flow.
  2. It’s not clear what will happen with npm provenance in this setup. https://www.npmjs.com/package/zx/v/8.8.5#provenance

@alonsopf89

Copy link
Copy Markdown
Author

Thanks for the review and great questions, @antongolub!

  1. dev-publish.yml snapshot CI/CD flow:

    • Updated .github/workflows/dev-publish.yml in this PR (966c6cf) so the npm-publish job also authenticates via Workload Identity Federation, cleans up any stale staging packages, stages the dev and lite-dev snapshots to us-npm.pkg.dev/oss-exit-gate-prod/zx--npm, and uploads the GCS release manifest (gs://oss-exit-gate-prod-projects-bucket/zx/npm/manifests/...).
    • Also fixed the step ordering in .github/workflows/publish.yml (91742e2) so the staging cleanup step runs before npm publish.
    • Mailed the corresponding internal OSS Exit Gate config update (cl/1014340716) to add github_workflow:google/zx/.github/workflows/dev-publish.yml@refs/heads/main to the allowed WIF builders for zx/npm.
  2. npm provenance (--provenance):

    • When publishing via npm publish --provenance, the npm CLI generates a SLSA provenance attestation bound to the target registry URL and exchanges the GitHub Actions OIDC token directly with npmjs.com (or Wombat proxy).
    • In the OSS Exit Gate PIPELINE architecture, the GitHub Actions workflow first stages the package tarball to Google Cloud Artifact Registry (us-npm.pkg.dev/oss-exit-gate-prod/zx--npm), which does not accept the npmjs.com OIDC --provenance flag during staging, and the central OSS Exit Gate service then publishes the verified artifact to npmjs.com.
    • The OSS Exit Gate engineering team (go/oss-exit-gate) is currently finalizing provenance/attestation support for NPM packages published through the Exit Gate pipeline—we have zx/npm on hold from final cutover until that provenance support is confirmed so your package provenance on npmjs.com is preserved.

@antongolub

antongolub commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

@alonsopf89, thanks for the update.

СС @antonmedv

A few points from our side:

  1. Provenance is a hard requirement. All our releases must stay verifiable on npm, because some companies tie their corporate proxy restrictions to this signal: packages without it get filtered out, and their rating drops. We definitely want to keep it.
  2. We do want to strengthen the security of our build and publish flow as far as possible, and we will certainly consider the proposed option once it is reworked to cover provenance requirement.
  3. We were already planning to harden our publishing flow regardless of this PR. The move to npm OIDC publishing was on our roadmap before this proposal. We could set up the trusted publisher link on the npm side ourselves for both workflows, publish.yml and dev-publish.yml.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infra Repo configurations, CICD automations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants