Skip to content

Commit

Permalink
ci: Add release version check (backport #427) (#429)
Browse files Browse the repository at this point in the history
* ci: Add release version check (#427)

* ci: Add release version check

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

* Fix workflow trigger

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

---------

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

* Use Go 1.19 in v0.34.x

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

---------

Signed-off-by: Thane Thomson <[email protected]>
Co-authored-by: Thane Thomson <[email protected]>
  • Loading branch information
mergify[bot] and thanethomson authored Mar 1, 2023
1 parent 380358c commit 1ad88b8
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/release-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Checks that, if we're working on a release branch and are about to cut a
# release, we have set the version correctly.
name: Check release version

on:
push:
branches:
- 'release/**'

jobs:
check-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-go@v3
with:
go-version: '1.19'

- name: Check version
run: |
# We strip the refs/heads/release/v prefix of the branch name.
BRANCH_VERSION=${GITHUB_REF#refs/heads/release/v}
# Get the version of the code, which has no "v" prefix.
CODE_VERSION=`go run ./cmd/cometbft/ version`
if [ "$BRANCH_VERSION" != "$CODE_VERSION" ]; then
echo "Branch version ${BRANCH_VERSION} does not match code version ${CODE_VERSION}"
echo ""
echo "Please either fix the release branch naming (which must have a 'release/v' prefix)"
echo "or the version of the software in version/version.go."
exit 1
fi

0 comments on commit 1ad88b8

Please sign in to comment.