chore: include current versions more in release checklist (#24562)

This commit is contained in:
David Sherret 2024-07-12 18:44:55 -04:00 committed by GitHub
parent 3a48bc695f
commit 2fca4f11fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 48 additions and 35 deletions

View File

@ -5,27 +5,33 @@ import { $, createOctoKit, semver } from "./deps.ts";
const currentDirPath = $.path(import.meta).parentOrThrow(); const currentDirPath = $.path(import.meta).parentOrThrow();
$.logStep("Getting next version..."); $.logStep("Getting next version...");
const currentVersion = semver.parse(getCliVersion())!;
const nextVersion = getNextVersion(semver.parse(getCliVersion())!); const nextVersion = getNextVersion(semver.parse(getCliVersion())!);
$.logStep("Creating gist with instructions..."); $.logStep("Creating gist with instructions...");
const octoKit = createOctoKit(); const releaseInstructions = buildDenoReleaseInstructionsDoc();
const result = await octoKit.request("POST /gists", { if (Deno.args.some((a) => a === "--dry-run")) {
description: `Deno CLI v${nextVersion} release checklist`, console.log(releaseInstructions);
public: false, } else {
files: { const octoKit = createOctoKit();
[`release_${nextVersion}.md`]: { const result = await octoKit.request("POST /gists", {
content: buildDenoReleaseInstructionsDoc(), description: `Deno CLI v${nextVersion} release checklist`,
public: false,
files: {
[`release_${nextVersion}.md`]: {
content: releaseInstructions,
},
}, },
}, });
});
$.log("=============================================="); $.log("==============================================");
$.log("Created gist with instructions!"); $.log("Created gist with instructions!");
$.log(""); $.log("");
$.log(` ${result.data.html_url}`); $.log(` ${result.data.html_url}`);
$.log(""); $.log("");
$.log("Please fork the gist and follow the checklist."); $.log("Please fork the gist and follow the checklist.");
$.log("=============================================="); $.log("==============================================");
}
function getNextVersion(originalVersion: semver.SemVer) { function getNextVersion(originalVersion: semver.SemVer) {
if (Deno.args.some((a) => a === "--patch")) { if (Deno.args.some((a) => a === "--patch")) {
@ -40,11 +46,17 @@ function getNextVersion(originalVersion: semver.SemVer) {
} }
function buildDenoReleaseInstructionsDoc() { function buildDenoReleaseInstructionsDoc() {
function getMinorVersion(version: string) {
return version.split(".").slice(0, 2).join(".");
}
const templateText = currentDirPath const templateText = currentDirPath
.join("release_doc_template.md") .join("release_doc_template.md")
.readTextSync() .readTextSync()
.replaceAll("$BRANCH_NAME", `v${nextVersion.major}.${nextVersion.minor}`) .replaceAll("$BRANCH_NAME", `v${nextVersion.major}.${nextVersion.minor}`)
.replaceAll("$VERSION", nextVersion.toString()); .replaceAll("$VERSION", nextVersion.toString())
.replaceAll("$MINOR_VERSION", getMinorVersion(nextVersion.toString()))
.replaceAll("$PAST_VERSION", currentVersion.toString());
return `# Deno CLI ${nextVersion.toString()} Release Checklist\n\n${templateText}`; return `# Deno CLI ${nextVersion.toString()} Release Checklist\n\n${templateText}`;
} }

View File

@ -31,28 +31,28 @@ Release checklist: <LINK TO THIS FORKED GIST GOES HERE>
## Patch release preparation ## Patch release preparation
**If you are cutting a patch release**: First you need to sync commits to the **If you are cutting a patch release**: First you need to sync commits to the
relevant minor branch in the `deno` repo, so if you are cutting a `v1.43.3` `v$MINOR_VERSION` branch in the `deno` repo.
release you need to sync `v1.43` branch.
To do that, you need to cherry-pick commits from the main branch to the `v1.43` To do that, you need to cherry-pick commits from the main branch to the
branch. If the branch doesn't exist yet, create one from the latest minor tag: `v$MINOR_VERSION` branch. If the branch doesn't exist yet, create one from the
latest minor tag:
``` ```
# checkout latest minor release # checkout latest minor release
$ git checkout v1.43.0 $ git checkout v$PAST_VERSION
# create a branch # create a branch
$ git checkout v1.43 $ git checkout v$MINOR_VERSION
# push the branch to the `denoland/deno` repository # push the branch to the `denoland/deno` repository
$ git push upstream v1.43 $ git push upstream v$MINOR_VERSION
``` ```
For patch releases we want to cherry-pick all commits that do not add features For patch releases we want to cherry-pick all commits that do not add features
to the CLI. This generally means to filter out `feat` commits. to the CLI. This generally means to filter out `feat` commits.
Check what was the last commit on `v1.43` branch before the previous release and Check what was the last commit on `v$MINOR_VERSION` branch before the previous
start cherry-picking newer commits from the `main`. release and start cherry-picking newer commits from the `main`.
<!-- <!--
TODO: we should add sample deno program that does that for you, TODO: we should add sample deno program that does that for you,
@ -62,9 +62,9 @@ start cherry-picking newer commits from the `main`.
Once all relevant commits are cherry-picked, push the branch to the upstream and Once all relevant commits are cherry-picked, push the branch to the upstream and
verify on GitHub that everything looks correct. verify on GitHub that everything looks correct.
- ⛔ DO NOT create a `vx.xx.x`-like branch! You are meant to cherry pick to a - ⛔ DO NOT create a `v$VERSION`-like branch! You are meant to cherry pick to
`vx.xx` branch. If you have accidentally created a `vx.xx.x`-like branch then the `v$MINOR_VERSION` branch. If you have accidentally created then
delete it as tagging the CLI will fail otherwise. `v$VERSION` branch then delete it as tagging the CLI will fail otherwise.
## Updating `deno` ## Updating `deno`
@ -73,8 +73,8 @@ verify on GitHub that everything looks correct.
- [ ] Go to the "version_bump" workflow in the CLI repo's actions: - [ ] Go to the "version_bump" workflow in the CLI repo's actions:
https://github.com/denoland/deno/actions/workflows/version_bump.yml https://github.com/denoland/deno/actions/workflows/version_bump.yml
1. Click on the "Run workflow" button. 1. Click on the "Run workflow" button.
1. In the drop down, select the minor branch (ex. `vx.xx`) if doing a patch 1. In the drop down, select the minor branch (`v$MINOR_VERSION`) if doing a
release or the main branch if doing a minor release. patch release or the main branch if doing a minor release.
1. For the kind of release, select either "patch", "minor", or "major". 1. For the kind of release, select either "patch", "minor", or "major".
1. Run the workflow. 1. Run the workflow.
@ -104,12 +104,13 @@ verify on GitHub that everything looks correct.
1. The workflow was designed to be restartable. Try restarting it. 1. The workflow was designed to be restartable. Try restarting it.
2. If that doesn't work, then do the following: 2. If that doesn't work, then do the following:
1. Checkout the branch the release is occurring on. 1. Checkout the `v$MINOR_VERSION` branch.
2. If `cargo publish` hasn't completed then run 2. If `cargo publish` hasn't completed then run
`./tools/release/03_publish_crates.ts` `./tools/release/03_publish_crates.ts`
- Note that you will need access to crates.io so it might fail. - Note that you will need access to crates.io so it might fail.
3. If `cargo publish` succeeded and a release tag wasn't created, then 3. If `cargo publish` succeeded and a release tag wasn't created, then
manually create and push one for the release branch with a leading `v`. manually create and push the `v$VERSION` tag on the `v$MINOR_VERSION`
branch.
</details> </details>
- [ ] This CI run create a tag which triggers a second CI run that publishes the - [ ] This CI run create a tag which triggers a second CI run that publishes the
@ -148,14 +149,14 @@ verify on GitHub that everything looks correct.
- [ ] Run the version bump workflow: - [ ] Run the version bump workflow:
https://github.com/denoland/deno_docker/actions/workflows/version_bump.yml https://github.com/denoland/deno_docker/actions/workflows/version_bump.yml
- [ ] This will open a PR. Review and merge it. - [ ] This will open a PR. Review and merge it.
- [ ] Create a tag with the version number (_without_ `v` prefix). - [ ] Create a `$VERSION` tag (_without_ `v` prefix).
## Updating `deno-lambda` ## Updating `deno-lambda`
- [ ] Run the version bump workflow: - [ ] Run the version bump workflow:
https://github.com/denoland/deno-lambda/actions/workflows/bump.yml https://github.com/denoland/deno-lambda/actions/workflows/bump.yml
- [ ] This will open a PR. Review and merge it. - [ ] This will open a PR. Review and merge it.
- [ ] Create a release with the version number (_without_ `v` prefix). - [ ] Create a `$VERSION` tag (_without_ `v` prefix).
## All done! ## All done!