@@ -103,6 +103,7 @@ jobs:
103103 working-directory : ${{ env.MCUBOOT_PATH }}/scripts/${{ env.DIST_DIR }}
104104 run : | # we need to create the subdir where to place binaries
105105 mkdir ${{ env.PROJECT_NAME }}_${{ matrix.package_platform }}
106+ chmod +x ./${{ env.PROJECT_NAME }}
106107 mv -v ./${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME }}_${{ matrix.package_platform }}
107108 mv -v ${{ env.IMGTOOL_PACKING_PATH }}/LICENSE.txt ${{ env.PROJECT_NAME }}_${{ matrix.package_platform }}
108109 ${{ matrix.archive_util }} -cz ${{ env.PROJECT_NAME }}_${{ matrix.package_platform }} -f ${{ env.PROJECT_NAME }}_${GITHUB_REF/refs\/tags\//}_${{ matrix.package_platform }}.tar.gz
@@ -118,14 +119,12 @@ jobs:
118119 name : build (${{ matrix.package_platform }})
119120 strategy :
120121 matrix :
121- package_platform : [Linux_32bit, Linux_ARMv6, Linux_ARMv7, Linux_ARM64]
122+ package_platform : [Linux_32bit, Linux_ARMv6, Linux_ARM64]
122123 include :
123124 - package_platform : Linux_32bit
124125 docker_image : i386/python:3.7-buster
125126 - package_platform : Linux_ARMv6
126127 docker_image : arm32v5/python:3.7-buster # buster is not available for arm32v6, but should be backward compatible
127- - package_platform : Linux_ARMv7
128- docker_image : arm32v7/python:3.7-buster
129128 - package_platform : Linux_ARM64
130129 docker_image : arm64v8/python:3.7-buster
131130
@@ -175,6 +174,7 @@ jobs:
175174 working-directory : ${{ env.MCUBOOT_PATH }}/scripts/${{ env.DIST_DIR }}
176175 run : | # we need to create the subdir where to place binaries
177176 sudo mkdir ${{ env.PROJECT_NAME }}_${{ matrix.package_platform }}
177+ sudo chmod +x ./${{ env.PROJECT_NAME }}
178178 sudo mv -v ./${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME }}_${{ matrix.package_platform }}
179179 sudo mv -v ${{ env.IMGTOOL_PACKING_PATH }}/LICENSE.txt ${{ env.PROJECT_NAME }}_${{ matrix.package_platform }}
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
@@ -259,17 +259,58 @@ jobs:
259259 needs : [build, build-crosscompile, notarize-macos]
260260
261261 steps :
262+ - name : Checkout repository # we need package_index.template
263+ uses : actions/checkout@v2
264+
262265 - name : Download artifact
263266 uses : actions/download-artifact@v3
264267 with :
265268 name : ${{ env.ARTIFACT_NAME }}
266269 path : ${{ env.DIST_DIR }}
267270
271+ - name : Identify Prerelease
272+ # This is a workaround while waiting for create-release action
273+ # to implement auto pre-release based on tag
274+ id : prerelease
275+ run : |
276+ wget -q -P /tmp https://github.com/fsaintjacques/semver-tool/archive/3.2.0.zip
277+ unzip -p /tmp/3.2.0.zip semver-tool-3.2.0/src/semver >/tmp/semver && chmod +x /tmp/semver
278+ if [[ "$(/tmp/semver get prerel "${GITHUB_REF/refs\/tags\//}")" ]]; then echo "::set-output name=IS_PRE::true"; fi
279+
280+ - name : Prepare artifacts for the release and handle package_index
281+ run : |
282+ package_index=`cat package_index.template | sed s/%%VERSION%%/${GITHUB_REF/refs\/tags\//}/`
283+ declare -a target_folders=("Windows_32bit" "Windows_64bit" "Linux_64bit" "macOS_64bit" "Linux_32bit" "Linux_ARMv6" "Linux_ARM64")
284+ cd dist
285+ for folder in "${target_folders[@]}"
286+ do
287+ if [[ $folder = "Windows_32bit" || $folder = "Windows_64bit" ]]; then
288+ ARCHIVE_NAME=${{ env.PROJECT_NAME }}_${GITHUB_REF/refs\/tags\//}_${folder}.zip
289+ else
290+ ARCHIVE_NAME=${{ env.PROJECT_NAME }}_${GITHUB_REF/refs\/tags\//}_${folder}.tar.gz
291+ fi
292+ T_OS=`echo ${folder} | awk '{print toupper($0)}'`
293+ SHASUM=`sha256sum ${ARCHIVE_NAME} | cut -f1 -d" "`
294+ SIZE=`stat --printf="%s" ${ARCHIVE_NAME}`
295+ package_index=`echo $package_index |
296+ sed s/%%FILENAME_${T_OS}%%/${ARCHIVE_NAME}/ |
297+ sed s/%%FILENAME_${T_OS}%%/${ARCHIVE_NAME}/ |
298+ sed s/%%SIZE_${T_OS}%%/${SIZE}/ |
299+ sed s/%%SHA_${T_OS}%%/${SHASUM}/`
300+ done
301+ cd ..
302+ echo ================== CUT ME HERE =====================
303+ echo "${package_index}"
304+ echo "${package_index}" > dist/package_index_draft.json
305+
268306 - name : Create Github Release and upload artifacts
269307 uses : ncipollo/release-action@v1
270308 with :
271309 token : ${{ secrets.GITHUB_TOKEN }}
272310 draft : false
311+ prerelease : ${{ steps.prerelease.outputs.IS_PRE }}
312+ # NOTE: "Artifact is a directory" warnings are expected and don't indicate a problem
313+ # (all the files we need are in the DIST_DIR root)
273314 artifacts : ${{ env.DIST_DIR }}/*
274315
275316 - name : Upload release files on Arduino downloads servers
0 commit comments