Skip to content

Commit

Permalink
Backport haskell#10654: CI: remove cabal-head before updating it (fix h…
Browse files Browse the repository at this point in the history
…askell#10537) (haskell#10657)

* CI: remove cabal{,-lts}-head before updating it (fix haskell#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]>
  • Loading branch information
3 people authored Dec 21, 2024
1 parent d4cfaa4 commit 1d84640
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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-*
Expand All @@ -468,15 +472,18 @@ 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

# IMPORTANT! Any job added to the workflow should be added here too
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:
Expand All @@ -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
Expand Down

0 comments on commit 1d84640

Please sign in to comment.