Skip to content

Commit 816b7e1

Browse files
bordeuxclaude
andcommitted
fix: ensure builds use correct git ref for version
The build workflows were checking out the original commit instead of the tag created by semantic-release, causing binaries to have old versions. Changes: - Add required `ref` input to _build-binaries.yml and _build-packages.yml - CI workflow passes `github.sha` (current commit) - Release workflow passes `v{version}` (the new tag) - All checkout steps now use the explicit ref This ensures binaries are built from the correct commit with the updated Cargo.toml version. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 21c3290 commit 816b7e1

4 files changed

Lines changed: 20 additions & 0 deletions

File tree

.github/workflows/_build-binaries.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ permissions:
99
on:
1010
workflow_call:
1111
inputs:
12+
ref:
13+
description: 'Git ref to checkout (commit SHA or tag)'
14+
required: true
15+
type: string
1216
upload-artifacts:
1317
description: 'Whether to upload artifacts'
1418
required: false
@@ -74,6 +78,8 @@ jobs:
7478
steps:
7579
- name: Checkout code
7680
uses: actions/checkout@v4
81+
with:
82+
ref: ${{ inputs.ref }}
7783

7884
- name: Setup Rust
7985
uses: dtolnay/rust-toolchain@stable

.github/workflows/_build-packages.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ permissions:
99
on:
1010
workflow_call:
1111
inputs:
12+
ref:
13+
description: 'Git ref to checkout (commit SHA or tag)'
14+
required: true
15+
type: string
1216
version:
1317
description: 'Version string for package naming (optional, reads from Cargo.toml if not provided)'
1418
required: false
@@ -47,6 +51,8 @@ jobs:
4751
steps:
4852
- name: Checkout code
4953
uses: actions/checkout@v4
54+
with:
55+
ref: ${{ inputs.ref }}
5056

5157
- name: Setup Rust
5258
uses: dtolnay/rust-toolchain@stable
@@ -193,6 +199,8 @@ jobs:
193199
steps:
194200
- name: Checkout code
195201
uses: actions/checkout@v4
202+
with:
203+
ref: ${{ inputs.ref }}
196204

197205
- name: Setup Rust
198206
uses: dtolnay/rust-toolchain@stable
@@ -266,6 +274,8 @@ jobs:
266274
steps:
267275
- name: Checkout code
268276
uses: actions/checkout@v4
277+
with:
278+
ref: ${{ inputs.ref }}
269279

270280
- name: Setup Rust
271281
uses: dtolnay/rust-toolchain@stable

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ jobs:
124124
needs: [test, cargo-make]
125125
uses: ./.github/workflows/_build-binaries.yml
126126
with:
127+
ref: ${{ github.sha }}
127128
upload-artifacts: true
128129
artifact-retention-days: 7
129130

@@ -135,6 +136,7 @@ jobs:
135136
needs: [test, cargo-make]
136137
uses: ./.github/workflows/_build-packages.yml
137138
with:
139+
ref: ${{ github.sha }}
138140
artifact-retention-days: 7
139141

140142
# ============================================

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ jobs:
7474
if: needs.semantic-release.outputs.new_release_published == 'true'
7575
uses: ./.github/workflows/_build-binaries.yml
7676
with:
77+
ref: v${{ needs.semantic-release.outputs.new_release_version }}
7778
upload-artifacts: true
7879
artifact-retention-days: 1
7980

@@ -86,6 +87,7 @@ jobs:
8687
if: needs.semantic-release.outputs.new_release_published == 'true'
8788
uses: ./.github/workflows/_build-packages.yml
8889
with:
90+
ref: v${{ needs.semantic-release.outputs.new_release_version }}
8991
version: ${{ needs.semantic-release.outputs.new_release_version }}
9092
artifact-retention-days: 1
9193

0 commit comments

Comments
 (0)