-
Notifications
You must be signed in to change notification settings - Fork 697
401 lines (369 loc) · 16.2 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
name: Build and release
on:
# pull_request temporary
pull_request:
push:
tags:
- '*'
jobs:
build-linux:
name: Build linux binaries
runs-on: ubuntu-latest
env:
TARBALL_EXT: tar.xz
ARCH: 64
DEBIAN_FRONTEND: noninteractive
TZ: Asia/Singapore
GHC_VERSION: 9.2.3
strategy:
fail-fast: false
matrix:
platform: [ { image: "debian:9"
, installCmd: "sed -i s/deb.debian.org/archive.debian.org/g /etc/apt/sources.list && sed -i 's|security.debian.org|archive.debian.org/|g' /etc/apt/sources.list && sed -i /-updates/d /etc/apt/sources.list && apt-get update && apt-get install -y"
, toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf"
, DISTRO: "Debian"
, ARTIFACT: "x86_64-linux-deb9"
, ADD_CABAL_ARGS: "--enable-split-sections"
},
{ image: "debian:10"
, installCmd: "apt-get update && apt-get install -y"
, toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf"
, DISTRO: "Debian"
, ARTIFACT: "x86_64-linux-deb10"
, ADD_CABAL_ARGS: "--enable-split-sections"
},
{ image: "debian:11"
, installCmd: "apt-get update && apt-get install -y"
, toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf"
, DISTRO: "Debian"
, ARTIFACT: "x86_64-linux-deb11"
, ADD_CABAL_ARGS: "--enable-split-sections"
},
{ image: "ubuntu:18.04"
, installCmd: "apt-get update && apt-get install -y"
, toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf"
, DISTRO: "Ubuntu"
, ARTIFACT: "x86_64-linux-ubuntu18.04"
, ADD_CABAL_ARGS: "--enable-split-sections"
},
{ image: "ubuntu:20.04"
, installCmd: "apt-get update && apt-get install -y"
, toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf"
, DISTRO: "Ubuntu"
, ARTIFACT: "x86_64-linux-ubuntu20.04"
, ADD_CABAL_ARGS: "--enable-split-sections"
},
{ image: "ubuntu:22.04"
, installCmd: "apt-get update && apt-get install -y"
, toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf"
, DISTRO: "Ubuntu"
, ARTIFACT: "x86_64-linux-ubuntu22.04"
, ADD_CABAL_ARGS: "--enable-split-sections"
},
{ image: "linuxmintd/mint19.3-amd64"
, installCmd: "apt-get update && apt-get install -y"
, toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf"
, DISTRO: "Mint"
, ARTIFACT: "x86_64-linux-mint19.3"
, ADD_CABAL_ARGS: "--enable-split-sections"
},
{ image: "linuxmintd/mint20.2-amd64"
, installCmd: "apt-get update && apt-get install -y"
, toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf"
, DISTRO: "Mint"
, ARTIFACT: "x86_64-linux-mint20.2"
, ADD_CABAL_ARGS: "--enable-split-sections"
},
{ image: "fedora:27"
, installCmd: "dnf install -y"
, toolRequirements: "autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils-libs findutils gcc gcc-c++ git gmp gmp-devel jq lbzip2 make ncurses ncurses-compat-libs ncurses-devel openssh-clients patch perl pxz python3 sqlite sudo wget which xz zlib-devel patchelf"
, DISTRO: "Fedora"
, ARTIFACT: "x86_64-linux-fedora27"
, ADD_CABAL_ARGS: "--enable-split-sections"
},
{ image: "fedora:33"
, installCmd: "dnf install -y"
, toolRequirements: "autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils-libs findutils gcc gcc-c++ git gmp gmp-devel jq lbzip2 make ncurses ncurses-compat-libs ncurses-devel openssh-clients patch perl pxz python3 sqlite sudo wget which xz zlib-devel patchelf"
, DISTRO: "Fedora"
, ARTIFACT: "x86_64-linux-fedora33"
, ADD_CABAL_ARGS: "--enable-split-sections"
},
{ image: "centos:7"
, installCmd: "yum -y install epel-release && yum install -y"
, toolRequirements: "autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils-libs findutils gcc gcc-c++ git gmp gmp-devel jq lbzip2 make ncurses ncurses-compat-libs ncurses-devel openssh-clients patch perl pxz python3 sqlite sudo wget which xz zlib-devel patchelf"
, DISTRO: "CentOS"
, ARTIFACT: "x86_64-linux-centos7"
, ADD_CABAL_ARGS: "--enable-split-sections"
},
{ image: "rockylinux:8"
, installCmd: "yum -y install epel-release && yum install -y --allowerasing"
, toolRequirements: "autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils-libs findutils gcc gcc-c++ git gmp gmp-devel jq lbzip2 make ncurses ncurses-compat-libs ncurses-devel openssh-clients patch perl pxz python3 sqlite sudo wget which xz zlib-devel patchelf"
, DISTRO: "Unknown"
, ARTIFACT: "x86_64-linux-rocky8"
, ADD_CABAL_ARGS: "--enable-split-sections"
},
{ image: "alpine:latest"
, installCmd: "apk update && apk add"
, toolRequirements: "binutils-gold curl gcc g++ gmp-dev libc-dev libffi-dev make musl-dev ncurses-dev perl tar xz autoconf automake bzip2 coreutils elfutils-dev findutils git jq bzip2-dev patch python3 sqlite sudo wget which zlib-dev patchelf zlib zlib-dev zlib-static"
, DISTRO: "Unknown"
, ARTIFACT: "x86_64-linux-unknown"
, ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static"
}
]
container:
image: ${{ matrix.platform.image }}
steps:
- name: Install requirements
shell: sh
run: |
${{ matrix.platform.installCmd }} curl bash git ${{ matrix.platform.toolRequirements }}
- uses: actions/checkout@v3
- name: Run build
run: |
bash .github/scripts/build.sh
tar cf out-${ARTIFACT}.tar out/
env:
ARTIFACT: ${{ matrix.platform.ARTIFACT }}
DISTRO: ${{ matrix.platform.DISTRO }}
ADD_CABAL_ARGS: ${{ matrix.platform.ADD_CABAL_ARGS }}
- if: always()
name: Upload artifact
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
retention-days: 2
name: artifacts-${{ matrix.platform.ARTIFACT }}
path: |
./out-${{ matrix.platform.ARTIFACT }}.tar
build-arm:
name: Build ARM binary
runs-on: [self-hosted, Linux, ARM64]
env:
TARBALL_EXT: tar.xz
ADD_CABAL_ARGS: ""
DEBIAN_FRONTEND: noninteractive
TZ: Asia/Singapore
ARTIFACT: "aarch64-linux-ubuntu20"
ARCH: ARM64
DISTRO: Ubuntu
GHC_VERSION: 9.4.8
steps:
- uses: docker://arm64v8/ubuntu:focal
name: Cleanup (aarch64 linux)
with:
args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +"
- name: git config
run: |
git config --global --get-all safe.directory | grep '^\*$' || git config --global --add safe.directory "*"
shell: bash
- name: Checkout code
uses: actions/checkout@v3
- uses: docker://hasufell/arm64v8-ubuntu-haskell:focal
name: Run build (aarch64 linux)
with:
args: bash .github/scripts/build.sh
- uses: docker://hasufell/arm64v8-ubuntu-haskell:focal
name: Run build (aarch64 linux)
with:
args: bash .github/scripts/tar.sh
- if: always()
name: Upload artifact
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
retention-days: 2
name: artifacts-arm
path: |
./out-${{ env.ARTIFACT }}.tar
build-mac-x86_64:
name: Build binary (Mac x86_64)
runs-on: macOS-11
env:
MACOSX_DEPLOYMENT_TARGET: 10.13
ADD_CABAL_ARGS: ""
ARTIFACT: "x86_64-apple-darwin"
ARCH: 64
TARBALL_EXT: tar.xz
DISTRO: na
GHC_VERSION: 9.4.8
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Run build
run: |
brew install coreutils tree
bash .github/scripts/build.sh
tar cf out-${ARTIFACT}.tar out/
- if: always()
name: Upload artifact
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
retention-days: 2
name: artifacts-mac-x86_64
path: |
./out-${{ env.ARTIFACT }}.tar
build-mac-aarch64:
name: Build binary (Mac aarch64)
runs-on: [self-hosted, macOS, ARM64]
env:
MACOSX_DEPLOYMENT_TARGET: 10.13
ADD_CABAL_ARGS: ""
ARTIFACT: "aarch64-apple-darwin"
ARCH: ARM64
TARBALL_EXT: tar.xz
DISTRO: na
HOMEBREW_CHANGE_ARCH_TO_ARM: 1
GHC_VERSION: 9.4.8
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Run build
run: |
bash .github/scripts/brew.sh git coreutils autoconf automake tree
export PATH="$HOME/.brew/bin:$HOME/.brew/sbin:$PATH"
export LD=ld
bash .github/scripts/build.sh
tar cf out-${ARTIFACT}.tar out/
- if: always()
name: Upload artifact
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
retention-days: 2
name: artifacts-mac-aarch64
path: |
./out-${{ env.ARTIFACT }}.tar
build-win:
name: Build binary (Win)
runs-on: windows-latest
env:
ADD_CABAL_ARGS: ""
ARTIFACT: "x86_64-mingw64"
ARCH: 64
TARBALL_EXT: "zip"
DISTRO: na
GHC_VERSION: 9.4.8
strategy:
fail-fast: false
matrix:
ghc: ["9.6.3", "9.4.8", "9.2.8", "9.0.2"]
steps:
- name: install windows deps
shell: pwsh
run: |
C:\msys64\usr\bin\bash -lc "pacman --disable-download-timeout --noconfirm -Syuu"
C:\msys64\usr\bin\bash -lc "pacman --disable-download-timeout --noconfirm -Syuu"
C:\msys64\usr\bin\bash -lc "pacman --disable-download-timeout --noconfirm -S make mingw-w64-x86_64-clang curl autoconf mingw-w64-x86_64-pkgconf ca-certificates base-devel gettext autoconf make libtool automake python p7zip patch unzip zip git"
taskkill /F /FI "MODULES eq msys-2.0.dll"
- name: Checkout code
uses: actions/checkout@v3
- name: Run build (windows)
run: |
$env:CHERE_INVOKING = 1
$env:MSYS2_PATH_TYPE = "inherit"
$ErrorActionPreference = "Stop"
C:\msys64\usr\bin\bash -lc "bash .github/scripts/build.sh"
shell: pwsh
- if: always()
name: Upload artifact
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
retention-days: 2
name: artifacts-win
path: |
./out/*
release:
name: release
needs: ["build-linux", "build-arm", "build-mac-x86_64", "build-mac-aarch64", "build-win"]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
path: ./out
name: artifacts-x86_64-linux-deb9
- uses: actions/download-artifact@v3
with:
path: ./out
name: artifacts-x86_64-linux-deb10
- uses: actions/download-artifact@v3
with:
path: ./out
name: artifacts-x86_64-linux-deb11
- uses: actions/download-artifact@v3
with:
path: ./out
name: artifacts-x86_64-linux-ubuntu18.04
- uses: actions/download-artifact@v3
with:
path: ./out
name: artifacts-x86_64-linux-ubuntu20.04
- uses: actions/download-artifact@v3
with:
path: ./out
name: artifacts-x86_64-linux-ubuntu22.04
- uses: actions/download-artifact@v3
with:
path: ./out
name: artifacts-x86_64-linux-fedora27
- uses: actions/download-artifact@v3
with:
path: ./out
name: artifacts-x86_64-linux-fedora33
- uses: actions/download-artifact@v3
with:
path: ./out
name: artifacts-x86_64-linux-centos7
- uses: actions/download-artifact@v3
with:
path: ./out
name: artifacts-x86_64-linux-unknown
- uses: actions/download-artifact@v3
with:
path: ./out
name: artifacts-x86_64-linux-rocky8
- uses: actions/download-artifact@v3
with:
path: ./out
name: artifacts-x86_64-linux-mint19.3
- uses: actions/download-artifact@v3
with:
path: ./out
name: artifacts-x86_64-linux-mint20.2
- uses: actions/download-artifact@v3
with:
name: artifacts-arm
path: ./out
- uses: actions/download-artifact@v3
with:
name: artifacts-mac-x86_64
path: ./out
- uses: actions/download-artifact@v3
with:
name: artifacts-mac-aarch64
path: ./out
- uses: actions/download-artifact@v3
with:
name: artifacts-win
path: ./out
- name: Install requirements
run: |
sudo apt-get update && sudo apt-get install -y tar xz-utils
shell: bash
- name: build sdists
run: |
cabal sdist -o out all
shell: bash
- name: Release
uses: softprops/action-gh-release@v1
with:
draft: true
files: |
./out/*.zip
./out/*.tar.xz
./out/*.tar.gz
./out/*.tar