File tree Expand file tree Collapse file tree 8 files changed +952
-2
lines changed Expand file tree Collapse file tree 8 files changed +952
-2
lines changed Original file line number Diff line number Diff line change
1
+ name : ' Download artifact'
2
+ description : ' Donwload artifacts with normalized names'
3
+ inputs :
4
+ name :
5
+ required : true
6
+ type : string
7
+ path :
8
+ required : true
9
+ type : string
10
+
11
+ runs :
12
+ using : " composite"
13
+ steps :
14
+ - name : Normalise name
15
+ run : |
16
+ name=${{ inputs.name }}
17
+ echo "NAME=${name//\//_}" >> "$GITHUB_ENV"
18
+ shell : bash
19
+
20
+ - name : Download artifact
21
+ uses : actions/download-artifact@v4
22
+ with :
23
+ name : ${{ env.NAME }}
24
+ path : ${{ inputs.path }}
25
+
Original file line number Diff line number Diff line change
1
+ name : ' Upload artifact'
2
+ description : ' Upload artifacts with normalized names'
3
+ inputs :
4
+ if-no-files-found :
5
+ default : ' error'
6
+ type : string
7
+ name :
8
+ required : true
9
+ type : string
10
+ path :
11
+ required : true
12
+ type : string
13
+ retention-days :
14
+ default : 0
15
+ type : number
16
+
17
+ runs :
18
+ using : " composite"
19
+ steps :
20
+ - name : Normalise name
21
+ run : |
22
+ name=${{ inputs.name }}
23
+ echo "NAME=${name//\//_}" >> "$GITHUB_ENV"
24
+ shell : bash
25
+
26
+ - name : Upload artifact
27
+ uses : actions/upload-artifact@v4
28
+ with :
29
+ if-no-files-found : ${{ inputs.if-no-files-found }}
30
+ retention-days : ${{ inputs.retention-days }}
31
+ name : ${{ env.NAME }}
32
+ path : ${{ inputs.path }}
33
+
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -eux
4
+
5
+ uname -a
6
+ uname -p
7
+ uname
8
+ pwd
9
+ env
10
+
11
+ if [ " ${RUNNER_OS} " = Windows ] ; then
12
+ ext=" .exe"
13
+ else
14
+ ext=" "
15
+ fi
16
+
17
+ ghcup --no-verbose install ghc --set --install-targets " ${GHC_TARGETS} " " ${GHC_VERSION} "
18
+
19
+ cabal update
20
+ cabal user-config diff
21
+ cabal user-config init -f
22
+ " ghc-${GHC_VERSION} " --info
23
+ " ghc" --info
24
+
25
+ # shellcheck disable=SC2206
26
+ args=(
27
+ -w " ghc-$GHC_VERSION "
28
+ --disable-profiling
29
+ --enable-executable-stripping
30
+ --project-file=cabal.release.project
31
+ ${ADD_CABAL_ARGS}
32
+ )
33
+
34
+ cabal v2-build " ${args[@]} " cabal-install
35
+
36
+ mkdir -p " out"
37
+ # shellcheck disable=SC2154
38
+ cp " $( cabal list-bin " ${args[@]} " cabal-install:exe:cabal) " " out/cabal$ext "
39
+ cp dist-newstyle/cache/plan.json " out/plan.json"
40
+ cd " out/"
41
+
42
+ # create tarball/zip
43
+ TARBALL_PREFIX=" cabal-install-$( " ./cabal" --numeric-version) "
44
+ case " ${TARBALL_EXT} " in
45
+ zip)
46
+ zip " ${TARBALL_PREFIX} -${ARTIFACT} .${TARBALL_EXT} " " cabal${ext} " plan.json
47
+ ;;
48
+ tar.xz)
49
+ tar caf " ${TARBALL_PREFIX} -${ARTIFACT} .${TARBALL_EXT} " " cabal${ext} " plan.json
50
+ ;;
51
+ * )
52
+ fail " Unknown TARBALL_EXT: ${TARBALL_EXT} "
53
+ ;;
54
+ esac
55
+
56
+ rm " cabal${ext} " plan.json
57
+
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -eux
4
+
5
+ env
6
+ pwd
7
+ ls -lah
8
+
9
+ cd out
10
+ case " ${TARBALL_EXT} " in
11
+ zip)
12
+ unzip ./cabal-install-* -" ${ARTIFACT} .${TARBALL_EXT} "
13
+ ;;
14
+ tar.xz)
15
+ tar xf ./cabal-install-* -" ${ARTIFACT} .${TARBALL_EXT} "
16
+ ;;
17
+ * )
18
+ fail " Unknown TARBALL_EXT: ${TARBALL_EXT} "
19
+ ;;
20
+ esac
21
+ cd ..
22
+
23
+ ghcup --no-verbose install ghc --set --install-targets " ${GHC_TARGETS} " " ${GHC_VERSION} "
24
+
25
+ cabal update
26
+
27
+ # TODO: we want to avoid building here... we should just
28
+ # be using the previously built 'cabal-tests' binary
29
+ cabal run ${ADD_CABAL_ARGS} cabal-testsuite:cabal-tests -- \
30
+ --with-cabal " $( pwd) /out/cabal" \
31
+ --intree-cabal-lib " $( pwd) " \
32
+ --test-tmp " $( pwd) /testdb" \
33
+ --skip-setup-tests \
34
+ -j " $( nproc) "
35
+
Original file line number Diff line number Diff line change
1
+ name : Build and release
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - master
7
+ tags :
8
+ - ' v*'
9
+ - ' cabal-install-*'
10
+ pull_request :
11
+ branches :
12
+ - master
13
+ schedule :
14
+ - cron : ' 0 0 * * *'
15
+
16
+ jobs :
17
+ release-workflow :
18
+ uses : ./.github/workflows/reusable-release.yml
19
+ with :
20
+ branches : ' ["${{ github.ref }}"]'
21
+
22
+ release :
23
+ name : release
24
+ needs : [ "release-workflow" ]
25
+ runs-on : ubuntu-latest
26
+ if : ${{ startsWith(github.ref, 'refs/tags/') }}
27
+ steps :
28
+ - name : Checkout code
29
+ uses : actions/checkout@v4
30
+
31
+ - name : Download artifacts
32
+ uses : actions/download-artifact@v4
33
+ with :
34
+ pattern : artifacts-*
35
+ merge-multiple : true
36
+ path : ./out
37
+
38
+ - name : Install requirements
39
+ run : |
40
+ sudo apt-get update && sudo apt-get install -y tar xz-utils
41
+ shell : bash
42
+
43
+ - name : build sdists
44
+ run : |
45
+ cabal sdist -o out all
46
+ shell : bash
47
+
48
+ - name : Release
49
+ uses : softprops/action-gh-release@v1
50
+ with :
51
+ draft : true
52
+ files : |
53
+ ./out/*
54
+
You can’t perform that action at this time.
0 commit comments