From e6a266ed3f965fd974a8a6025544ec943fa57c8f Mon Sep 17 00:00:00 2001 From: Lionel Henry Date: Thu, 26 Sep 2024 10:44:14 +0200 Subject: [PATCH] Delete failed releases --- .github/workflows/release.yml | 45 ++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 89500c0e6..6092c61b6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,7 @@ name: "Build Ark Release" on: push: branches: - - main + - feature/release-cleanup workflow_dispatch: jobs: @@ -58,7 +58,10 @@ jobs: # Build ARK for macOS. Both arm64 (Apple Silicon) and x64 (Intel) hosts. build_macos: name: Build macOS - uses: ./.github/workflows/release-macos.yml + # uses: ./.github/workflows/release-macos.yml + steps: + - name: Dummy step + run: echo "" needs: [do_release, get_version] secrets: inherit with: @@ -66,7 +69,10 @@ jobs: build_windows: name: Build Windows - uses: ./.github/workflows/release-windows.yml + # uses: ./.github/workflows/release-windows.yml + steps: + - name: Dummy step + run: echo "" needs: [do_release, get_version] secrets: inherit with: @@ -74,7 +80,10 @@ jobs: build_linux: name: "Build Linux" - uses: ./.github/workflows/release-linux.yml + # uses: ./.github/workflows/release-linux.yml + steps: + - name: Dummy step + run: echo "" needs: [do_release, get_version] secrets: inherit with: @@ -179,15 +188,23 @@ jobs: runs-on: ubuntu-latest needs: [build_macos, build_windows, get_version] steps: - - name: Notify slack if build fails - uses: slackapi/slack-github-action@v1.24.0 - id: slack-failure + # - name: Notify slack if build fails + # uses: slackapi/slack-github-action@v1.24.0 + # id: slack-failure + # with: + # payload: | + # { + # "message": "Positron build ${{ needs.get_version.outputs.ARK_VERSION }} failed", + # "status": "Failure", + # "run_url": "https://github.com/posit-dev/positron/actions/runs/${{ github.run_id }}" + # } + # env: + # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + - name: Delete release with: - payload: | - { - "message": "Positron build ${{ needs.get_version.outputs.ARK_VERSION }} failed", - "status": "Failure", - "run_url": "https://github.com/posit-dev/positron/actions/runs/${{ github.run_id }}" - } + release_name: ${{ needs.get_version.outputs.ARK_VERSION }} + tag_name: ${{ needs.get_version.outputs.ARK_VERSION }} env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + GH_TOKEN: ${{ github.token }} + run: | + gh release delete ${{ tag_name }} -y --cleanup-tag