Skip to content

ci: add preview build publishing - #326

Merged
cryptodev-2s merged 1 commit into
mainfrom
ci/publish-preview-workflow
Sep 7, 2026
Merged

ci: add preview build publishing#326
cryptodev-2s merged 1 commit into
mainfrom
ci/publish-preview-workflow

Conversation

@cryptodev-2s

@cryptodev-2s cryptodev-2s commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Adds preview build publishing to this repo by calling the reusable publish-preview workflow from MetaMask/github-tools@v1, plus a README section explaining how to create and consume one.

Commenting @metamaskbot publish-preview on a PR publishes @metamask-previews/utils@<version>-preview-<sha> and posts the version back on the PR.

Notes:

  • is-monorepo: false since this is a single package repo.
  • No environment input, matching what every other polyrepo does (create-release-branch, auto-changelog, ppom-validator, swaps-controller, etc). Only core gates on default-branch.
  • docs-url points at the new README section.

Needs before this works: PUBLISH_PREVIEW_NPM_TOKEN has to be added as a repo secret. It does not exist yet on this repo or at the org level.


Note

Low Risk
Changes are CI and documentation only; no library runtime behavior changes, though preview publishes require a new npm token secret.

Overview
Adds PR-triggered preview npm publishing so contributors can test @metamask/utils changes in downstream projects before release.

A new publish-preview workflow runs when someone comments @metamaskbot publish-preview on a pull request. It calls the reusable MetaMask/github-tools workflow (with is-monorepo: false and a docs-url anchor to the README) and passes PUBLISH_PREVIEW_NPM_TOKEN for publishing scoped preview packages (e.g. @metamask-previews/utils@…-preview-<sha>).

The README gains a “Testing changes in other projects using preview builds” section: how to trigger a build, override Yarn/NPM resolutions to consume the preview, and refresh after new commits. Note: the workflow depends on adding the PUBLISH_PREVIEW_NPM_TOKEN repo secret, which is not present yet.

Reviewed by Cursor Bugbot for commit a8ac8e9. Bugbot is set up for automated code reviews on this repo. Configure here.

Wires up the reusable publish-preview workflow from github-tools so a
`@metamaskbot publish-preview` comment on a PR publishes a preview build
to the `@metamask-previews` scope. Adds a README section covering how to
create and consume one.
@cryptodev-2s cryptodev-2s self-assigned this Sep 7, 2026
@cryptodev-2s
cryptodev-2s requested a review from Mrtenz September 7, 2026 11:45
@cryptodev-2s
cryptodev-2s marked this pull request as ready for review September 7, 2026 11:45
@cryptodev-2s

Copy link
Copy Markdown
Contributor Author

@Mrtenz Would you mind also adding PUBLISH_PREVIEW_NPM_TOKEN ?
I need this to test my work done in this stacked work #325

@Mrtenz

Mrtenz commented Sep 7, 2026

Copy link
Copy Markdown
Member

Why are we adding this if the repo will be migrated to core?

@cryptodev-2s

Copy link
Copy Markdown
Contributor Author

Why are we adding this if the repo will be migrated to core?

You where faster to comment I was trying to use the preview build in both clients and core to ensure everything still work correctly. This is already stated in the previous comment

Comment thread README.md
- The name is scoped to `@metamask-previews` instead of `@metamask`.
- The ID of the last commit in the branch is appended to the version, e.g. `1.2.3-preview-e2df9b4` instead of `1.2.3`.

#### Using a preview build

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These instructions are outdated. We use a preview build Yarn plugin in the clients.

Doesn't really matter since we're migrating this repo anyway.

@cryptodev-2s
cryptodev-2s merged commit 4c3e5e4 into main Sep 7, 2026
22 checks passed
@cryptodev-2s
cryptodev-2s deleted the ci/publish-preview-workflow branch September 7, 2026 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants