|
35 | 35 | EXISTING_RELEASE: ${{ steps.release_flag.outputs.result }}
|
36 | 36 | steps:
|
37 | 37 | - name: Check for existing release tag
|
38 |
| - uses: mukunku/tag-exists-action@v1.3.0 |
| 38 | + uses: mukunku/tag-exists-action@v1.6.0 |
39 | 39 | id: check_tag
|
40 | 40 | with:
|
41 | 41 | tag: ${{ needs.get_version.outputs.ARK_VERSION }}
|
@@ -174,10 +174,36 @@ jobs:
|
174 | 174 | asset_name: ark-${{ needs.get_version.outputs.ARK_VERSION }}${{ env.DEBUG_FLAG }}-linux-arm64.zip
|
175 | 175 | asset_content_type: application/octet-stream
|
176 | 176 |
|
| 177 | + cleanup: |
| 178 | + name: Clean up Failed Releases |
| 179 | + if: ${{ failure() }} |
| 180 | + runs-on: ubuntu-latest |
| 181 | + needs: [upload_release_binaries, get_version] |
| 182 | + steps: |
| 183 | + # `gh` operates on the git repo |
| 184 | + - name: Checkout sources |
| 185 | + uses: actions/checkout@v4 |
| 186 | + |
| 187 | + - name: Check for existing release tag |
| 188 | + |
| 189 | + id: check_tag |
| 190 | + with: |
| 191 | + tag: ${{ needs.get_version.outputs.ARK_VERSION }} |
| 192 | + |
| 193 | + - name: Delete failed release if any |
| 194 | + if: steps.check_tag.outputs.exists == 'true' |
| 195 | + env: |
| 196 | + GH_TOKEN: ${{ github.token }} |
| 197 | + run: | |
| 198 | + TAG=${{ needs.get_version.outputs.ARK_VERSION }} |
| 199 | + gh release delete $TAG -y --cleanup-tag |
| 200 | +
|
| 201 | + # Keep this at the very end of the workflow tree and without any other |
| 202 | + # steps to ensure we get a Slack report when something failed |
177 | 203 | status:
|
178 | 204 | if: ${{ failure() }}
|
179 | 205 | runs-on: ubuntu-latest
|
180 |
| - needs: [build_macos, build_windows, get_version] |
| 206 | + needs: [cleanup, get_version] |
181 | 207 | steps:
|
182 | 208 | - name: Notify slack if build fails
|
183 | 209 |
|
|
0 commit comments