@@ -329,15 +329,10 @@ jobs:
329
329
done
330
330
331
331
- name : ' 🧹 Remove artifacts'
332
- env :
333
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
334
- ACTIONS_STEP_DEBUG : true
335
- run : |
336
- artifacts=$(gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts --jq '.artifacts[].name')
337
- for name in $artifacts; do
338
- echo "Deleting artifact: $name"
339
- gh api -X DELETE repos/${{ github.repository }}/actions/artifacts/$(gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts --jq ".artifacts[] | select(.name==\"$name\") | .id")
340
- done
332
+ uses : geekyeggo/delete-artifact@v5
333
+ with :
334
+ name : ${{ env.ARTIFACT_NAMES }}
335
+ failOnError : false
341
336
342
337
development-release :
343
338
needs : build
@@ -385,19 +380,34 @@ jobs:
385
380
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
386
381
ACTIONS_STEP_DEBUG : true
387
382
run : |
383
+ # for EXT in zip tar.gz run exe dmg; do
384
+ # gh run download ${{ github.run_id }} -p artifact-*-$EXT
385
+ # gh release upload development artifact-*-$EXT/* --clobber
386
+ # rm -rf artifact-*-$EXT
387
+ # done
388
+ echo "ARTIFACT_NAMES=" >> $GITHUB_ENV
388
389
for EXT in zip tar.gz run exe dmg; do
389
- gh run download ${{ github.run_id }} -p artifact-*-$EXT
390
+ ARTIFACT_PATTERN=artifact-*-$EXT
391
+ echo "Downloading artifacts matching: $ARTIFACT_PATTERN"
392
+ gh run download ${{ github.run_id }} -p "$ARTIFACT_PATTERN"
393
+
394
+ echo "Uploading to release..."
390
395
gh release upload development artifact-*-$EXT/* --clobber
396
+
397
+ for dir in artifact-*-$EXT; do
398
+ echo "Found artifact dir : $dir"
399
+ echo "${dir}" >> artifact_names.txt
400
+ done
401
+
391
402
rm -rf artifact-*-$EXT
392
403
done
393
404
405
+ echo "ARTIFACT_NAMES<<EOF" >> $GITHUB_ENV
406
+ cat artifact_names.txt >> $GITHUB_ENV
407
+ echo "EOF" >> $GITHUB_ENV
408
+
394
409
- name : ' 🧹 Remove artifacts'
395
- env :
396
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
397
- ACTIONS_STEP_DEBUG : true
398
- run : |
399
- artifacts=$(gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts --jq '.artifacts[].name')
400
- for name in $artifacts; do
401
- echo "Deleting artifact: $name"
402
- gh api -X DELETE repos/${{ github.repository }}/actions/artifacts/$(gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts --jq ".artifacts[] | select(.name==\"$name\") | .id")
403
- done
410
+ uses : geekyeggo/delete-artifact@v5
411
+ with :
412
+ name : ${{ env.ARTIFACT_NAMES }}
413
+ failOnError : false
0 commit comments