Merge pull request #6 from jhbruhn/delete-release-artifacts-before-upload

fix: Delete release artifacts before upload to prevent duplicates
This commit is contained in:
Jan-Henrik Bruhn 2025-12-13 14:10:02 +01:00 committed by GitHub
commit d3655c4565
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -99,6 +99,13 @@ jobs:
with: with:
path: artifacts path: artifacts
- name: Delete existing release artifacts
run: |
gh release view ${{ needs.draft-release.outputs.tag-name }} --json assets --jq '.assets[].name' | \
xargs -I {} gh release delete-asset ${{ needs.draft-release.outputs.tag-name }} {} --yes || true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload all assets to release - name: Upload all assets to release
run: | run: |
find artifacts -type f -exec gh release upload ${{ needs.draft-release.outputs.tag-name }} {} --clobber \; find artifacts -type f -exec gh release upload ${{ needs.draft-release.outputs.tag-name }} {} --clobber \;