Skip to content

Commit

Permalink
chore: update releasing doc (#1368)
Browse files Browse the repository at this point in the history
  • Loading branch information
themantre authored Jun 26, 2024
1 parent 13a2571 commit b38a724
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 27 deletions.
59 changes: 37 additions & 22 deletions docs/patching.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `[email protected]: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 `<minor>` with the appropriate minor version number:

```bash
git checkout -b 1.<minor>.x v1.<minor>.0
git checkout -b ${BASE_BRANCH} v${PRV_VER}
git log
git push --set-upstream origin 1.<minor>.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.<minor>.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
Expand All @@ -39,21 +69,6 @@ git cherry-pick <commit-id>
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.
Expand Down
9 changes: 4 additions & 5 deletions docs/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand All @@ -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:

Expand Down

0 comments on commit b38a724

Please sign in to comment.