Skip to content

Commit c9f9f62

Browse files
Add instructions for releasing from a branch other than main
1 parent 429f9a1 commit c9f9f62

File tree

1 file changed

+29
-57
lines changed

1 file changed

+29
-57
lines changed

docs/releasing.md

Lines changed: 29 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,52 @@
11
# Releasing (write access required)
22

3-
1. Run the ["Run CLI tests" workflow](https://github.com/github/vscode-codeql/actions/workflows/cli-test.yml) and make sure the tests are green. If there were no merges between the time the workflow ran (it runs daily), and the release, you can skip this step.
3+
1. Determine the new version number. We default to increasing the patch version number, but make our own judgement about whether a change is big enough to warrant a minor version bump. Common reasons for a minor bump could include:
4+
* Making substantial new features available to all users. This can include lifting a feature flag.
5+
* Breakage in compatibility with recent versions of the CLI.
6+
* Minimum required version of VS Code is increased.
7+
* New telemetry events are added.
8+
* Deprecation or removal of commands.
9+
* Accumulation of many changes, none of which are individually big enough to warrant a minor bump, but which together are. This does not include changes which are purely internal to the extension, such as refactoring, or which are only available behind a feature flag.
10+
1. Create a release branch named after the new version (e.g. `v1.3.6`):
11+
* For a regular scheduled release this branch will be based on latest `main`.
12+
* To do a minimal bug-fix release, base the release branch on the tag from the most recent release and then add only the changes you want to release.
13+
* Choose this option if you want to release a specific set of changes (e.g. a bug fix) and don't want to incur extra risk by including other changes that have been merged to the `main` branch.
14+
1. Run the ["Run CLI tests" workflow](https://github.com/github/vscode-codeql/actions/workflows/cli-test.yml) and make sure the tests are green.
15+
* You can skip this step if you are releasing from `main` and there were no merges since the most recent daily scheduled run of this workflow.
416
1. Double-check the `CHANGELOG.md` contains all desired change comments and has the version to be released with date at the top.
5-
* Go through all recent PRs and make sure they are properly accounted for.
17+
* If releasing from `main`, go through PRs that have been merged since the previous release and make sure they are properly accounted for.
18+
* If doing a minimal bug-fix release, the changelog will only contain the changes you're intending to release.
619
* Make sure all changelog entries have links back to their PR(s) if appropriate.
7-
* For picking the new version number, we default to increasing the patch version number, but make our own judgement about whether a change is big enough to warrant a minor version bump. Common reasons for a minor bump could include:
8-
* Making substantial new features available to all users. This can include lifting a feature flag.
9-
* Breakage in compatibility with recent versions of the CLI.
10-
* Minimum required version of VS Code is increased.
11-
* New telemetry events are added.
12-
* Deprecation or removal of commands.
13-
* Accumulation of many changes, none of which are individually big enough to warrant a minor bump, but which together are. This does not include changes which are purely internal to the extension, such as refactoring, or which are only available behind a feature flag.
14-
1. Double-check that the node version we're using matches the one used for VS Code. See the [Node.js version instructions](./node-version.md) for more information.
1520
1. Double-check that the extension `package.json` and `package-lock.json` have the version you intend to release. If you are doing a patch release (as opposed to minor or major version) this should already be correct.
16-
1. Create a PR for this release:
17-
* This PR will contain any missing bits from steps 1, 2 and 3. Most of the time, this will just be updating `CHANGELOG.md` with today's date.
18-
* Create a new branch for the release named after the new version. For example: `v1.3.6`
19-
* Create a new commit with a message the same as the branch name.
20-
* Create a PR for this branch.
21-
* Wait for the PR to be merged into `main`
22-
1. Switch to `main` branch and pull latest changes
23-
1. Lock the `main` branch.
24-
* Go to the [branch protection rules for the `main` branch](https://github.com/github/vscode-codeql/settings/branch_protection_rules/16447115)
25-
* Select "Lock branch"
26-
* Click "Save changes"
27-
1. Ensure that no PRs have been merged since the release PR that you merged. If there were, you might need to unlock `main` temporarily and update the CHANGELOG again.
28-
1. Build the extension `npm run build` and install it on your VS Code using "Install from VSIX".
21+
1. Commit any changes made during steps 4 and 5 with a commit message the same as the branch name (e.g. `v1.3.6`).
22+
1. Open a PR for this release.
23+
* The PR diff should contain:
24+
* Any missing bits from steps 4 and 5. Most of the time, this will just be updating `CHANGELOG.md` with today's date.
25+
* If releasing from a branch other than `main`, this PR will also contain the extension changes being released.
26+
1. Build the extension using `npm run build` and install it on your VS Code using "Install from VSIX".
2927
1. Go through [our test plan](./test-plan.md) to ensure that the extension is working as expected.
30-
1. Switch to `main` and add a new tag on the `main` branch with your new version (named after the release), e.g.
31-
28+
1. Create a new tag on the release branch with your new version (named after the release), e.g.
3229
```bash
33-
git checkout main
3430
git tag v1.3.6
3531
```
36-
37-
If you've accidentally created a badly named tag, you can delete it via
38-
39-
```bash
40-
git tag -d badly-named-tag
41-
```
42-
43-
1. Unlock the main branch
44-
* Go to the [branch protection rules for the `main` branch](https://github.com/github/vscode-codeql/settings/branch_protection_rules/16447115)
45-
* Deselect "Lock branch"
46-
* Click "Save changes"
32+
1. Merge the release PR into `main`.
33+
* The release PR must be merged before pushing the tag to ensure that we always release a commit that is present on the `main` branch. It's not required that the commit is the head of the `main` branch, but there should be no chance of a future release accidentally not including changes from this release.
4734
1. Push the new tag up:
48-
49-
a. If you're using a fork of the repo:
50-
51-
```bash
52-
git push upstream refs/tags/v1.3.6
53-
```
54-
55-
b. If you're working straight in this repo:
56-
5735
```bash
5836
git push origin refs/tags/v1.3.6
5937
```
60-
61-
This will trigger [a release build](https://github.com/github/vscode-codeql/releases) on Actions.
62-
63-
* **IMPORTANT** Make sure you are on the `main` branch and your local checkout is fully updated when you add the tag.
64-
* If you accidentally add the tag to the wrong ref, you can just force push it to the right one later.
65-
1. Monitor the status of the release build in the `Release` workflow in the Actions tab.
38+
1. Find the [Release](https://github.com/github/vscode-codeql/actions?query=workflow%3ARelease) workflow run that was just triggered by pushing the tag, and monitor the status of the release build.
6639
* DO NOT approve the "publish" stages of the workflow yet.
6740
1. Download the VSIX from the draft GitHub release at the top of [the releases page](https://github.com/github/vscode-codeql/releases) that is created when the release build finishes.
6841
1. Unzip the `.vsix` and inspect its `package.json` to make sure the version is what you expect,
6942
or look at the source if there's any doubt the right code is being shipped.
7043
1. Install the `.vsix` file into your vscode IDE and ensure the extension can load properly. Run a single command (like run query, or add database).
71-
1. Go to the actions tab of the vscode-codeql repository and select the [Release workflow](https://github.com/github/vscode-codeql/actions?query=workflow%3ARelease).
44+
1. Approve the deployments of the [Release](https://github.com/github/vscode-codeql/actions?query=workflow%3ARelease) workflow run. This will automatically publish to Open VSX and VS Code Marketplace.
7245
* If there is an authentication failure when publishing, be sure to check that the authentication keys haven't expired. See below.
73-
1. Approve the deployments of the correct Release workflow. This will automatically publish to Open VSX and VS Code Marketplace.
74-
1. Go to the draft GitHub release in [the releases tab of the repository](https://github.com/github/vscode-codeql/releases), click 'Edit', add some summary description, and publish it.
75-
1. Confirm the new release is marked as the latest release at <https://github.com/github/vscode-codeql/releases>.
46+
1. Go to the draft GitHub release in [the releases page](https://github.com/github/vscode-codeql/releases), click 'Edit', add some summary description, and publish it.
47+
1. Confirm the new release is marked as the latest release.
7648
1. If documentation changes need to be published, notify documentation team that release has been made.
77-
1. Review and merge the version bump PR that is automatically created by Actions.
49+
1. Review and merge the version bump PR that is automatically created by the Release workflow.
7850
7951
## Secrets and authentication for publishing
8052

0 commit comments

Comments
 (0)