Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/check-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

set -ex

TAG="${GITHUB_REF_NAME:-${GITHUB_REF#refs/tags/}}"
if [ -z "$TAG" ] || [ "$TAG" = "$GITHUB_REF" ]; then
echo "Unable to determine tag from GitHub Actions environment"
exit 1
fi
FILE_VERSION=$(sed -nE 's/var Version = "(.*)"/\1/p' cmd/version.go)

if [ "$TAG" != "v$FILE_VERSION" ]; then
echo "Version mismatch: tag is $TAG but version.go has $FILE_VERSION"
exit 1
fi
5 changes: 5 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Confirm tag and code versions match
run: |
.github/workflows/check-version.sh
- uses: cli/gh-extension-precompile@v2
with:
generate_attestations: true
Expand Down
2 changes: 1 addition & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

// Version of the CLI app.
var Version = "0.1.0"
var Version = "0.0.10"

// The command prints out the version of the CLI app.
func init() {
Expand Down
Loading