Skip to content

Commit 1f8ba0c

Browse files
committed
CI fixes
1 parent e1858b2 commit 1f8ba0c

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

.github/workflows/build-rust.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,21 @@ on:
88
required: true
99
type: string
1010
artifact-name:
11-
description: "Name for the uploaded artifact"
11+
description: "Base name for the uploaded artifact"
1212
required: true
1313
type: string
14+
outputs:
15+
artifact-name:
16+
description: "The actual artifact name with hash suffix"
17+
value: ${{ jobs.build.outputs.artifact-name }}
1418

1519
jobs:
1620
build:
1721
name: Build Rust Artifacts
1822
runs-on: ubuntu-latest
1923
timeout-minutes: 15
24+
outputs:
25+
artifact-name: ${{ inputs.artifact-name }}-${{ steps.source-hash.outputs.hash }}
2026
steps:
2127
- uses: actions/checkout@v4
2228

@@ -26,13 +32,20 @@ jobs:
2632
with:
2733
shared-key: ${{ inputs.cache-key }}
2834

35+
- name: Calculate source files hash
36+
id: source-hash
37+
run: |
38+
SOURCE_HASH=$(find crates tests Cargo.toml Cargo.lock Makefile makefiles -type f \( -name "*.rs" -o -name "*.toml" -o -name "Makefile" \) -exec sha256sum {} \; | sort | sha256sum | cut -d' ' -f1 | head -c 8)
39+
echo "hash=$SOURCE_HASH" >> $GITHUB_OUTPUT
40+
echo "Source files hash: $SOURCE_HASH"
41+
2942
- name: Build workspace
3043
run: make build
3144

3245
- name: Upload build artifacts
3346
uses: actions/upload-artifact@v4
3447
with:
35-
name: ${{ inputs.artifact-name }}
48+
name: ${{ inputs.artifact-name }}-${{ steps.source-hash.outputs.hash }}
3649
path: |
3750
target/debug/kora
3851
target/debug/test_runner

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
- name: Download build artifacts
5959
uses: actions/download-artifact@v4
6060
with:
61-
name: rust-binaries
61+
name: ${{ needs.build.outputs.artifact-name }}
6262
path: target/debug/
6363

6464
- name: Make binaries executable

.github/workflows/typescript-integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
- name: Download build artifacts
6767
uses: actions/download-artifact@v4
6868
with:
69-
name: rust-binaries-ts
69+
name: ${{ needs.build.outputs.artifact-name }}
7070
path: target/debug/
7171

7272
- name: Make binaries executable

0 commit comments

Comments
 (0)