Skip to content

Commit

Permalink
Clean up failed releases (#546)
Browse files Browse the repository at this point in the history
  • Loading branch information
lionel- authored Sep 26, 2024
1 parent 1c7a78f commit 7e957a2
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
EXISTING_RELEASE: ${{ steps.release_flag.outputs.result }}
steps:
- name: Check for existing release tag
uses: mukunku/tag-exists-action@v1.3.0
uses: mukunku/tag-exists-action@v1.6.0
id: check_tag
with:
tag: ${{ needs.get_version.outputs.ARK_VERSION }}
Expand Down Expand Up @@ -174,10 +174,36 @@ jobs:
asset_name: ark-${{ needs.get_version.outputs.ARK_VERSION }}${{ env.DEBUG_FLAG }}-linux-arm64.zip
asset_content_type: application/octet-stream

cleanup:
name: Clean up Failed Releases
if: ${{ failure() }}
runs-on: ubuntu-latest
needs: [upload_release_binaries, get_version]
steps:
# `gh` operates on the git repo
- name: Checkout sources
uses: actions/checkout@v4

- name: Check for existing release tag
uses: mukunku/[email protected]
id: check_tag
with:
tag: ${{ needs.get_version.outputs.ARK_VERSION }}

- name: Delete failed release if any
if: steps.check_tag.outputs.exists == 'true'
env:
GH_TOKEN: ${{ github.token }}
run: |
TAG=${{ needs.get_version.outputs.ARK_VERSION }}
gh release delete $TAG -y --cleanup-tag
# Keep this at the very end of the workflow tree and without any other
# steps to ensure we get a Slack report when something failed
status:
if: ${{ failure() }}
runs-on: ubuntu-latest
needs: [build_macos, build_windows, get_version]
needs: [cleanup, get_version]
steps:
- name: Notify slack if build fails
uses: slackapi/[email protected]
Expand Down

0 comments on commit 7e957a2

Please sign in to comment.