From b38a7242064e21cca1dca1dcbf9d668aaa18df02 Mon Sep 17 00:00:00 2001 From: Mantre Date: Wed, 26 Jun 2024 17:28:27 +0800 Subject: [PATCH] chore: update releasing doc (#1368) --- docs/patching.md | 59 +++++++++++++++++++++++++++++------------------ docs/releasing.md | 9 ++++---- 2 files changed, 41 insertions(+), 27 deletions(-) diff --git a/docs/patching.md b/docs/patching.md index e922e6a93..e6b982656 100644 --- a/docs/patching.md +++ b/docs/patching.md @@ -8,27 +8,57 @@ proceed with the required updates, and eventually release the patched branch. Before proceeding with the patching process, ensure that your `origin` remote is set to `git@github.com:pactus-project/pactus.git` and not your local fork. -## 2. Create a Patch Branch +## 2. Set Environment Variables + +Create environment variables for the patch version, which will be used in subsequent commands throughout this document. +Keep your terminal open for further steps. + +```bash +PRV_VER="1.2.0" +CUR_VER="1.2.1" +NEXT_VER="1.2.2" +BASE_BRANCH="1.2.x" +TAG_NAME="v${CUR_VER}" +TAG_MSG="Version ${CUR_VER}" +``` + +## 3. Patch Branch + +### Create the Patch branch If this is the first patch for a specific major version, you'll need to create a branch for this tag. -Replace `` with the appropriate minor version number: ```bash -git checkout -b 1..x v1..0 +git checkout -b ${BASE_BRANCH} v${PRV_VER} git log -git push --set-upstream origin 1..x +git push --set-upstream origin ${BASE_BRANCH} ``` -Don't forget to update the patch version inside the [version.go](../version/version.go) file. +Update the patch version inside the [version.go](../version/version.go), +clear Alias and set "beta" to the Meta. + +Create a new PR against the patch branch: + +```bash +git checkout -b bumping_${CUR_VER} +git commit -a -m "chore: bumping version to ${CUR_VER}" +git push origin HEAD +gh pr create --title "chore: bumping version to ${CUR_VER}" --body "Bumping version to ${CUR_VER}" --base ${BASE_BRANCH} +``` + +As an example check this [Pull Request](https://github.com/pactus-project/pactus/pull/1367). +Wait for the PR to be approved and merged into the patch branch. + +### Switch the Patch branch If you're not creating a new patch branch, switch to the existing patch branch: ```bash -git checkout 1..x +git checkout ${BASE_BRANCH} git pull ``` -## 3. Apply Fixes +## 4. Apply Fixes Now, apply the necessary fixes to the patch branch. You can use [cherry-pick](https://www.atlassian.com/git/tutorials/cherry-pick) to @@ -39,21 +69,6 @@ git cherry-pick git push ``` -## 4. Set Environment Variables - -Reopen this document within the branch version and -create environment variables for the release version, which will be used in subsequent commands throughout this document. -Keep your terminal open for further steps. - -```bash -PRV_VER="1.2.0" -CUR_VER="1.2.1" -NEXT_VER="1.2.2" -BASE_BRANCH="1.2.x" -TAG_NAME="v${CUR_VER}" -TAG_MSG="Version ${CUR_VER}" -``` - ## 5. Follow the Releasing Document Refer to the [Releasing](./releasing.md) document and follow the steps outlined from Step 5 until the end. diff --git a/docs/releasing.md b/docs/releasing.md index 1c4aeaebe..790740325 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -52,8 +52,8 @@ TAG_MSG="Version ${CUR_VER}" ## 5. Update the Version -Remove the `beta` tag from the `meta` field in [version.go](../version/version.go). -Also, double-check the [config.go](../config/config.go) files to ensure they are up-to-date. +clear Meta and set Alias in [version.go](../version/version.go). +If this is a **major release**, update the versions inside the [patching](./patching.md) in step 2. ## 6. Update Changelog @@ -88,7 +88,7 @@ Create a Git tag and sign it using your [GPG key](https://docs.github.com/en/aut ```bash git checkout ${BASE_BRANCH} git pull -git tag -s -a $TAG_NAME -m $TAG_MSG +git tag -s -a ${TAG_NAME} -m ${TAG_MSG} ``` Inspect the tag information: @@ -110,8 +110,7 @@ Pushing the tag will automatically create a release tag and build the binaries. ## 10. Bump the Version Update the version inside [version.go](../version/version.go) and add `beta` to the `meta` field. -Additionally, update version in the [patching](./patching.md) document. -If this is a major release, update the version inside this document in step 3. +If this is a **major release**, update the versions inside this document in step 3. Create a new PR against the base branch: