From f610bba4f147da0309b52aa7bc0af7a8db37080a Mon Sep 17 00:00:00 2001 From: Armin Samii Date: Thu, 17 Oct 2024 16:58:35 -0400 Subject: [PATCH] only run release deletion once --- .github/workflows/release.yml | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b687c753..3997eef6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,15 +6,27 @@ on: schedule: - cron: '0 12 1,15 * *' # On the 1st and 15th of the month at noon workflow_dispatch: -## To test this workflow without creating a release, uncomment the following and add a branch name (making sure "push" -## is at the same indent level as "release": -# push: -# branches: -# - 'branch-name' +# To test this workflow without creating a release, uncomment the following and add a branch name (making sure "push" +# is at the same indent level as "release": + push: + branches: + - 'feature/fix-release-deletion' jobs: + deleteRelease: + runs-on: ubuntu + steps: + - uses: dev-drprasad/delete-tag-and-release@v1.1 + # Note: to update the date of the release, it must be deleted and then recreated + if: github.event_name == 'release' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' + with: + tag_name: build-${{ github.ref_name }} + delete_release: true + github_token: ${{ secrets.GITHUB_TOKEN }} + release: runs-on: ${{ matrix.os }} + needs: deleteRelease strategy: matrix: os: [ ubuntu-latest, windows-latest, macos-13, macos-latest ] # -13 is intel; -latest is ARM @@ -188,14 +200,6 @@ jobs: ${{ github.workspace }}/${{ steps.checksumsfn.outputs.FILEPATH }} ${{ github.workspace }}/${{ steps.checksumsfn.outputs.FILEPATH }}.sha512 - - uses: dev-drprasad/delete-tag-and-release@v1.1 - # Note: to update the date of the release, it must be deleted and then recreated - if: github.event_name == 'release' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' - with: - tag_name: build-${{ github.ref_name }} - delete_release: true - github_token: ${{ secrets.GITHUB_TOKEN }} - - name: "Upload binaries to release" uses: svenstaro/upload-release-action@v2 if: github.event_name == 'release' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'