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
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,41 @@ permissions:
contents: write

jobs:
verify-version:
name: Verify tag matches committed versions
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Check Cargo.toml and main.go versions match tag
run: |
tag="${GITHUB_REF_NAME}"
cargo_version=$(cargo metadata --no-deps --format-version 1 \
| jq -r '.packages[] | select(.name == "componentize-go") | .version')
go_release=$(sed -nE 's/^[[:space:]]*release := "([^"]+)"/\1/p' main.go)

echo "tag: $tag"
echo "Cargo.toml: v$cargo_version"
echo "main.go: $go_release"

status=0
if [ "v$cargo_version" != "$tag" ]; then
echo "::error file=Cargo.toml::workspace.package.version (v$cargo_version) does not match tag $tag"
status=1
fi
if [ "$go_release" != "$tag" ]; then
echo "::error file=main.go::release ($go_release) does not match tag $tag"
status=1
fi
exit $status

build:
name: Build ${{ matrix.target }}
needs: verify-version
if: ${{ !failure() && !cancelled() }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ reqwest = { version = "0.13.4", features = ["blocking"] }
tar = "0.4.46"

[workspace.package]
version = "0.4.3"
version = "0.5.1"
edition = "2024"

[workspace.lints.clippy]
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ require (
)

require golang.org/x/sys v0.37.0 // indirect

retract v0.5.0 // manifest versions not bumped; use v0.5.1
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
// Although `componentize-go` is written in Rust, we can use this wrapper to
// make it available using e.g. `go install` and/or `go tool`.
func main() {
release := "v0.4.3"
release := "v0.5.1"

directories := userdirs.ForApp(
"componentize-go",
Expand Down
Loading