File tree Expand file tree Collapse file tree 3 files changed +17
-4
lines changed
Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 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
1519jobs :
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
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments