From 4a192586fc0c3c3117d8fdd3e6043fb5cacc9b03 Mon Sep 17 00:00:00 2001 From: ezequielnick <107352853+ezequielnick@users.noreply.github.com> Date: Sat, 9 Aug 2025 19:41:18 +0800 Subject: [PATCH] chore: delete old dev assets before build --- .github/workflows/build.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 64ba20a..5404139 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: