Skip to content

Commit 6a32846

Browse files
ci: Pre-release workflows (backport #9366) (#9368)
* ci: Pre-release workflows (#9366) In preparation for the v0.37 release, this PR updates: 1. The [release guidelines](https://github.com/tendermint/tendermint/blob/thane/pre-release-workflows/RELEASES.md#pre-releases) regarding alpha and beta versions, as well as release candidates. 2. The GitHub workflows to build all 3 kinds of pre-releases for: 1. Docker images 2. Binaries (I'm still not 100% sure whether this is necessary, but it does act as a clear signal to users that a pre-release is available, and pre-built binaries could be useful for people running testnets who don't use Docker) 3. The Goreleaser config to auto-detect whether a tag is a pre-release and mark it as such as the release is created on GitHub. --- #### PR checklist - [x] Tests written/updated, or no tests needed - [x] `CHANGELOG_PENDING.md` updated, or no changelog entry needed - [x] Updated relevant documentation (`docs/`) and code comments, or no documentation updates needed (cherry picked from commit 6bdc970) # Conflicts: # RELEASES.md * Sync releases guide with main Signed-off-by: Thane Thomson <[email protected]> Signed-off-by: Thane Thomson <[email protected]> Co-authored-by: Thane Thomson <[email protected]>
1 parent d9fd26c commit 6a32846

File tree

4 files changed

+145
-73
lines changed

4 files changed

+145
-73
lines changed

.github/workflows/docker.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ on:
66
branches:
77
- main
88
tags:
9-
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10
10-
- "v[0-9]+.[0-9]+.[0-9]+-rc*" # Push events to matching v*, i.e. v1.0-rc1, v20.15.10-rc5
9+
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10
10+
- "v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+" # e.g. v0.37.0-alpha.1, v0.38.0-alpha.10
11+
- "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+" # e.g. v0.37.0-beta.1, v0.38.0-beta.10
12+
- "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+" # e.g. v0.37.0-rc1, v0.38.0-rc10
1113

1214
jobs:
1315
build:

.github/workflows/pre-release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: "Pre-release"
2+
3+
on:
4+
push:
5+
tags:
6+
- "v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+" # e.g. v0.37.0-alpha.1, v0.38.0-alpha.10
7+
- "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+" # e.g. v0.37.0-beta.1, v0.38.0-beta.10
8+
- "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+" # e.g. v0.37.0-rc1, v0.38.0-rc10
9+
10+
jobs:
11+
goreleaser:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0
18+
19+
- uses: actions/setup-go@v3
20+
with:
21+
go-version: '1.18'
22+
23+
- name: Build
24+
uses: goreleaser/goreleaser-action@v3
25+
if: ${{ github.event_name == 'pull_request' }}
26+
with:
27+
version: latest
28+
args: build --skip-validate # skip validate skips initial sanity checks in order to be able to fully run
29+
30+
# Link to CHANGELOG_PENDING.md as release notes.
31+
- run: echo https://github.com/tendermint/tendermint/blob/${GITHUB_REF#refs/tags/}/CHANGELOG_PENDING.md > ../release_notes.md
32+
33+
- name: Release
34+
uses: goreleaser/goreleaser-action@v3
35+
if: startsWith(github.ref, 'refs/tags/')
36+
with:
37+
version: latest
38+
args: release --rm-dist --release-notes=../release_notes.md
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ checksum:
2525
algorithm: sha256
2626

2727
release:
28+
prerelease: auto
2829
name_template: "{{.Version}} (WARNING: BETA SOFTWARE)"
2930

3031
archives:

RELEASES.md

Lines changed: 100 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ We use Mergify's [backport feature](https://mergify.io/features/backports) to
2222
automatically backport to the needed branch. There should be a label for any
2323
backport branch that you'll be targeting. To notify the bot to backport a pull
2424
request, mark the pull request with the label corresponding to the correct
25-
backport branch. For example, to backport to v0.35.x, add the label
26-
`S:backport-to-v0.35.x`. Once the original pull request is merged, the bot will
25+
backport branch. For example, to backport to v0.38.x, add the label
26+
`S:backport-to-v0.38.x`. Once the original pull request is merged, the bot will
2727
try to cherry-pick the pull request to the backport branch. If the bot fails to
2828
backport, it will open a pull request. The author of the original pull request
2929
is responsible for solving the conflicts and merging the pull request.
@@ -40,37 +40,52 @@ branches tags. See [#6072](https://github.com/tendermint/tendermint/pull/6072)
4040
for more context.
4141

4242
In the following example, we'll assume that we're making a backport branch for
43-
the 0.35.x line.
43+
the 0.38.x line.
4444

4545
1. Start on `main`
4646

47-
2. Create and push the backport branch:
47+
2. Ensure that there is a [branch protection
48+
rule](https://github.com/tendermint/tendermint/settings/branches) for the
49+
branch you are about to create (you will need admin access to the repository
50+
in order to do this).
51+
52+
3. Create and push the backport branch:
4853
```sh
49-
git checkout -b v0.35.x
50-
git push origin v0.35.x
54+
git checkout -b v0.38.x
55+
git push origin v0.38.x
5156
```
5257

53-
3. Create a PR to update the documentation directory for the backport branch.
58+
4. Create a PR to update the documentation directory for the backport branch.
5459

55-
We only maintain RFC and ADR documents on main, to avoid confusion. In
56-
addition, we rewrite Markdown URLs pointing to main to point to the
57-
backport branch, so that generated documentation will link to the correct
58-
versions of files elsewhere in the repository. For context on the latter, see
59-
https://github.com/tendermint/tendermint/issues/7675.
60+
We rewrite any URLs pointing to `main` to point to the backport branch,
61+
so that generated documentation will link to the correct versions of files
62+
elsewhere in the repository. The following files are to be excluded from this
63+
search:
6064

61-
To prepare the PR:
62-
```sh
63-
# Remove the RFC and ADR documents from the backport.
64-
# We only maintain these on main to avoid confusion.
65-
git rm -r docs/rfc docs/architecture
65+
* [`README.md`](./README.md)
66+
* [`CHANGELOG.md`](./CHANGELOG.md)
67+
* [`UPGRADING.md`](./UPGRADING.md)
68+
69+
The following links are to always point to `main`, regardless of where they
70+
occur in the codebase:
71+
72+
* `https://github.com/tendermint/tendermint/blob/main/LICENSE`
6673

67-
# Update absolute links to point to the backport.
68-
go run ./scripts/linkpatch -recur -target v0.35.x -skip-path docs/DOCS_README.md,docs/README.md docs
74+
Be sure to search for all of the following links and replace `main` with your
75+
corresponding branch label or version (e.g. `v0.38.x` or `v0.38`):
6976

77+
* `github.com/tendermint/tendermint/blob/main` ->
78+
`github.com/tendermint/tendermint/blob/v0.38.x`
79+
* `github.com/tendermint/tendermint/tree/main` ->
80+
`github.com/tendermint/tendermint/tree/v0.38.x`
81+
* `docs.tendermint.com/main` -> `docs.tendermint.com/v0.38`
82+
83+
Once you have updated all of the relevant documentation:
84+
```sh
7085
# Create and push the PR.
71-
git checkout -b update-docs-v035x
72-
git commit -m "Update docs for v0.35.x backport branch." docs
73-
git push -u origin update-docs-v035x
86+
git checkout -b update-docs-v038x
87+
git commit -m "Update docs for v0.38.x backport branch."
88+
git push -u origin update-docs-v038x
7489
```
7590

7691
Be sure to merge this PR before making other changes on the newly-created
@@ -82,15 +97,15 @@ After doing these steps, go back to `main` and do the following:
8297
it up to GitHub.
8398
For example:
8499
```sh
85-
git tag -a v0.36.0-dev -m "Development base for Tendermint v0.36."
86-
git push origin v0.36.0-dev
100+
git tag -a v0.39.0-dev -m "Development base for Tendermint v0.39."
101+
git push origin v0.39.0-dev
87102
```
88103

89104
2. Create a new workflow to run e2e nightlies for the new backport branch. (See
90105
[e2e-nightly-main.yml][e2e] for an example.)
91106

92107
3. Add a new section to the Mergify config (`.github/mergify.yml`) to enable the
93-
backport bot to work on this branch, and add a corresponding `S:backport-to-v0.35.x`
108+
backport bot to work on this branch, and add a corresponding `S:backport-to-v0.38.x`
94109
[label](https://github.com/tendermint/tendermint/labels) so the bot can be triggered.
95110

96111
4. Add a new section to the Dependabot config (`.github/dependabot.yml`) to
@@ -99,53 +114,66 @@ After doing these steps, go back to `main` and do the following:
99114

100115
[e2e]: https://github.com/tendermint/tendermint/blob/main/.github/workflows/e2e-nightly-main.yml
101116

102-
## Release candidates
117+
## Pre-releases
103118

104119
Before creating an official release, especially a minor release, we may want to
105-
create a release candidate (RC) for our friends and partners to test out. We use
106-
git tags to create RCs, and we build them off of backport branches.
120+
create an alpha or beta version, or release candidate (RC) for our friends and
121+
partners to test out. We use git tags to create pre-releases, and we build them
122+
off of backport branches, for example:
123+
124+
- `v0.38.0-alpha.1` - The first alpha release of `v0.38.0`. Subsequent alpha
125+
releases will be numbered `v0.38.0-alpha.2`, `v0.38.0-alpha.3`, etc.
126+
127+
Alpha releases are to be considered the _most_ unstable of pre-releases, and
128+
are most likely not yet properly QA'd. These are made available to allow early
129+
adopters to start integrating and testing new functionality before we're done
130+
with QA.
107131

108-
Tags for RCs should follow the "standard" release naming conventions, with
109-
`-rcX` at the end (for example, `v0.35.0-rc0`).
132+
- `v0.38.0-beta.1` - The first beta release of `v0.38.0`. Subsequent beta
133+
releases will be numbered `v0.38.0-beta.2`, `v0.38.0-beta.3`, etc.
134+
135+
Beta releases can be considered more stable than alpha releases in that we
136+
will have QA'd them better than alpha releases, but there still may be
137+
minor breaking API changes if users have strong demands for such changes.
138+
139+
- `v0.38.0-rc1` - The first release candidate (RC) of `v0.38.0`. Subsequent RCs
140+
will be numbered `v0.38.0-rc2`, `v0.38.0-rc3`, etc.
141+
142+
RCs are considered more stable than beta releases in that we will have
143+
completed our QA on them. APIs will most likely be stable at this point. The
144+
difference between an RC and a release is that there may still be small
145+
changes (bug fixes, features) that may make their way into the series before
146+
cutting a final release.
110147

111148
(Note that branches and tags _cannot_ have the same names, so it's important
112149
that these branches have distinct names from the tags/release names.)
113150

114-
If this is the first RC for a minor release, you'll have to make a new backport
115-
branch (see above). Otherwise:
116-
117-
1. Start from the backport branch (e.g. `v0.35.x`).
118-
2. Run the integration tests and the e2e nightlies
119-
(which can be triggered from the Github UI;
120-
e.g., https://github.com/tendermint/tendermint/actions/workflows/e2e-nightly-34x.yml).
121-
3. Prepare the changelog:
122-
- Move the changes included in `CHANGELOG_PENDING.md` into `CHANGELOG.md`. Each RC should have
123-
it's own changelog section. These will be squashed when the final candidate is released.
124-
- Ensure that there is a "release highlights" or "release summary" paragraph
125-
after the version heading describing what we feel are the most important
126-
changes in this release from a user's perspective. This paragraph should
127-
answer the question: "why should users upgrade to this version?", and with
128-
specific reasons (not generic ones like "more bug fixes").
129-
- Run `python ./scripts/linkify_changelog.py CHANGELOG.md` to add links for
130-
all PRs
151+
If this is the first pre-release for a minor release, you'll have to make a new
152+
backport branch (see above). Otherwise:
153+
154+
1. Start from the backport branch (e.g. `v0.38.x`).
155+
2. Run the integration tests and the E2E nightlies
156+
(which can be triggered from the GitHub UI;
157+
e.g., https://github.com/tendermint/tendermint/actions/workflows/e2e-nightly-37x.yml).
158+
3. Prepare the pre-release documentation:
159+
- Ensure that all relevant changes are in the `CHANGELOG_PENDING.md` file.
160+
This file's contents must only be included in the `CHANGELOG.md` when we
161+
cut final releases.
131162
- Ensure that `UPGRADING.md` is up-to-date and includes notes on any breaking changes
132163
or other upgrading flows.
164+
4. Prepare the versioning:
133165
- Bump TMVersionDefault version in `version.go`
134166
- Bump P2P and block protocol versions in `version.go`, if necessary.
135167
Check the changelog for breaking changes in these components.
136168
- Bump ABCI protocol version in `version.go`, if necessary
137-
4. Open a PR with these changes against the backport branch.
138-
5. Once these changes have landed on the backport branch, be sure to pull them back down locally.
139-
6. Once you have the changes locally, create the new tag, specifying a name and a tag "message":
140-
`git tag -a v0.35.0-rc0 -m "Release Candidate v0.35.0-rc0`
141-
7. Push the tag back up to origin:
142-
`git push origin v0.35.0-rc0`
169+
5. Open a PR with these changes against the backport branch.
170+
6. Once these changes have landed on the backport branch, be sure to pull them back down locally.
171+
7. Once you have the changes locally, create the new tag, specifying a name and a tag "message":
172+
`git tag -a v0.38.0-rc1 -m "Release Candidate v0.38.0-rc1`
173+
8. Push the tag back up to origin:
174+
`git push origin v0.38.0-rc1`
143175
Now the tag should be available on the repo's releases page.
144-
8. Future RCs will continue to be built off of this branch.
145-
146-
Note that this process should only be used for "true" RCs -- release candidates
147-
that, if successful, will be the next release. For more experimental "RCs,"
148-
create a new, short-lived branch and tag that instead.
176+
9. Future pre-releases will continue to be built off of this branch.
149177

150178
## Minor release
151179

@@ -156,13 +184,14 @@ branch, as described above.
156184
Before performing these steps, be sure the
157185
[Minor Release Checklist](#minor-release-checklist) has been completed.
158186

159-
1. Start on the backport branch (e.g. `v0.35.x`)
187+
1. Start on the backport branch (e.g. `v0.38.x`)
160188
2. Run integration tests (`make test_integrations`) and the e2e nightlies.
161189
3. Prepare the release:
162-
- "Squash" changes from the changelog entries for the RCs into a single entry,
163-
and add all changes included in `CHANGELOG_PENDING.md`.
164-
(Squashing includes both combining all entries, as well as removing or simplifying
165-
any intra-RC changes. It may also help to alphabetize the entries by package name.)
190+
- "Squash" changes from the changelog entries for the pre-releases into a
191+
single entry, and add all changes included in `CHANGELOG_PENDING.md`.
192+
(Squashing includes both combining all entries, as well as removing or
193+
simplifying any intra-pre-release changes. It may also help to alphabetize
194+
the entries by package name.)
166195
- Run `python ./scripts/linkify_changelog.py CHANGELOG.md` to add links for
167196
all PRs
168197
- Ensure that `UPGRADING.md` is up-to-date and includes notes on any breaking changes
@@ -172,12 +201,12 @@ Before performing these steps, be sure the
172201
- Bump ABCI protocol version in `version.go`, if necessary
173202
4. Open a PR with these changes against the backport branch.
174203
5. Once these changes are on the backport branch, push a tag with prepared release details.
175-
This will trigger the actual release `v0.35.0`.
176-
- `git tag -a v0.35.0 -m 'Release v0.35.0'`
177-
- `git push origin v0.35.0`
204+
This will trigger the actual release `v0.38.0`.
205+
- `git tag -a v0.38.0 -m 'Release v0.38.0'`
206+
- `git push origin v0.38.0`
178207
6. Make sure that `main` is updated with the latest `CHANGELOG.md`, `CHANGELOG_PENDING.md`, and `UPGRADING.md`.
179208
7. Add the release to the documentation site generator config (see
180-
[DOCS_README.md](./docs/DOCS_README.md) for more details). In summary:
209+
[DOCS\_README.md](./docs/DOCS_README.md) for more details). In summary:
181210
- Start on branch `main`.
182211
- Add a new line at the bottom of [`docs/versions`](./docs/versions) to
183212
ensure the newest release is the default for the landing page.
@@ -198,7 +227,7 @@ changes may merit a release candidate.
198227

199228
To create a patch release:
200229

201-
1. Checkout the long-lived backport branch: `git checkout v0.35.x`
230+
1. Checkout the long-lived backport branch: `git checkout v0.38.x`
202231
2. Run integration tests (`make test_integrations`) and the nightlies.
203232
3. Check out a new branch and prepare the release:
204233
- Copy `CHANGELOG_PENDING.md` to top of `CHANGELOG.md`
@@ -209,10 +238,10 @@ To create a patch release:
209238
- Bump the ABCI version number, if necessary.
210239
(Note that ABCI follows semver, and that ABCI versions are the only versions
211240
which can change during patch releases, and only field additions are valid patch changes.)
212-
4. Open a PR with these changes that will land them back on `v0.35.x`
241+
4. Open a PR with these changes that will land them back on `v0.38.x`
213242
5. Once this change has landed on the backport branch, make sure to pull it locally, then push a tag.
214-
- `git tag -a v0.35.1 -m 'Release v0.35.1'`
215-
- `git push origin v0.35.1`
243+
- `git tag -a v0.38.1 -m 'Release v0.38.1'`
244+
- `git push origin v0.38.1`
216245
6. Create a pull request back to main with the CHANGELOG & version changes from the latest release.
217246
- Remove all `R:patch` labels from the pull requests that were included in the release.
218247
- Do not merge the backport branch into main.

0 commit comments

Comments
 (0)