From 1d84640b0e6eb8eb4db92a580bc3a32c5b9d228d Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Sat, 21 Dec 2024 03:48:35 +0000 Subject: [PATCH] Backport #10654: CI: remove cabal-head before updating it (fix #10537) (#10657) * CI: remove cabal{,-lts}-head before updating it (fix #10537) (cherry picked from commit 994901461ef9cd8838741822b65c381978838b2e) * The release cleanup action requires a token (cherry picked from commit ad266b130fe6b0de7620530eb200581120440291) --------- Co-authored-by: Artem Pelenitsyn Co-authored-by: brandon s allbery kf8nh --- .github/workflows/validate.yml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 135889e3f7a..8fb00538f60 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -451,7 +451,11 @@ jobs: needs: [validate, validate-old-ghcs, build-alpine, dogfooding] steps: - # for now this is hardcoded. is there a better way? + - uses: liudonghua123/delete-release-action@v1 + with: + release_name: 'cabal-head' + token: ${{ github.token }} + - uses: actions/download-artifact@v4 with: pattern: cabal-* @@ -468,7 +472,7 @@ jobs: name: Create a GitHub LTS prerelease with the binary artifacts runs-on: ubuntu-latest # The LTS branch is hardcoded for now, update it on a new LTS! - if: "always() && contains(github.ref, '3.12')" + if: github.ref == 'refs/heads/3.12' permissions: contents: write @@ -476,7 +480,10 @@ jobs: needs: [validate, validate-old-ghcs, build-alpine, dogfooding] steps: - - run: echo "|${{ github.ref }}|${{ github.base_ref }}|" + - uses: liudonghua123/delete-release-action@v1 + with: + release_name: 'cabal-lts-head' + token: ${{ github.token }} - uses: actions/download-artifact@v4 with: @@ -492,12 +499,12 @@ jobs: mv cabal-{,lts-}Linux-static-x86_64 mv cabal-{,lts-}macOS-x86_64 - #- name: Create GitHub prerelease - # uses: softprops/action-gh-release@v2 - # with: - # tag_name: cabal-lts-head - # prerelease: true - # files: binaries/cabal-* + - name: Create GitHub prerelease + uses: softprops/action-gh-release@v2 + with: + tag_name: cabal-lts-head + prerelease: true + files: binaries/cabal-* # We use this job as a summary of the workflow # It will fail if any of the previous jobs does