You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The release documentation still referred to the old `create-release-pr`
workflow that was replaced in #376
These instructions were copied from the `core` repository. Eventually
I'd like to simplify them into one flow rather than two, but I figure we
can sort that out later.
@@ -42,38 +42,155 @@ running `yarn lint:fix` to understand which rules changed.
42
42
43
43
### Release & Publishing
44
44
45
-
The project follows the same release process as the other libraries in the MetaMask organization. The GitHub Actions [`action-create-release-pr`](https://github.com/MetaMask/action-create-release-pr) and [`action-publish-release`](https://github.com/MetaMask/action-publish-release) are used to automate the release process; see those repositories for more information about how they work.
45
+
To create a release, start by creating a release candidate branch to update package versions and changelogs. Once the release candidate is reviewed and merged, the release will be created automatically (pending approval for the npm publish step).
46
46
47
-
1. Choose a release version.
47
+
Note that we usually try to keep these packages aligned on the same major version so that it's easier for users to understand which versions are compatible with each other.
48
48
49
-
- The release version should be chosen according to SemVer. Analyze the changes to see whether they include any breaking changes, new features, or deprecations, then choose the appropriate SemVer version. See [the SemVer specification](https://semver.org/) for more information.
49
+
We use the `@metamask/create-release-branch` tool to prepare release candidates. This tool supports two workflows: interactive UI (recommended for most users) or manual specification.
50
50
51
-
2. If this release is backporting changes onto a previous release, then ensure there is a major version branch for that version (e.g. `1.x` for a `v1` backport release).
51
+
### Option A: Interactive Mode (Recommended)
52
52
53
-
- The major version branch should be set to the most recent release with that major version. For example, when backporting a `v1.0.2` release, you'd want to ensure there was a `1.x` branch that was set to the `v1.0.1` tag.
53
+
This option provides a visual interface to streamline the release process:
54
54
55
-
3. Trigger the [`workflow_dispatch`](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch) event [manually](https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow) for the `Create Release Pull Request` action to create the release PR.
55
+
1.**Start the interactive release tool.**
56
56
57
-
- For a backport release, the base branch should be the major version branch that you ensured existed in step 2. For a normal release, the base branch should be the main branch for that repository (which should be the default value).
58
-
- This should trigger the [`action-create-release-pr`](https://github.com/MetaMask/action-create-release-pr) workflow to create the release PR.
57
+
On the `main` branch, run:
59
58
60
-
4. Update the changelog to move each change entry into the appropriate change category ([See here](https://keepachangelog.com/en/1.0.0/#types) for the full list of change categories, and the correct ordering), and edit them to be more easily understood by users of the package.
59
+
```
60
+
yarn create-release-branch -i
61
+
```
61
62
62
-
- Generally any changes that don't affect consumers of the package (e.g. lockfile changes or development environment changes) are omitted. Exceptions may be made for changes that might be of interest despite not having an effect upon the published package (e.g. major test improvements, security improvements, improved documentation, etc.).
63
-
- Try to explain each change in terms that users of the package would understand (e.g. avoid referencing internal variables/concepts).
64
-
- Consolidate related changes into one change entry if it makes it easier to explain.
65
-
- Run `yarn auto-changelog validate --rc` to check that the changelog is correctly formatted.
63
+
This will start a local web server (default port 3000) and open a browser interface.
66
64
67
-
5. Review and QA the release.
65
+
2.**Select packages to release.**
68
66
69
-
- If changes are made to the base branch, the release branch will need to be updated with these changes and review/QA will need to restart again. As such, it's probably best to avoid merging other PRs into the base branch while review is underway.
67
+
The UI will show all packages with changes since their last release. For each package:
70
68
71
-
6. Squash & Merge the release.
69
+
- Choose whether to include it in the release
70
+
- Select an appropriate version bump (patch, minor, or major) following SemVer rules
71
+
- The UI will automatically validate your selections and identify dependencies that need to be included
72
72
73
-
- This should trigger the [`action-publish-release`](https://github.com/MetaMask/action-publish-release) workflow to tag the final release commit and publish the release on GitHub.
73
+
3.**Review and resolve dependency requirements.**
74
74
75
-
7. Publish the release on npm.
75
+
The UI automatically analyzes your selections and identifies potential dependency issues that need to be addressed before proceeding. You'll need to review and resolve these issues by either:
76
76
77
-
- Wait for the `publish-release` GitHub Action workflow to finish. This should trigger a second job (`publish-npm`), which will wait for a run approval by the [`npm publishers`](https://github.com/orgs/MetaMask/teams/npm-publishers) team.
78
-
- Approve the `publish-npm` job (or ask somebody on the npm publishers team to approve it for you).
79
-
- Once the `publish-npm` job has finished, check npm to verify that it has been published.
77
+
- Including the suggested additional packages
78
+
- Confirming that you want to skip certain packages (if you're certain they don't need to be updated)
79
+
80
+
Common types of dependency issues you might encounter:
81
+
82
+
-**Missing dependencies**: If you're releasing Package A that depends on Package B, the UI will prompt you to include Package B
83
+
-**Breaking change impacts**: If you're releasing Package B with breaking changes, the UI will identify packages that have peer dependencies on Package B that need to be updated
84
+
-**Version incompatibilities**: The UI will flag if your selected version bumps don't follow semantic versioning rules relative to dependent packages
85
+
86
+
Unlike the manual workflow where you need to repeatedly edit a YAML file, in the interactive mode you can quickly resolve these issues by checking boxes and selecting version bumps directly in the UI.
87
+
88
+
4.**Confirm your selections.**
89
+
90
+
Once you're satisfied with your package selections and version bumps, confirm them in the UI. This will:
91
+
92
+
- Create a new branch named `release/<new release version>`
93
+
- Update the version in each package's `package.json`
94
+
- Add a new section to each package's `CHANGELOG.md` for the new version
95
+
96
+
5.**Review and update changelogs.**
97
+
98
+
Each selected package will have a new changelog section. Review these entries to ensure they are helpful for consumers:
99
+
100
+
- Categorize entries appropriately following the ["Keep a Changelog"](https://keepachangelog.com/en/1.0.0/) guidelines. Ensure that no changes are listed under "Uncategorized".
101
+
- Remove changelog entries that don't affect consumers of the package (e.g. lockfile changes or development environment changes). Exceptions may be made for changes that might be of interest despite not having an effect upon the published package (e.g. major test improvements, security improvements, improved documentation, etc.).
102
+
- Reword changelog entries to explain changes in terms that users of the package will understand (e.g., avoid referencing internal variables/concepts).
103
+
- Consolidate related changes into single entries where appropriate.
104
+
105
+
Run `yarn changelog:validate` when you're done to ensure all changelogs are correctly formatted.
106
+
107
+
6.**Push and submit a pull request.**
108
+
109
+
Create a PR for the release branch so that it can be reviewed and tested.
110
+
Release PRs can be approved by codeowners of affected packages, so as long as the above guidelines have been followed, there is no need to reach out to the Wallet Framework team for approval.
111
+
112
+
7.**Incorporate any new changes from `main`.**
113
+
114
+
If you see the "Update branch" button on your release PR, stop and look over the most recent commits made to `main`. If there are new changes to packages you are releasing, make sure they are reflected in the appropriate changelogs.
115
+
116
+
8.**Merge the release PR and wait for approval.**
117
+
118
+
"Squash & Merge" the release PR when it's approved.
119
+
120
+
Merging triggers the [`publish-release` GitHub action](https://github.com/MetaMask/action-publish-release) workflow to tag the final release commit and publish the release on GitHub. Before packages are published to NPM, this action will automatically notify the [`npm-publishers`](https://github.com/orgs/MetaMask/teams/npm-publishers) team in Slack to review and approve the release.
121
+
122
+
9.**Verify publication.**
123
+
124
+
Once the `npm-publishers` team has approved the release, you can click on the link in the Slack message to monitor the remainder of the process.
125
+
126
+
After the action has completed, [check NPM](https://npms.io/search?q=scope%3Ametamask) to verify that all relevant packages have been published.
127
+
128
+
> **Tip:** You can specify a different port if needed: `yarn create-release-branch -i -p 3001`
129
+
130
+
### Option B: Manual Release Specification
131
+
132
+
If you prefer more direct control over the release process:
133
+
134
+
1.**Start by creating the release branch.**
135
+
136
+
On the `main` branch, run `yarn create-release-branch`. This command creates a branch named `release/<new release version>` which will represent the new release.
137
+
138
+
2.**Specify packages to release along with their versions.**
139
+
140
+
Unless you've made a lot of breaking changes, you probably don't want to publish a new version of every single package in this repo. Fortunately, you can choose a subset of packages to include in the next release. You do this by modifying a YAML file called a "release spec", which the tool has generated and opened it in your editor. Follow the instructions at the top of the file for more information.
141
+
142
+
In addition to selecting a list of packages, you'll also want to tell the tool which new versions they ought to receive. Since you'll want to follow SemVer, how you bump a package depends on the nature of the changes. You can understand these changes better by opening the changelog for each package in your editor.
143
+
144
+
Once you save and close the release spec, the tool will proceed.
145
+
146
+
3.**Review and resolve dependency requirements.**
147
+
148
+
The tool automatically analyzes your selections and identifies potential dependency issues that need to be addressed before proceeding. You'll need to review and resolve these issues by either:
149
+
150
+
- Including the suggested additional packages
151
+
- Confirming that you want to skip certain packages (if you're certain they don't need to be updated)
152
+
153
+
Common types of dependency issues you might encounter:
154
+
155
+
-**Missing dependencies**: If you're releasing Package A that depends on Package B, the UI will prompt you to include Package B
156
+
-**Breaking change impacts**: If you're releasing Package B with breaking changes, the UI will identify packages that have peer dependencies on Package B that need to be updated
157
+
-**Version incompatibilities**: The UI will flag if your selected version bumps don't follow semantic versioning rules relative to dependent packages
158
+
159
+
To address these issues, you will need to reopen the YAML file, modify it by either adding more packages to the release or omitting packages from the release you think are safe, and then re-running `yarn create-release-branch`. You may need to repeat this step multiple times until you don't see any more errors.
160
+
161
+
4.**Review and update changelogs for relevant packages.**
162
+
163
+
Once the tool proceeds without issue, you will be on the new release branch. In addition, each package you intend to release has been updated in two ways:
164
+
165
+
- The version in `package.json` has been bumped.
166
+
- A new section has been added at the top of `CHANGELOG` for the new version.
167
+
168
+
At this point, you need to review the changelog entries and ensure that they are helpful for consumers:
169
+
170
+
- Categorize entries appropriately following the ["Keep a Changelog"](https://keepachangelog.com/en/1.0.0/) guidelines. Ensure that no changes are listed under "Uncategorized".
171
+
- Remove changelog entries that don't affect consumers of the package (e.g. lockfile changes or development environment changes). Exceptions may be made for changes that might be of interest despite not having an effect upon the published package (e.g. major test improvements, security improvements, improved documentation, etc.).
172
+
- Reword changelog entries to explain changes in terms that users of the package will understand (e.g., avoid referencing internal variables/concepts).
173
+
- Consolidate related changes into single entries where appropriate.
174
+
175
+
Make sure to run `yarn changelog:validate` once you're done to ensure all changelogs are correctly formatted.
176
+
177
+
5.**Push and submit a pull request.**
178
+
179
+
Create a PR for the release branch so that it can be reviewed and tested.
180
+
Release PRs can be approved by codeowners of affected packages, so as long as the above guidelines have been followed, there is no need to reach out to the Wallet Framework team for approval.
181
+
182
+
6.**Incorporate any new changes from `main`.**
183
+
184
+
If you see the "Update branch" button on your release PR, stop and look over the most recent commits made to `main`. If there are new changes to packages you are releasing, make sure they are reflected in the appropriate changelogs.
185
+
186
+
7.**Merge the release PR and wait for approval.**
187
+
188
+
"Squash & Merge" the release PR when it's approved.
189
+
190
+
Merging triggers the [`publish-release` GitHub action](https://github.com/MetaMask/action-publish-release) workflow to tag the final release commit and publish the release on GitHub. Before packages are published to NPM, this action will automatically notify the [`npm-publishers`](https://github.com/orgs/MetaMask/teams/npm-publishers) team in Slack to review and approve the release.
191
+
192
+
8.**Verify publication.**
193
+
194
+
Once the `npm-publishers` team has approved the release, you can click on the link in the Slack message to monitor the remainder of the process.
195
+
196
+
After the action has completed, [check NPM](https://npms.io/search?q=scope%3Ametamask) to verify that all relevant packages have been published.
0 commit comments