44 # The name of the project
55 PROJECT_NAME : imgtool
66 DIST_DIR : dist
7- ARTIFACT_NAME : dist
7+ ARTIFACT_PREFIX : dist-
88 # The project's folder on Arduino's download server for uploading builds
99 AWS_PLUGIN_TARGET : /tools/
1010 # See: https://github.com/actions/setup-python/tree/main#available-versions-of-python
3939 defaults :
4040 run :
4141 shell : bash
42-
42+
4343 runs-on : ${{ matrix.os }}
4444
4545 steps :
5454 uses : actions/checkout@v4
5555 with :
5656 path : ${{ env.IMGTOOL_PACKING_PATH }}
57-
57+
5858 - name : Set the version
5959 working-directory : ${{ env.IMGTOOL_PACKING_PATH }}/patches/
6060 run : perl -pi -e "s/ARDUINO_VERSION_PLACEHOLDER/${GITHUB_REF/refs\/tags\//}/g" 0008-Imgtool-Append-arduino-to-version-string.patch
9797 mv -v ./${{ env.PROJECT_NAME }}.exe ${{ env.PROJECT_NAME }}_${{ matrix.package_platform }}
9898 mv -v "${{ env.IMGTOOL_PACKING_PATH }}/LICENSE.txt" ${{ env.PROJECT_NAME }}_${{ matrix.package_platform }}
9999 7z a ${{ env.PROJECT_NAME }}_${GITHUB_REF/refs\/tags\//}_${{ matrix.package_platform }}.zip ${{ env.PROJECT_NAME }}_${{ matrix.package_platform }}
100-
100+
101101 - name : Package
102102 if : runner.os != 'Windows'
103103 working-directory : ${{ env.MCUBOOT_PATH }}/scripts/${{ env.DIST_DIR }}
@@ -109,10 +109,10 @@ jobs:
109109 ${{ matrix.archive_util }} -cz ${{ env.PROJECT_NAME }}_${{ matrix.package_platform }} -f ${{ env.PROJECT_NAME }}_${GITHUB_REF/refs\/tags\//}_${{ matrix.package_platform }}.tar.gz
110110
111111 - name : Upload artifacts
112- uses : actions/upload-artifact@v3
112+ uses : actions/upload-artifact@v4
113113 with :
114114 if-no-files-found : error
115- name : ${{ env.ARTIFACT_NAME }}
115+ name : ${{ env.ARTIFACT_PREFIX }}${{ matrix.package_platform }}
116116 path : ${{ env.MCUBOOT_PATH }}/scripts/dist/${{ env.PROJECT_NAME }}_*
117117
118118 build-crosscompile :
@@ -155,7 +155,7 @@ jobs:
155155 with :
156156 image : tonistiigi/binfmt:latest
157157 platforms : all
158-
158+
159159 - name : Copy build script
160160 working-directory : ${{ env.IMGTOOL_PACKING_PATH }}
161161 run : cp build.sh ${{ env.MCUBOOT_PATH }}/scripts/imgtool/
@@ -180,26 +180,34 @@ jobs:
180180 sudo tar -cz ${{ env.PROJECT_NAME }}_${{ matrix.package_platform }} -f ${{ env.PROJECT_NAME }}_${GITHUB_REF/refs\/tags\//}_${{ matrix.package_platform }}.tar.gz #dist dir is created in the container with different user/grp
181181
182182 - name : Upload artifacts
183- uses : actions/upload-artifact@v3
183+ uses : actions/upload-artifact@v4
184184 with :
185185 if-no-files-found : error
186- name : ${{ env.ARTIFACT_NAME }}
186+ name : ${{ env.ARTIFACT_PREFIX }}${{ matrix.package_platform }}
187187 path : ${{ env.MCUBOOT_PATH }}/scripts/dist/${{ env.PROJECT_NAME }}_*
188188
189189 notarize-macos :
190190 runs-on : macos-latest
191191 needs : build
192192
193+ env :
194+ ARTIFACT_SUFFIX : macOS_64bit
195+
193196 steps :
194197 - name : Checkout repository
195198 uses : actions/checkout@v4
196199
197- - name : Download artifacts
198- uses : actions/download-artifact@v3
200+ - name : Download non-notarized artifact
201+ uses : actions/download-artifact@v4
199202 with :
200- name : ${{ env.ARTIFACT_NAME }}
203+ name : ${{ env.ARTIFACT_PREFIX }}${{ env.ARTIFACT_SUFFIX }}
201204 path : ${{ env.DIST_DIR }}
202205
206+ - name : Remove non-notarized artifact
207+ uses : geekyeggo/delete-artifact@v5
208+ with :
209+ name : ${{ env.ARTIFACT_PREFIX }}${{ env.ARTIFACT_SUFFIX }}
210+
203211 - name : Import Code-Signing Certificates
204212 env :
205213 KEYCHAIN : " sign.keychain"
@@ -248,13 +256,13 @@ jobs:
248256 PACKAGE_FILENAME="${{ env.PROJECT_NAME }}_${TAG}_macOS_64bit.tar.gz"
249257 tar -czvf "${PACKAGE_FILENAME}" "${{ env.PROJECT_NAME }}_macOS_64bit"
250258
251- - name : Upload artifacts
252- uses : actions/upload-artifact@v3
259+ - name : Upload notarized artifact
260+ uses : actions/upload-artifact@v4
253261 with :
254262 if-no-files-found : error
255- name : ${{ env.ARTIFACT_NAME }}
263+ name : ${{ env.ARTIFACT_PREFIX }}${{ env.ARTIFACT_SUFFIX }}
256264 path : ${{ env.DIST_DIR }}
257-
265+
258266 create-release :
259267 runs-on : ubuntu-latest
260268 needs : [build, build-crosscompile, notarize-macos]
@@ -264,10 +272,11 @@ jobs:
264272 uses : actions/checkout@v4
265273
266274 - name : Download artifact
267- uses : actions/download-artifact@v3
275+ uses : actions/download-artifact@v4
268276 with :
269- name : ${{ env.ARTIFACT_NAME }}
277+ merge-multiple : true
270278 path : ${{ env.DIST_DIR }}
279+ pattern : ${{ env.ARTIFACT_PREFIX }}*
271280
272281 - name : Identify Prerelease
273282 # This is a workaround while waiting for create-release action
@@ -303,7 +312,7 @@ jobs:
303312 echo ================== CUT ME HERE =====================
304313 echo "${package_index}"
305314 echo "${package_index}" > dist/package_index_draft.json
306-
315+
307316 - name : Create Github Release and upload artifacts
308317 uses : ncipollo/release-action@v1
309318 with :
0 commit comments