ci: automated release#1362
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Caution MetaMask internal reviewing guidelines:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1362 +/- ##
=======================================
Coverage 74.99% 74.99%
=======================================
Files 184 184
Lines 4519 4519
Branches 1108 1108
=======================================
Hits 3389 3389
Misses 1130 1130 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| ROOT_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)" | ||
|
|
||
| # Format/fix the changelog using prettier | ||
| if [[ "${GITHUB_REF:-}" =~ '^release/' ]]; then |
There was a problem hiding this comment.
Bug: Regex Mismatch Blocks Release Logic
The regex pattern '^release/' in the GITHUB_REF check is incorrect. GITHUB_REF contains full ref paths (e.g., refs/heads/release/1.0.0), so the condition always evaluates to false. This prevents the scripts from applying release-specific logic, like passing the --rc flag, when on a release branch.
Additional Locations (1)
|
|
||
| if [[ "${GITHUB_REF:-}" =~ '^release/' ]]; then | ||
| yarn auto-changelog validate --tag-prefix "${package_name}@" --rc | ||
| "${ROOT_DIR}/node_modules/.bin/auto-changelog" validate --prettier --tag-prefix "${package_name}@" --rc "$@" |
There was a problem hiding this comment.
Bug: Regex Pattern Error in Bash Conditional
The bash conditional for detecting release branches uses single quotes around the ^release/ regex pattern. This causes the caret to be interpreted literally, preventing it from correctly matching branches that start with 'release/'.
Additional Locations (1)
|
This has been implemented in https://github.com/MetaMask/connect-monorepo. |
Explanation
Currently there's no automated way to trigger the existing Github Actions responsible for releasing the packages in the repo to NPM.
This PR:
@metamask/create-release-branchto4.3.1across all packages.commitlint.config.jsto ignore commits created by@metamask/create-release-branch.changelog:*scripts across all repos to match@metamask/corefor consistency.changelog:format.@metamask/auto-changelogby moving it to the root and update it to3.4.3@metamask/create-release-branchWith these changes we're able to do
yarn create-release-branch -ito create a Release branch locally. Pushing and merging that branch should trigger publish-release action.See Test Release branch here
References
Closes WAPI-739
Checklist
Note
Automates releases via create-release-branch, standardizes changelog scripts, adds Yarn constraints plugin, pins workspace versions, and updates CI/commitlint to validate and ignore appropriate commits.
changelog:validate) and broaden release commit detection patterns.changelog:update,changelog:validate, andchangelog:formatscripts repo-wide; remove oldlint:changelogusages.@metamask/auto-changelogat the root and invoke via new scripts.@metamask/create-release-branchto^4.1.3and adjust config;commitlintnow ignores "Initialize/Update Release X.Y.Z" commits.@yarnpkg/plugin-constraintsand enable in.yarnrc.yml; fix.gitignorepatterns for Yarn directories.@metamask/sdk,@metamask/sdk-analytics).changelog:validateand new script names.scripts/update-changelog.shandscripts/format-changelog.sh; enhancevalidate-changelog.shto use root binary with--prettier.Written by Cursor Bugbot for commit 0333c58. This will update automatically on new commits. Configure here.