Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6e59854

Browse files
authoredFeb 10, 2023
ci: Update release and pre-release workflows and process (celestiaorg#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]>
1 parent f6e70af commit 6e59854

File tree

4 files changed

+32
-42
lines changed

4 files changed

+32
-42
lines changed
 

‎.github/workflows/pre-release.yml

+6-11
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,17 @@ jobs:
2020
with:
2121
go-version: '1.18'
2222

23-
- name: Build
24-
uses: goreleaser/goreleaser-action@v4
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/cometbft/cometbft/blob/${GITHUB_REF#refs/tags/}/CHANGELOG_PENDING.md > ../release_notes.md
23+
- name: Generate release notes
24+
run: |
25+
VERSION="${GITHUB_REF#refs/tags/}"
26+
CHANGELOG_URL="https://github.com/cometbft/cometbft/blob/${VERSION}/CHANGELOG.md"
27+
echo "See the [CHANGELOG](${CHANGELOG_URL}) for changes available in this pre-release, but not yet officially released." > ../release_notes.md
3228
3329
- name: Release
3430
uses: goreleaser/goreleaser-action@v4
35-
if: startsWith(github.ref, 'refs/tags/')
3631
with:
3732
version: latest
38-
args: release --rm-dist --release-notes=../release_notes.md
33+
args: release --clean --release-notes ../release_notes.md
3934
env:
4035
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4136

‎.github/workflows/release.yml

+7-10
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,18 @@ jobs:
1818
with:
1919
go-version: '1.18'
2020

21-
- name: Build
22-
uses: goreleaser/goreleaser-action@v4
23-
if: ${{ github.event_name == 'pull_request' }}
24-
with:
25-
version: latest
26-
args: build --skip-validate # skip validate skips initial sanity checks in order to be able to fully run
27-
28-
- run: echo https://github.com/cometbft/cometbft/blob/${GITHUB_REF#refs/tags/}/CHANGELOG.md#${GITHUB_REF#refs/tags/} > ../release_notes.md
21+
- name: Generate release notes
22+
run: |
23+
VERSION="${GITHUB_REF#refs/tags/}"
24+
VERSION_REF="${VERSION//[\.]/}"
25+
CHANGELOG_URL="https://github.com/cometbft/cometbft/blob/${VERSION}/CHANGELOG.md#${VERSION_REF}"
26+
echo "See the [CHANGELOG](${CHANGELOG_URL}) for this release." > ../release_notes.md
2927
3028
- name: Release
3129
uses: goreleaser/goreleaser-action@v4
32-
if: startsWith(github.ref, 'refs/tags/')
3330
with:
3431
version: latest
35-
args: release --rm-dist --release-notes=../release_notes.md
32+
args: release --clean --release-notes ../release_notes.md
3633
env:
3734
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3835

‎.goreleaser.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ checksum:
2626

2727
release:
2828
prerelease: auto
29-
name_template: "{{.Version}}"
29+
name_template: "v{{.Version}}"
3030

3131
archives:
3232
- files:

‎RELEASES.md

+18-20
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,13 @@ backport branch (see above). Otherwise:
150150
(which can be triggered from the GitHub UI;
151151
e.g., <https://github.com/cometbft/cometbft/actions/workflows/e2e-nightly-37x.yml>).
152152
3. Prepare the pre-release documentation:
153-
* Ensure that all relevant changes are in the `CHANGELOG_PENDING.md` file.
154-
This file's contents must only be included in the `CHANGELOG.md` when we
155-
cut final releases.
156-
* Ensure that `UPGRADING.md` is up-to-date and includes notes on any breaking changes
157-
or other upgrading flows.
153+
* Build the changelog with [unclog] _without_ doing an unclog release, and
154+
commit the built changelog. This ensures that all changelog entries appear
155+
under an "Unreleased" heading in the pre-release's changelog. The changes
156+
are only considered officially "released" once we cut a regular (final)
157+
release.
158+
* Ensure that `UPGRADING.md` is up-to-date and includes notes on any breaking
159+
changes or other upgrading flows.
158160
4. Prepare the versioning:
159161
* Bump TMVersionDefault version in `version.go`
160162
* Bump P2P and block protocol versions in `version.go`, if necessary.
@@ -181,13 +183,10 @@ Before performing these steps, be sure the
181183
1. Start on the backport branch (e.g. `v0.38.x`)
182184
2. Run integration tests (`make test_integrations`) and the e2e nightlies.
183185
3. Prepare the release:
184-
* "Squash" changes from the changelog entries for the pre-releases into a
185-
single entry, and add all changes included in `CHANGELOG_PENDING.md`.
186-
(Squashing includes both combining all entries, as well as removing or
187-
simplifying any intra-pre-release changes. It may also help to alphabetize
188-
the entries by package name.)
189-
* Run `python ./scripts/linkify_changelog.py CHANGELOG.md` to add links for
190-
all PRs
186+
* Do a [release][unclog-release] with [unclog] for the desired version,
187+
ensuring that you write up a good summary of the major highlights of the
188+
release that users would be interested in.
189+
* Build the changelog using unclog, and commit the built changelog.
191190
* Ensure that `UPGRADING.md` is up-to-date and includes notes on any breaking changes
192191
or other upgrading flows.
193192
* Bump TMVersionDefault version in `version.go`
@@ -214,14 +213,10 @@ To create a patch release:
214213
1. Checkout the long-lived backport branch: `git checkout v0.38.x`
215214
2. Run integration tests (`make test_integrations`) and the nightlies.
216215
3. Check out a new branch and prepare the release:
217-
* Copy `CHANGELOG_PENDING.md` to top of `CHANGELOG.md`
218-
* Run `python ./scripts/linkify_changelog.py CHANGELOG.md` to add links for
219-
all issues
220-
* Run `bash ./scripts/authors.sh` to get a list of authors since the latest
221-
release, and add the GitHub aliases of external contributors to the top of
222-
the CHANGELOG. To lookup an alias from an email, try `bash
223-
./scripts/authors.sh <email>`
224-
* Reset the `CHANGELOG_PENDING.md`
216+
* Do a [release][unclog-release] with [unclog] for the desired version,
217+
ensuring that you write up a good summary of the major highlights of the
218+
release that users would be interested in.
219+
* Build the changelog using unclog, and commit the built changelog.
225220
* Bump the TMDefaultVersion in `version.go`
226221
* Bump the ABCI version number, if necessary. (Note that ABCI follows semver,
227222
and that ABCI versions are the only versions which can change during patch
@@ -362,3 +357,6 @@ of 150 validators is configured to only possess a cumulative stake of 67% of
362357
the total stake. The remaining 33% of the stake is configured to belong to
363358
a validator that is never actually run in the test network. The network is run
364359
for multiple days, ensuring that it is able to produce blocks without issue.
360+
361+
[unclog]: https://github.com/informalsystems/unclog
362+
[unclog-release]: https://github.com/informalsystems/unclog#releasing-a-new-versions-change-set

0 commit comments

Comments
 (0)
Please sign in to comment.