Skip to content

Commit 20415dd

Browse files
committed
Only build 2 flavors of linux binaries
- glibc (dynamic) - musl (fully static) 'gmp' and 'zlib' are always statically linked.
1 parent 7a147ee commit 20415dd

File tree

1 file changed

+57
-107
lines changed

1 file changed

+57
-107
lines changed

.github/workflows/reusable-release.yml

Lines changed: 57 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ on:
1414
ghc_targets:
1515
type: string
1616
default: "install_bin install_lib update_package_db"
17+
gmp:
18+
type: string
19+
default: 6.3.0
1720
cabal:
1821
type: string
1922
default: 3.14.2.0
@@ -22,6 +25,7 @@ env:
2225
GHC_VERSION: ${{ inputs.ghc }}
2326
GHC_TARGETS: ${{ inputs.ghc_targets }}
2427
CABAL_VERSION: ${{ inputs.cabal }}
28+
GMP_VERSION: ${{ inputs.gmp }}
2529
DEBIAN_FRONTEND: noninteractive
2630
TZ: Asia/Singapore
2731

@@ -60,89 +64,19 @@ jobs:
6064
fail-fast: false
6165
matrix:
6266
branch: ${{ fromJSON(inputs.branches) }}
63-
platform: [ { image: "debian:11"
64-
, installCmd: "apt-get update && apt-get install -y"
65-
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
66-
, DISTRO: "Debian"
67-
, ARTIFACT: "x86_64-linux-deb11"
68-
, ADD_CABAL_ARGS: "--enable-split-sections"
69-
},
70-
{ image: "debian:12"
71-
, installCmd: "apt-get update && apt-get install -y"
72-
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
73-
, DISTRO: "Debian"
74-
, ARTIFACT: "x86_64-linux-deb12"
75-
, ADD_CABAL_ARGS: "--enable-split-sections"
76-
},
77-
{ image: "ubuntu:20.04"
78-
, installCmd: "apt-get update && apt-get install -y"
79-
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
80-
, DISTRO: "Ubuntu"
81-
, ARTIFACT: "x86_64-linux-ubuntu20.04"
82-
, ADD_CABAL_ARGS: "--enable-split-sections"
83-
},
84-
{ image: "ubuntu:22.04"
85-
, installCmd: "apt-get update && apt-get install -y"
86-
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
87-
, DISTRO: "Ubuntu"
88-
, ARTIFACT: "x86_64-linux-ubuntu22.04"
89-
, ADD_CABAL_ARGS: "--enable-split-sections"
90-
},
91-
{ image: "ubuntu:24.04"
92-
, installCmd: "apt-get update && apt-get install -y"
93-
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools_ncurses6 }}"
94-
, DISTRO: "Ubuntu"
95-
, ARTIFACT: "x86_64-linux-ubuntu24.04"
96-
, ADD_CABAL_ARGS: "--enable-split-sections"
97-
},
98-
{ image: "fedora:33"
99-
, installCmd: "dnf install -y"
100-
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
101-
, DISTRO: "Fedora"
102-
, ARTIFACT: "x86_64-linux-fedora33"
103-
, ADD_CABAL_ARGS: "--enable-split-sections"
104-
},
105-
{ image: "fedora:36"
106-
, installCmd: "dnf install -y"
107-
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
108-
, DISTRO: "Fedora"
109-
, ARTIFACT: "x86_64-linux-fedora36"
110-
, ADD_CABAL_ARGS: "--enable-split-sections"
111-
},
112-
{ image: "fedora:38"
113-
, installCmd: "dnf install -y"
114-
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
115-
, DISTRO: "Fedora"
116-
, ARTIFACT: "x86_64-linux-fedora38"
117-
, ADD_CABAL_ARGS: "--enable-split-sections"
118-
},
119-
{ image: "rockylinux:8"
67+
platform: [ { image: "rockylinux:8"
12068
, installCmd: "yum -y install epel-release && yum install -y --allowerasing"
12169
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
122-
, DISTRO: "Unknown"
123-
, ARTIFACT: "x86_64-linux-rocky8"
70+
, DISTRO: "Rockylinux"
71+
, ARTIFACT: "x86_64-linux-glibc"
12472
, ADD_CABAL_ARGS: "--enable-split-sections"
12573
},
12674
{ image: "alpine:3.20"
12775
, installCmd: "apk update && apk add"
12876
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
129-
, DISTRO: "Unknown"
130-
, ARTIFACT: "x86_64-linux-unknown"
77+
, DISTRO: "Alpine"
78+
, ARTIFACT: "x86_64-linux-musl-static"
13179
, ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static"
132-
},
133-
{ image: "alpine:3.12"
134-
, installCmd: "apk update && apk add"
135-
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
136-
, DISTRO: "Unknown"
137-
, ARTIFACT: "x86_64-linux-alpine312"
138-
, ADD_CABAL_ARGS: "--enable-split-sections"
139-
},
140-
{ image: "alpine:3.20"
141-
, installCmd: "apk update && apk add"
142-
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
143-
, DISTRO: "Unknown"
144-
, ARTIFACT: "x86_64-linux-alpine320"
145-
, ADD_CABAL_ARGS: "--enable-split-sections"
14680
}
14781
]
14882
container:
@@ -162,6 +96,15 @@ jobs:
16296
with:
16397
ref: ${{ matrix.branch }}
16498

99+
- if: matrix.platform.DISTRO == 'Rockylinux'
100+
run: |
101+
curl -O -L https://gmplib.org/download/gmp/gmp-${{ env.GMP_VERSION }}.tar.xz
102+
tar xf gmp-${{ env.GMP_VERSION }}.tar.xz
103+
cd gmp-${{ env.GMP_VERSION }}
104+
./configure --prefix=$HOME/.local/ --disable-shared
105+
make install
106+
echo "extra-lib-dirs: $HOME/.local/lib/" >> cabal.release.project.local
107+
165108
- name: Run build
166109
run: |
167110
bash .github/scripts/build.sh
@@ -452,6 +395,7 @@ jobs:
452395
env:
453396
TARBALL_EXT: tar.xz
454397
ARCH: 64
398+
ADD_CABAL_ARGS: ""
455399
strategy:
456400
fail-fast: false
457401
matrix:
@@ -460,85 +404,91 @@ jobs:
460404
, installCmd: "apt-get update && apt-get install -y"
461405
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
462406
, DISTRO: "Debian"
463-
, ARTIFACT: "x86_64-linux-deb11"
464-
, ADD_CABAL_ARGS: "--enable-split-sections"
407+
, ARTIFACT: "x86_64-linux-glibc"
465408
},
466409
{ image: "debian:12"
467410
, installCmd: "apt-get update && apt-get install -y"
468411
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
469412
, DISTRO: "Debian"
470-
, ARTIFACT: "x86_64-linux-deb12"
471-
, ADD_CABAL_ARGS: "--enable-split-sections"
413+
, ARTIFACT: "x86_64-linux-glibc"
472414
},
473415
{ image: "ubuntu:20.04"
474416
, installCmd: "apt-get update && apt-get install -y"
475417
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
476418
, DISTRO: "Ubuntu"
477-
, ARTIFACT: "x86_64-linux-ubuntu20.04"
478-
, ADD_CABAL_ARGS: "--enable-split-sections"
419+
, ARTIFACT: "x86_64-linux-glibc"
479420
},
480421
{ image: "ubuntu:22.04"
481422
, installCmd: "apt-get update && apt-get install -y"
482423
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
483424
, DISTRO: "Ubuntu"
484-
, ARTIFACT: "x86_64-linux-ubuntu22.04"
485-
, ADD_CABAL_ARGS: "--enable-split-sections"
425+
, ARTIFACT: "x86_64-linux-glibc"
486426
},
487427
{ image: "ubuntu:24.04"
488428
, installCmd: "apt-get update && apt-get install -y"
489429
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools_ncurses6 }}"
490430
, DISTRO: "Ubuntu"
491-
, ARTIFACT: "x86_64-linux-ubuntu24.04"
492-
, ADD_CABAL_ARGS: "--enable-split-sections"
431+
, ARTIFACT: "x86_64-linux-glibc"
432+
},
433+
{ image: "linuxmintd/mint20.3-amd64"
434+
, installCmd: "apt-get update && apt-get install -y"
435+
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
436+
, DISTRO: "Mint"
437+
, ARTIFACT: "x86_64-linux-glibc"
438+
},
439+
{ image: "linuxmintd/mint21.3-amd64"
440+
, installCmd: "apt-get update && apt-get install -y"
441+
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
442+
, DISTRO: "Mint"
443+
, ARTIFACT: "x86_64-linux-glibc"
493444
},
494445
{ image: "fedora:33"
495446
, installCmd: "dnf install -y"
496447
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
497448
, DISTRO: "Fedora"
498-
, ARTIFACT: "x86_64-linux-fedora33"
499-
, ADD_CABAL_ARGS: "--enable-split-sections"
449+
, ARTIFACT: "x86_64-linux-glibc"
500450
},
501-
{ image: "fedora:36"
451+
{ image: "fedora:37"
502452
, installCmd: "dnf install -y"
503453
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
504454
, DISTRO: "Fedora"
505-
, ARTIFACT: "x86_64-linux-fedora36"
506-
, ADD_CABAL_ARGS: "--enable-split-sections"
455+
, ARTIFACT: "x86_64-linux-glibc"
507456
},
508-
{ image: "fedora:38"
457+
{ image: "fedora:42"
509458
, installCmd: "dnf install -y"
510459
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
511460
, DISTRO: "Fedora"
512-
, ARTIFACT: "x86_64-linux-fedora38"
513-
, ADD_CABAL_ARGS: "--enable-split-sections"
461+
, ARTIFACT: "x86_64-linux-glibc"
514462
},
515463
{ image: "rockylinux:8"
516464
, installCmd: "yum -y install epel-release && yum install -y --allowerasing"
517465
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
518-
, DISTRO: "Unknown"
519-
, ARTIFACT: "x86_64-linux-rocky8"
520-
, ADD_CABAL_ARGS: "--enable-split-sections"
466+
, DISTRO: "Rockylinux"
467+
, ARTIFACT: "x86_64-linux-glibc"
468+
},
469+
{ image: "rockylinux:9"
470+
, installCmd: "yum -y install epel-release && yum install -y --allowerasing"
471+
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
472+
, DISTRO: "Rockylinux"
473+
, ARTIFACT: "x86_64-linux-glibc"
521474
},
522475
{ image: "alpine:3.20"
523476
, installCmd: "apk update && apk add"
524477
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
525-
, DISTRO: "Unknown"
526-
, ARTIFACT: "x86_64-linux-unknown"
527-
, ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static"
478+
, DISTRO: "Alpine"
479+
, ARTIFACT: "x86_64-linux-musl-static"
528480
},
529481
{ image: "alpine:3.12"
530482
, installCmd: "apk update && apk add"
531483
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
532-
, DISTRO: "Unknown"
533-
, ARTIFACT: "x86_64-linux-alpine312"
534-
, ADD_CABAL_ARGS: "--enable-split-sections"
484+
, DISTRO: "Alpine"
485+
, ARTIFACT: "x86_64-linux-musl-static"
535486
},
536-
{ image: "alpine:3.20"
537-
, installCmd: "apk update && apk add"
538-
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
487+
{ image: "ghcr.io/void-linux/void-glibc:latest"
488+
, installCmd: "xbps-install -Suy xbps && xbps-install -Sy"
489+
, toolRequirements: "${{ needs.tool-output.outputs.xbps_tools }}"
539490
, DISTRO: "Unknown"
540-
, ARTIFACT: "x86_64-linux-alpine320"
541-
, ADD_CABAL_ARGS: "--enable-split-sections"
491+
, ARTIFACT: "x86_64-linux-musl-static"
542492
}
543493
]
544494
container:

0 commit comments

Comments
 (0)