Skip to content

Commit bd252d2

Browse files
CI: add automated GitHub prereleases (#8914)
* CI: add automated GitHub prereleases * CI: gzip binary artifacts (ffaf1's review) --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent 9610438 commit bd252d2

File tree

2 files changed

+47
-5
lines changed

2 files changed

+47
-5
lines changed

.github/workflows/validate.yml

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,9 @@ jobs:
136136
# see https://github.com/actions/virtual-environments/issues/2619#issuecomment-788397841
137137
sudo /usr/sbin/purge
138138
fi
139-
tar -cvf cabal-head.tar -C $(dirname "$CABAL_EXEC") $(basename "$CABAL_EXEC")
140-
echo "CABAL_EXEC_TAR=cabal-head.tar" >> $GITHUB_ENV
139+
export CABAL_EXEC_TAR="cabal-head-${{ runner.os }}-x86_64.tar.gz"
140+
tar -czvf $CABAL_EXEC_TAR -C $(dirname "$CABAL_EXEC") $(basename "$CABAL_EXEC")
141+
echo "CABAL_EXEC_TAR=$CABAL_EXEC_TAR" >> $GITHUB_ENV
141142
142143
# We upload the cabal executable built with the ghc used in the release for:
143144
# - Reuse it in the dogfooding job (although we could use the cached build dir)
@@ -146,7 +147,7 @@ jobs:
146147
if: matrix.ghc == env.GHC_FOR_RELEASE
147148
uses: actions/upload-artifact@v3
148149
with:
149-
name: cabal-${{ runner.os }}-${{ matrix.ghc }}
150+
name: cabal-${{ runner.os }}-x86_64
150151
path: ${{ env.CABAL_EXEC_TAR }}
151152

152153
- name: Validate lib-tests
@@ -271,11 +272,11 @@ jobs:
271272
- name: Download cabal executable from workflow artifacts
272273
uses: actions/download-artifact@v3
273274
with:
274-
name: cabal-${{ runner.os }}-${{ matrix.ghc }}
275+
name: cabal-${{ runner.os }}-x86_64
275276
path: cabal-head
276277

277278
- name: Untar the cabal executable
278-
run: tar -xf ./cabal-head/cabal-head.tar -C ./cabal-head
279+
run: tar -xzf ./cabal-head/cabal-head-${{ runner.os }}-x86_64.tar.gz -C cabal-head
279280

280281
- name: print-config using cabal HEAD
281282
run: sh validate.sh ${{ env.COMMON_FLAGS }} --with-cabal ./cabal-head/cabal -s print-config
@@ -285,6 +286,39 @@ jobs:
285286
- name: Build using cabal HEAD
286287
run: sh validate.sh ${{ env.COMMON_FLAGS }} --with-cabal ./cabal-head/cabal -s build
287288

289+
prerelease-head:
290+
name: Create a GitHub prerelease with the binary artifacts
291+
runs-on: ubuntu-latest
292+
if: github.ref == 'refs/heads/master'
293+
294+
# IMPORTANT! Any job added to the workflow should be added here too
295+
needs: [validate, validate-old-ghcs, dogfooding]
296+
297+
steps:
298+
- uses: actions/download-artifact@v2
299+
with:
300+
name: cabal-Windows-x86_64
301+
302+
- uses: actions/download-artifact@v2
303+
with:
304+
name: cabal-Linux-x86_64
305+
306+
- uses: actions/download-artifact@v2
307+
with:
308+
name: cabal-macOS-x86_64
309+
310+
- name: Create GitHub prerelease
311+
uses: "marvinpinto/[email protected]"
312+
with:
313+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
314+
automatic_release_tag: "cabal-head"
315+
prerelease: true
316+
title: "cabal-head"
317+
files: |
318+
cabal-head-Windows-x86_64.tar.gz
319+
cabal-head-Linux-x86_64.tar.gz
320+
cabal-head-macOS-x86_64.tar.gz
321+
288322
# We use this job as a summary of the workflow
289323
# It will fail if any of the previous jobs does it
290324
# This way we can use it exclusively in branch protection rules

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ Ways to get the `cabal-install` binary
3030
2. _[Download from official website](https://www.haskell.org/cabal/download.html)_:
3131
the `cabal-install` binary download for your platform should contain the `cabal` executable.
3232
33+
_Getting unreleased versions of `cabal-install`_: gives you a chance to try out yet-unreleased features.
34+
Currently, we only provide binaries for `x86_64` platforms.
35+
36+
1. _[GitHub preview release built from the tip of the `master branch](https://github.com/haskell/cabal/releases/tag/cabal-head)_:
37+
38+
2. Even more cutting-edge binaries built from pull requests are always available
39+
from the `Validate` worklow page on GitHub at the very bottom of the page.
40+
3341
Ways to build `cabal-install` for everyday use
3442
--------------------------------------------
3543

0 commit comments

Comments
 (0)