Skip to content

Commit

Permalink
only run release deletion once
Browse files Browse the repository at this point in the history
  • Loading branch information
artoonie committed Oct 17, 2024
1 parent e28549f commit 6933ba7
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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-latest
steps:
- uses: dev-drprasad/[email protected]
# 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
Expand Down Expand Up @@ -188,14 +200,6 @@ jobs:
${{ github.workspace }}/${{ steps.checksumsfn.outputs.FILEPATH }}
${{ github.workspace }}/${{ steps.checksumsfn.outputs.FILEPATH }}.sha512
- uses: dev-drprasad/[email protected]
# 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'
Expand Down

0 comments on commit 6933ba7

Please sign in to comment.