This makes few edits based on feedback and observations from a previous release:
1. Moves `git pull` command before initial `git log` to make sure we're up to date before checking if a release is necessary.
2. Updates both `git log` commands to limit to `fix`, `feat`, and `perf` changes. This ignores more than just `refactor`, such as `build`, `ci`, etc. and should be more meaningful to end users.
* I considered doing something with `Revert` commits, but opted not to. Instead, it will treat this just like their original commit. This does mean we might send a slightly more complicated changelog than it needs to be, but it's not worth making these commands even weirder.
3. Removes install step prior to bumping the version numbers, as its just not needed and we have to reinstall later anyways.
4. Switches PR target from `patch` to `minor`. We only need to merge this to the `main` branch, and it's not worth the effort to keep the `patch` branch in sync.
5. Switches source code zip command to `git archive`. This is more portable than `zip *`, which depends on the shell configuration to determine what is included in `*` (mainly whether or not that includes dotfiles such as `.nvmrc` and `.bazelrc`).
PR Close #62352
5.4 KiB
Publish Angular DevTools
Publishing Angular DevTools is achieved through the following steps:
0. Check if there's anything to release
On the main branch, run:
git checkout main
git pull upstream main
git log "HEAD...$(git log HEAD~1 --grep="release:.*Angular DevTools" --format=format:%H | head -n 1)~1" --format=format:%s |
grep -E "(fix|feat|perf)\(devtools\):|release:.*Angular DevTools" -i --color=never
If this displays any commits since the most recent release commit, then there's something to publish. If it only shows the most recent release commit, then the DevTools release can be skipped.
1. Update extension version numbers
Bump the version numbers listed in
manifest.chrome.json
and manifest.firefox.json.
2. Commit and merge
Commit the version bump:
git checkout -b devtools-release
git add . && git commit -m "release: bump Angular DevTools version to ${VERSION}"
git push -u origin devtools-release
Then create and merge a PR targeting minor with this change. Merging this PR does not
have any automation associated with it and can be merged at any time.
3. Sync to merged commit
Once the PR is merged, pull and check out that specific commit hash on main and install
dependencies as they might have changed since your last install.
git fetch upstream main
git checkout "${MERGED_RELEASE_COMMIT}"
nvm install
yarn --immutable
Note that while the steps below can technically be done without merging the release PR or checking out the merged commit, doing so is useful for release stability (actually releasing what the commit history says we are) and is necessary for accurate changelog generation.
4. Publish to Chrome Chrome
First, make sure you have access to publish the extension by ensuring you are part of the relevant Google Group.
Next, build and package the extension:
# Build the Chrome version.
yarn devtools:build:chrome:release
# Package the extension.
(cd dist/bin/devtools/projects/shell-browser/src/prodapp && zip -r ~/devtools-chrome.zip *)
Then, go to the
Angular DevTools Chrome Web Store page
and upload ~/devtools-chrome.zip.
You can choose to either publish immediately or only get approval but hold to publish at a later time. Note that even publishing immediately still requires approval from Chrome Web Store before it is available to users. Historically this has been pretty quick (< 30 minutes), but there is no hard upper limit on how long a review might take: https://developer.chrome.com/docs/webstore/review-process#review-time.
5. Publish to Firefox
To publish Angular DevTools as a Firefox Add-on, first build and package the extension:
# Build the Firefox version.
yarn devtools:build:firefox:release
# Package the extension.
(cd dist/bin/devtools/projects/shell-browser/src/prodapp && zip -r ~/devtools-firefox.zip *)
Then, go to the Angular DevTools Firefox Addons page and log in using the email and password from Valentine. This will require a two-factor code, which you can generate by installing Google Authenticator and scanning the QR code linked from Valentine.
Upload ~/devtools-firefox.zip as a new version. The Firefox publishing process is slightly more
involved than Chrome.
Source Code
Mozilla requires extension source code with instructions to build and run it. Since DevTools
exists in a monorepo with critical build tooling existing outside the devtools/ directory, we
need to upload the entire monorepo. Package it without dependencies and generated files with the
following command and upload it.
git archive HEAD -o ~/angular-source.zip
Changelog
Mozilla asks for a changelog, which needs to be authored manually. You can generate the changelog with the following command:
git log "HEAD~1...$(git log HEAD~1 --grep="release:.*Angular DevTools" --format=format:%H | head -n 1)" --format=format:%s |
grep -E "(fix|feat|perf)\(devtools\):|release:.*Angular DevTools" -i --color=never |
sed "s,^,* ,g" |
sed -E "s,\(#([0-9]+)\),([#\1](https://github.com/angular/angular/pull/\1/)),g"
Reviewer Note
There is a field to provide a note to the reviewer, copy this template and make sure to replace
${RELEASE_COMMIT} with the SHA of the release commit to create a valid link.
This is a monorepo and includes much more code than just the DevTools extension. The relevant code is under `devtools/...` and `devtools/README.md` contains instructions for compiling release builds locally.
The uploaded source is equivalent to https://github.com/angular/angular/tree/${RELEASE_COMMIT}/.
Similar to Chrome, we need to wait for approval from Mozilla before the extension is released. There's no hard upper-bound on this, but historically it typically takes at least a week.
Once the new DevTools version is in-review for both Chrome and Firefox, the release process is complete.