chore: delete old dev assets before build

This commit is contained in:
ezequielnick 2025-08-09 19:41:18 +08:00
parent 6172cadca8
commit 4a192586fc

View File

@ -12,7 +12,23 @@ on:
permissions: write-all
jobs:
cleanup-dev-release:
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Delete Dev Release Assets
continue-on-error: true
run: |
# Delete the entire dev release to clean up old assets
curl -X DELETE -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/releases/tags/dev" || true
# Delete the dev tag
curl -X DELETE -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/git/refs/tags/dev" || true
windows:
needs: [cleanup-dev-release]
if: always() && (startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch')
strategy:
fail-fast: false
matrix:
@ -81,6 +97,8 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
windows7:
needs: [cleanup-dev-release]
if: always() && (startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch')
strategy:
fail-fast: false
matrix:
@ -150,6 +168,8 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
linux:
needs: [cleanup-dev-release]
if: always() && (startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch')
strategy:
fail-fast: false
matrix:
@ -212,6 +232,8 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
macos:
needs: [cleanup-dev-release]
if: always() && (startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch')
strategy:
fail-fast: false
matrix:
@ -296,6 +318,8 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
macos10:
needs: [cleanup-dev-release]
if: always() && (startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch')
strategy:
fail-fast: false
matrix: