Skip to content

Commit

Permalink
ci: Update release and pre-release workflows and process (backport #3…
Browse files Browse the repository at this point in the history
…17) (#318)

* ci: Update release and pre-release workflows and process (#317)

* ci: Sync pre-release workflow with that on v0.34.x

Signed-off-by: Thane Thomson <[email protected]>

* ci: Add "v" prefix to released versions on GitHub

Signed-off-by: Thane Thomson <[email protected]>

* ci: Simplify and clarify release and pre-release workflows

Signed-off-by: Thane Thomson <[email protected]>

* docs: Update RELEASES with new changelog process with unclog

Signed-off-by: Thane Thomson <[email protected]>

* ci: Clarify pre-release release notes description

Signed-off-by: Thane Thomson <[email protected]>

* ci: Simplify release workflow further

Signed-off-by: Thane Thomson <[email protected]>

* ci: Add step descriptions for pre-release and release workflows to explain what they do

Signed-off-by: Thane Thomson <[email protected]>

---------

Signed-off-by: Thane Thomson <[email protected]>
(cherry picked from commit 6e59854fef4c07615dd67ab2434e7e4143520684)

# Conflicts:
#	RELEASES.md

* Revert "ci: Update release and pre-release workflows and process (#317)"

This reverts commit b2892636cadcecaf91de9b70e303c5b4de52f713.

* ci: Update release and pre-release workflows and process (#317)

* ci: Sync pre-release workflow with that on v0.34.x

Signed-off-by: Thane Thomson <[email protected]>

* ci: Add "v" prefix to released versions on GitHub

Signed-off-by: Thane Thomson <[email protected]>

* ci: Simplify and clarify release and pre-release workflows

Signed-off-by: Thane Thomson <[email protected]>

* docs: Update RELEASES with new changelog process with unclog

Signed-off-by: Thane Thomson <[email protected]>

* ci: Clarify pre-release release notes description

Signed-off-by: Thane Thomson <[email protected]>

* ci: Simplify release workflow further

Signed-off-by: Thane Thomson <[email protected]>

* ci: Add step descriptions for pre-release and release workflows to explain what they do

Signed-off-by: Thane Thomson <[email protected]>

---------

Signed-off-by: Thane Thomson <[email protected]>

---------

Signed-off-by: Thane Thomson <[email protected]>
Co-authored-by: Thane Thomson <[email protected]>
Co-authored-by: Sergio Mena <[email protected]>
Co-authored-by: Lasaro <[email protected]>
  • Loading branch information
4 people authored Feb 20, 2023
1 parent ad92080 commit 002d6be
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 55 deletions.
17 changes: 6 additions & 11 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,17 @@ jobs:
with:
go-version: '1.18'

- name: Build
uses: goreleaser/goreleaser-action@v4
if: ${{ github.event_name == 'pull_request' }}
with:
version: latest
args: build --skip-validate # skip validate skips initial sanity checks in order to be able to fully run

# Link to CHANGELOG_PENDING.md as release notes.
- run: echo https://github.com/cometbft/cometbft/blob/${GITHUB_REF#refs/tags/}/CHANGELOG_PENDING.md > ../release_notes.md
- name: Generate release notes
run: |
VERSION="${GITHUB_REF#refs/tags/}"
CHANGELOG_URL="https://github.com/cometbft/cometbft/blob/${VERSION}/CHANGELOG.md"
echo "See the [CHANGELOG](${CHANGELOG_URL}) for changes available in this pre-release, but not yet officially released." > ../release_notes.md
- name: Release
uses: goreleaser/goreleaser-action@v4
if: startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --rm-dist --release-notes=../release_notes.md
args: release --clean --release-notes ../release_notes.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
17 changes: 7 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,18 @@ jobs:
with:
go-version: '1.18'

- name: Build
uses: goreleaser/goreleaser-action@v4
if: ${{ github.event_name == 'pull_request' }}
with:
version: latest
args: build --skip-validate # skip validate skips initial sanity checks in order to be able to fully run

- run: echo https://github.com/cometbft/cometbft/blob/${GITHUB_REF#refs/tags/}/CHANGELOG.md#${GITHUB_REF#refs/tags/} > ../release_notes.md
- name: Generate release notes
run: |
VERSION="${GITHUB_REF#refs/tags/}"
VERSION_REF="${VERSION//[\.]/}"
CHANGELOG_URL="https://github.com/cometbft/cometbft/blob/${VERSION}/CHANGELOG.md#${VERSION_REF}"
echo "See the [CHANGELOG](${CHANGELOG_URL}) for this release." > ../release_notes.md
- name: Release
uses: goreleaser/goreleaser-action@v4
if: startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --rm-dist --release-notes=../release_notes.md
args: release --clean --release-notes ../release_notes.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ checksum:

release:
prerelease: auto
name_template: "{{.Version}}"
name_template: "v{{.Version}}"

archives:
- files:
Expand Down
68 changes: 35 additions & 33 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,18 @@ backport branch (see above). Otherwise:
(which can be triggered from the GitHub UI;
e.g., https://github.com/tendermint/tendermint/actions/workflows/e2e-nightly-37x.yml).
3. Prepare the pre-release documentation:
- Ensure that all relevant changes are in the `CHANGELOG_PENDING.md` file.
This file's contents must only be included in the `CHANGELOG.md` when we
cut final releases.
- Ensure that `UPGRADING.md` is up-to-date and includes notes on any breaking changes
or other upgrading flows.
* Build the changelog with [unclog] _without_ doing an unclog release, and
commit the built changelog. This ensures that all changelog entries appear
under an "Unreleased" heading in the pre-release's changelog. The changes
are only considered officially "released" once we cut a regular (final)
release.
* Ensure that `UPGRADING.md` is up-to-date and includes notes on any breaking
changes or other upgrading flows.
4. Prepare the versioning:
- Bump TMVersionDefault version in `version.go`
- Bump P2P and block protocol versions in `version.go`, if necessary.
* Bump TMVersionDefault version in `version.go`
* Bump P2P and block protocol versions in `version.go`, if necessary.
Check the changelog for breaking changes in these components.
- Bump ABCI protocol version in `version.go`, if necessary
* Bump ABCI protocol version in `version.go`, if necessary
5. Open a PR with these changes against the backport branch.
6. Once these changes have landed on the backport branch, be sure to pull them back down locally.
7. Once you have the changes locally, create the new tag, specifying a name and a tag "message":
Expand All @@ -187,23 +189,20 @@ Before performing these steps, be sure the
1. Start on the backport branch (e.g. `v0.38.x`)
2. Run integration tests (`make test_integrations`) and the e2e nightlies.
3. Prepare the release:
- "Squash" changes from the changelog entries for the pre-releases into a
single entry, and add all changes included in `CHANGELOG_PENDING.md`.
(Squashing includes both combining all entries, as well as removing or
simplifying any intra-pre-release changes. It may also help to alphabetize
the entries by package name.)
- Run `python ./scripts/linkify_changelog.py CHANGELOG.md` to add links for
all PRs
- Ensure that `UPGRADING.md` is up-to-date and includes notes on any breaking changes
* Do a [release][unclog-release] with [unclog] for the desired version,
ensuring that you write up a good summary of the major highlights of the
release that users would be interested in.
* Build the changelog using unclog, and commit the built changelog.
* Ensure that `UPGRADING.md` is up-to-date and includes notes on any breaking changes
or other upgrading flows.
- Bump TMVersionDefault version in `version.go`
- Bump P2P and block protocol versions in `version.go`, if necessary
- Bump ABCI protocol version in `version.go`, if necessary
* Bump TMVersionDefault version in `version.go`
* Bump P2P and block protocol versions in `version.go`, if necessary
* Bump ABCI protocol version in `version.go`, if necessary
4. Open a PR with these changes against the backport branch.
5. Once these changes are on the backport branch, push a tag with prepared release details.
This will trigger the actual release `v0.38.0`.
- `git tag -a v0.38.0 -m 'Release v0.38.0'`
- `git push origin v0.38.0`
* `git tag -a v0.38.0 -m 'Release v0.38.0'`
* `git push origin v0.38.0`
6. Make sure that `main` is updated with the latest `CHANGELOG.md`, `CHANGELOG_PENDING.md`, and `UPGRADING.md`.

## Patch release
Expand All @@ -220,21 +219,21 @@ To create a patch release:
1. Checkout the long-lived backport branch: `git checkout v0.38.x`
2. Run integration tests (`make test_integrations`) and the nightlies.
3. Check out a new branch and prepare the release:
- Copy `CHANGELOG_PENDING.md` to top of `CHANGELOG.md`
- Run `python ./scripts/linkify_changelog.py CHANGELOG.md` to add links for all issues
- Run `bash ./scripts/authors.sh` to get a list of authors since the latest release, and add the GitHub aliases of external contributors to the top of the CHANGELOG. To lookup an alias from an email, try `bash ./scripts/authors.sh <email>`
- Reset the `CHANGELOG_PENDING.md`
- Bump the TMDefaultVersion in `version.go`
- Bump the ABCI version number, if necessary.
(Note that ABCI follows semver, and that ABCI versions are the only versions
which can change during patch releases, and only field additions are valid patch changes.)
* Do a [release][unclog-release] with [unclog] for the desired version,
ensuring that you write up a good summary of the major highlights of the
release that users would be interested in.
* Build the changelog using unclog, and commit the built changelog.
* Bump the TMDefaultVersion in `version.go`
* Bump the ABCI version number, if necessary. (Note that ABCI follows semver,
and that ABCI versions are the only versions which can change during patch
releases, and only field additions are valid patch changes.)
4. Open a PR with these changes that will land them back on `v0.38.x`
5. Once this change has landed on the backport branch, make sure to pull it locally, then push a tag.
- `git tag -a v0.38.1 -m 'Release v0.38.1'`
- `git push origin v0.38.1`
* `git tag -a v0.38.1 -m 'Release v0.38.1'`
* `git push origin v0.38.1`
6. Create a pull request back to main with the CHANGELOG & version changes from the latest release.
- Remove all `R:patch` labels from the pull requests that were included in the release.
- Do not merge the backport branch into main.
* Remove all `R:patch` labels from the pull requests that were included in the release.
* Do not merge the backport branch into main.

## Minor Release Checklist

Expand Down Expand Up @@ -367,3 +366,6 @@ of 150 validators is configured to only possess a cumulative stake of 67% of
the total stake. The remaining 33% of the stake is configured to belong to
a validator that is never actually run in the test network. The network is run
for multiple days, ensuring that it is able to produce blocks without issue.

[unclog]: https://github.com/informalsystems/unclog
[unclog-release]: https://github.com/informalsystems/unclog#releasing-a-new-versions-change-set

0 comments on commit 002d6be

Please sign in to comment.