Skip to content

ci: switch preview builds to OIDC publishing - #671

Merged
Mrtenz merged 2 commits into
mainfrom
mrtenz/publish-preview-oidc
Nov 24, 2026
Merged

Mrtenz merged 2 commits into
mainfrom
mrtenz/publish-preview-oidc

Conversation

@Mrtenz

@Mrtenz Mrtenz commented Nov 24, 2026

Copy link
Copy Markdown
Member

Explanation

The "Publish a preview build" workflow used to run when someone commented @metamaskbot publish-preview, and it published with the long-lived PUBLISH_PREVIEW_NPM_TOKEN secret. This PR moves it to NPM trusted publishing (OIDC), which MetaMask/core already uses.

  • publish-preview.yml now runs manually through workflow_dispatch and calls the publish-preview-oidc.yml reusable workflow from MetaMask/github-tools. It takes a pull request number or a branch, and can publish all packages, a given list, or only the packages that changed. Publishing goes through the npm-preview environment, so the NPM token secret is no longer needed. The existing BUILD_ENV and rename-after-install-and-build settings are kept.
  • publish-preview-comment.yml is new. If someone posts the old @metamaskbot publish-preview comment, it replies with a link to the new workflow and the PR number to enter.
  • docs/processes/preview-builds.md describes the new flow.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

The "Publish a preview build" workflow used to run from an `@metamaskbot publish-preview` comment and publish with the long-lived `PUBLISH_PREVIEW_NPM_TOKEN` secret. It now runs through `workflow_dispatch` and calls the `publish-preview-oidc.yml` reusable workflow from `MetaMask/github-tools`, which publishes through NPM trusted publishing (OIDC) in the `npm-preview` environment. The workflow takes a pull request number or branch, and can publish all packages, a given list, or only changed packages.

A new `publish-preview-comment.yml` workflow replies to the old comment command with a link to the new workflow. The preview build docs are updated to match.

References:
- MetaMask/core#11534
- MetaMask/core#11682
@github-actions github-actions Bot added the size-S size-S label Nov 24, 2026
dry-run: ${{ inputs.dry-run }}
rename-after-install-and-build: true
environment: default-branch
environment: npm-preview

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an intentional change. I will make sure the environment is configured before merging.

@Mrtenz
Mrtenz marked this pull request as ready for review November 24, 2026 14:19
@Mrtenz
Mrtenz requested review from a team as code owners November 24, 2026 14:19
In `publish-preview-comment.yml`, reference the action by the commit SHA of `v9.0.0` instead of the mutable `v9` tag. A moved tag can no longer change the code the workflow runs.
@sonarqubecloud

Copy link
Copy Markdown

@Mrtenz
Mrtenz added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit f54430c Nov 24, 2026
58 checks passed
@Mrtenz
Mrtenz deleted the mrtenz/publish-preview-oidc branch November 24, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size-S size-S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants