From f735d3d18f0e83507193cd26a4c763a8544c707f Mon Sep 17 00:00:00 2001 From: Tim Welch Date: Tue, 1 Oct 2024 14:18:19 -0700 Subject: [PATCH 1/4] Improve release steps ensuring stable official release branch --- CONTRIBUTING.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 533c8b84a..abbe38243 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -212,14 +212,14 @@ Before release: Run the following release commands, replacing `7.0.0` with your version number: -- create a release branch, replacing `xx` with your initials to make it clear who created the branch. - - `git checkout origin/master -b xx/release-7.0.0` +- create a release branch + - `git checkout origin/master -b release-7.0.0` - increment the version number of all packages, and create a local commit, without pushing to origin. This will also create a release tag. - `pnpm lerna version --no-commit-hooks --no-push 7.0.0` - Push the release branch and the release tag. - - `git push origin xx/release-7.0.0 --follow-tags` + - `git push origin release-7.0.0 --follow-tags` - Pushing the tag will trigger the Github [release](https://github.com/Turfjs/turf/blob/master/.github/workflows/release.yml) action which you can view the status of at - https://github.com/Turfjs/turf/actions. If successful, a new [version](https://www.npmjs.com/package/@turf/turf?activeTab=versions) of all turf packages will have been published on NPM. - If the release action was not successful @@ -228,8 +228,8 @@ Run the following release commands, replacing `7.0.0` with your version number: - Then reset by deleting your tag and branch locally and remotely. - `git push --delete origin v7.1.0` - `git tag --delete v7.1.0` - - `git push -d origin xx/release-7.0.0` - - `git branch -d xx/release-7.0.0` + - `git push -d origin release-7.0.0` + - `git branch -d release-7.0.0` - Now redo the steps above starting with creating "A clean local copy of the Turf Github repository" - If the release action was successful, now create a Pull Request for the release to update master. @@ -237,7 +237,8 @@ Run the following release commands, replacing `7.0.0` with your version number: - If you don't get this message, just go to https://github.com/Turfjs/turf/pulls and you should be prompted at the top to create a PR for this new branch you just pushed. - If that prompt doesn't appear, then just create a new pull request from the PR page and make sure the title is the version number e.g. `v7.0.0` and that it is merging your release branch -> to master. - Here is an example PR - https://github.com/Turfjs/turf/pull/2615. - - Get approval for the release PR and merge it! + - Get approval for the release PR and merge it + - You will then need to click the "Restore branch" button because Github will have auto-deleted it on merge. Restoring is required because the release tag points at this release branch. #### Follow-on steps - As part of the release action, a draft Github release will have been created at https://github.com/Turfjs/turf/releases with an auto-generated changelog. From f3ed955e8a9ec0600130bfb3976d171032556589 Mon Sep 17 00:00:00 2001 From: Tim Welch Date: Tue, 1 Oct 2024 14:30:30 -0700 Subject: [PATCH 2/4] nits --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index abbe38243..933e79d38 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -237,8 +237,8 @@ Run the following release commands, replacing `7.0.0` with your version number: - If you don't get this message, just go to https://github.com/Turfjs/turf/pulls and you should be prompted at the top to create a PR for this new branch you just pushed. - If that prompt doesn't appear, then just create a new pull request from the PR page and make sure the title is the version number e.g. `v7.0.0` and that it is merging your release branch -> to master. - Here is an example PR - https://github.com/Turfjs/turf/pull/2615. - - Get approval for the release PR and merge it - - You will then need to click the "Restore branch" button because Github will have auto-deleted it on merge. Restoring is required because the release tag points at this release branch. + - Get approval for the release PR, then "Squash and merge" it + - Click "Restore branch". Github will have auto-deleted the release branch on merge. Restoring is required because the release tag points at this release branch. #### Follow-on steps - As part of the release action, a draft Github release will have been created at https://github.com/Turfjs/turf/releases with an auto-generated changelog. From ceea5c7335a16a3cdf1f36abb2bfceddf24d38b6 Mon Sep 17 00:00:00 2001 From: Tim Welch Date: Wed, 2 Oct 2024 09:28:03 -0700 Subject: [PATCH 3/4] specifics --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 933e79d38..d22b8e9a2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -212,7 +212,7 @@ Before release: Run the following release commands, replacing `7.0.0` with your version number: -- create a release branch +- create a release branch and switch to it. All building, tagging and publishing will be done on the release branch, and then merged back into master in a later step. - `git checkout origin/master -b release-7.0.0` - increment the version number of all packages, and create a local commit, without pushing to origin. This will also create a release tag. @@ -232,7 +232,7 @@ Run the following release commands, replacing `7.0.0` with your version number: - `git branch -d release-7.0.0` - Now redo the steps above starting with creating "A clean local copy of the Turf Github repository" -- If the release action was successful, now create a Pull Request for the release to update master. +- If the release action was successful, now create a Pull Request for the release to merge back to master. - You may be given a link in the output of the branch/tag push command to create the PR. - If you don't get this message, just go to https://github.com/Turfjs/turf/pulls and you should be prompted at the top to create a PR for this new branch you just pushed. - If that prompt doesn't appear, then just create a new pull request from the PR page and make sure the title is the version number e.g. `v7.0.0` and that it is merging your release branch -> to master. From fc5a3b5ea5040dc836fe2db2153e1282005840d3 Mon Sep 17 00:00:00 2001 From: Tim Welch Date: Wed, 2 Oct 2024 11:08:11 -0700 Subject: [PATCH 4/4] update branch delete step --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d22b8e9a2..6a6fe4acc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -237,8 +237,8 @@ Run the following release commands, replacing `7.0.0` with your version number: - If you don't get this message, just go to https://github.com/Turfjs/turf/pulls and you should be prompted at the top to create a PR for this new branch you just pushed. - If that prompt doesn't appear, then just create a new pull request from the PR page and make sure the title is the version number e.g. `v7.0.0` and that it is merging your release branch -> to master. - Here is an example PR - https://github.com/Turfjs/turf/pull/2615. - - Get approval for the release PR, then "Squash and merge" it - - Click "Restore branch". Github will have auto-deleted the release branch on merge. Restoring is required because the release tag points at this release branch. + - Get approval for the release PR, then "Squash and merge" it. + - Do not delete this branch in Github after merging, the release tag points to it. If you do, click "Restore branch" at the bottom of the merged PR. #### Follow-on steps - As part of the release action, a draft Github release will have been created at https://github.com/Turfjs/turf/releases with an auto-generated changelog.