@@ -265,9 +265,83 @@ jobs:
265265 run : |
266266 gh release upload ${{ steps.prep.outputs.version }} testcafe-macos-amd64.zip
267267
268+ release-macos-arm-bundle :
269+ runs-on : macos-latest
270+ needs : [create-release-draft]
271+ steps :
272+ - name : Find matching draft tag
273+ # Fetches the `asset_id` of the uploaded bundle. A non-empty `asset_id` signals a successful upload, preventing duplicate uploads in retry attempts.
274+ id : prep
275+ run : |
276+ VERSION=$(curl -s -H "Authorization: token ${{ github.token }}" \
277+ https://api.github.com/repos/${{ github.repository }}/releases | \
278+ jq -r "[.[] | select(.draft == true) | select(.body | contains(\"- jobId: ${{ github.run_id }}\\n\"))] | first | .tag_name")
279+ RELEASE_ID=$(curl -s -H "Authorization: token ${{ github.token }}" \
280+ https://api.github.com/repos/${{ github.repository }}/releases | \
281+ jq -r "[.[] | select(.draft == true) | select(.body | contains(\"- jobId: ${{ github.run_id }}\\n\"))] | first | .id")
282+
283+ if [ "${VERSION}" = "" ];then
284+ echo "No draft version found"
285+ exit 1
286+ fi
287+
288+ ASSET_ID=$(curl -s -H "Authorization: token ${{ github.token }}" \
289+ https://api.github.com/repos/${{ github.repository }}/releases | \
290+ jq -r "[.[] | select(.body | contains(\"- jobId: ${{ github.run_id }}\\n\"))] | first | .assets | .[] | select(.name == \"testcafe-macos-arm64.zip\") | .id | select(. != null)")
291+
292+ echo "version=${VERSION}" >> $GITHUB_OUTPUT
293+ echo "release_id=${RELEASE_ID}" >> $GITHUB_OUTPUT
294+ echo "asset_id=${ASSET_ID}" >> $GITHUB_OUTPUT
295+
296+ - run : echo "${{ steps.prep.outputs.release_id }} - ${{ steps.prep.outputs.version }} - ${{ steps.prep.outputs.asset_id }}"
297+
298+ - name : Checkout
299+ uses : actions/checkout@v4
300+ if : ${{ steps.prep.outputs.asset_id == '' }}
301+ with :
302+ ref : ${{ steps.prep.outputs.version }}
303+
304+ - name : Setup Node
305+ if : ${{ steps.prep.outputs.asset_id == '' }}
306+ uses : actions/setup-node@v4
307+ with :
308+ node-version-file : " .nvmrc"
309+ cache : " npm"
310+
311+ - name : Update Release version
312+ if : ${{ steps.prep.outputs.asset_id == '' }}
313+ run : |
314+ npm version --no-git-tag-version ${{ steps.prep.outputs.version }}
315+
316+ - name : Install Dependencies
317+ run : npm ci --production
318+ env :
319+ HUSKY : 0
320+ if : ${{ steps.prep.outputs.asset_id == '' }}
321+
322+ - name : Bundle Directory
323+ if : ${{ steps.prep.outputs.asset_id == '' }}
324+ run : bash ./scripts/bundle.sh
325+
326+ - name : List Bundle Contents
327+ if : ${{ steps.prep.outputs.asset_id == '' }}
328+ run : ls -R bundle/
329+
330+ - name : Archive Bundle
331+ if : ${{ steps.prep.outputs.asset_id == '' }}
332+ run : zip -r testcafe-macos-arm64.zip bundle/
333+
334+ - name : Upload Release Asset
335+ if : ${{ steps.prep.outputs.asset_id == '' }}
336+ env :
337+ GITHUB_TOKEN : ${{ github.token }}
338+ run : |
339+ gh release upload ${{ steps.prep.outputs.version }} testcafe-macos-arm64.zip
340+
341+
268342 publish-release :
269343 runs-on : ubuntu-latest
270- needs : [release-windows-bundle, release-macos-bundle]
344+ needs : [release-windows-bundle, release-macos-bundle, release-macos-arm-bundle ]
271345 steps :
272346 - name : Find Matching Draft Tag
273347 id : prep
0 commit comments