Skip to content

Commit 3349dd0

Browse files
committed
workflows: update for new version of upload-artifact action
The new version of upload artifact disallows repeat upload to the same directory. Instead, artifacts should be uploaded using unique names, then gathered into a single archive using the merge and pattern parameters. - Split board name into its own step - Use board name for build, artifact names, and upload archive name Signed-off-by: Mike Szczys <mike@golioth.io>
1 parent 13a1db9 commit 3349dd0

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

.github/workflows/build_zephyr.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@ jobs:
4949
uses: actions/checkout@v4
5050
with:
5151
path: app
52+
53+
- name: Process Board name
54+
id: nicename
55+
shell: bash
56+
run: |
57+
BOARD_NICENAME=${{ inputs.BOARD }}
58+
BOARD_NICENAME=${BOARD_NICENAME//\//_}
59+
echo "BOARD_NICENAME=${BOARD_NICENAME}" >> $GITHUB_OUTPUT
60+
5261
- name: Setup West workspace
5362
run: |
5463
west init -l app
@@ -71,15 +80,15 @@ jobs:
7180
mkdir -p artifacts
7281
BOARD_NICENAME=${{ inputs.BOARD }}
7382
BOARD_NICENAME=${BOARD_NICENAME//\//_}
74-
mv merged.hex ./artifacts/golioth-${{ github.event.repository.name }}_${{ inputs.TAG }}_${BOARD_NICENAME}_full.hex
75-
mv app/zephyr/zephyr.signed.bin ./artifacts/golioth-${{ github.event.repository.name }}_${{ inputs.TAG }}_${BOARD_NICENAME}_update.bin
76-
mv app/zephyr/zephyr.elf ./artifacts/golioth-${{ github.event.repository.name }}_${{ inputs.TAG }}_${BOARD_NICENAME}.elf
83+
mv merged.hex ./artifacts/ac_power_monitor_${{ inputs.TAG }}_${BOARD_NICENAME}_full.hex
84+
mv app/zephyr/zephyr.signed.bin ./artifacts/ac_power_monitor_${{ inputs.TAG }}_${BOARD_NICENAME}_update.bin
85+
mv app/zephyr/zephyr.elf ./artifacts/ac_power_monitor_${{ inputs.TAG }}_${BOARD_NICENAME}.elf
7786
7887
# Run IDs are unique per repo but are reused on re-runs
7988
- name: Save artifact
8089
if: inputs.ARTIFACT == true
81-
uses: actions/upload-artifact@v3
90+
uses: actions/upload-artifact@v4
8291
with:
83-
name: build_artifacts_${{ github.run_id }}
92+
name: build_artifacts_${{ github.run_id }}_${{ steps.nicename.outputs.BOARD_NICENAME }}
8493
path: |
8594
build/artifacts/*

.github/workflows/release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@ jobs:
3636
uses: actions/checkout@v4
3737

3838
- name: Download artifact
39-
uses: actions/download-artifact@v3
39+
uses: actions/download-artifact@v4
4040
with:
41-
name: build_artifacts_${{ github.run_id }}
41+
pattern: build_artifacts_*
4242
path: ~/artifacts
43+
merge_multiple: true
4344

4445
- name: Create Release manually with GH CLI
4546
run: gh release create --title ${{ inputs.version }} --draft ${{ inputs.version }}

0 commit comments

Comments
 (0)