Skip to content

Commit 1d84640

Browse files
mergify[bot]ulysses4evergeekosaur
authored
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 9949014) * The release cleanup action requires a token (cherry picked from commit ad266b1) --------- Co-authored-by: Artem Pelenitsyn <[email protected]> Co-authored-by: brandon s allbery kf8nh <[email protected]>
1 parent d4cfaa4 commit 1d84640

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

.github/workflows/validate.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,11 @@ jobs:
451451
needs: [validate, validate-old-ghcs, build-alpine, dogfooding]
452452

453453
steps:
454-
# for now this is hardcoded. is there a better way?
454+
- uses: liudonghua123/delete-release-action@v1
455+
with:
456+
release_name: 'cabal-head'
457+
token: ${{ github.token }}
458+
455459
- uses: actions/download-artifact@v4
456460
with:
457461
pattern: cabal-*
@@ -468,15 +472,18 @@ jobs:
468472
name: Create a GitHub LTS prerelease with the binary artifacts
469473
runs-on: ubuntu-latest
470474
# The LTS branch is hardcoded for now, update it on a new LTS!
471-
if: "always() && contains(github.ref, '3.12')"
475+
if: github.ref == 'refs/heads/3.12'
472476
permissions:
473477
contents: write
474478

475479
# IMPORTANT! Any job added to the workflow should be added here too
476480
needs: [validate, validate-old-ghcs, build-alpine, dogfooding]
477481

478482
steps:
479-
- run: echo "|${{ github.ref }}|${{ github.base_ref }}|"
483+
- uses: liudonghua123/delete-release-action@v1
484+
with:
485+
release_name: 'cabal-lts-head'
486+
token: ${{ github.token }}
480487

481488
- uses: actions/download-artifact@v4
482489
with:
@@ -492,12 +499,12 @@ jobs:
492499
mv cabal-{,lts-}Linux-static-x86_64
493500
mv cabal-{,lts-}macOS-x86_64
494501
495-
#- name: Create GitHub prerelease
496-
# uses: softprops/action-gh-release@v2
497-
# with:
498-
# tag_name: cabal-lts-head
499-
# prerelease: true
500-
# files: binaries/cabal-*
502+
- name: Create GitHub prerelease
503+
uses: softprops/action-gh-release@v2
504+
with:
505+
tag_name: cabal-lts-head
506+
prerelease: true
507+
files: binaries/cabal-*
501508

502509
# We use this job as a summary of the workflow
503510
# It will fail if any of the previous jobs does

0 commit comments

Comments
 (0)