Skip to content

Commit 900b11a

Browse files
authored
Merge pull request #31 from bordeux/fix/fix-workflow-version-app
Fix/fix workflow version app
2 parents 21c3290 + 588a834 commit 900b11a

5 files changed

Lines changed: 30 additions & 1 deletion

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

.husky/pre-commit

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,14 @@ if [ -f .git/MERGE_HEAD ]; then
77
exit 0
88
fi
99

10-
# Run QA checks for regular commits
10+
# Check if any Rust files are staged for commit
11+
RUST_FILES=$(git diff --cached --name-only --diff-filter=ACMR | grep -E '\.(rs)$|^Cargo\.(toml|lock)$' || true)
12+
13+
if [ -z "$RUST_FILES" ]; then
14+
echo "No Rust files changed, skipping cargo make qa"
15+
exit 0
16+
fi
17+
18+
# Run QA checks for commits with Rust changes
19+
echo "Rust files changed, running cargo make qa..."
1120
cargo make qa

0 commit comments

Comments
 (0)