1
1
{-# LANGUAGE OverloadedStrings #-}
2
- {-# LANGUAGE RecordWildCards #-}
2
+ {-# LANGUAGE RecordWildCards #-}
3
3
4
- import Control.Monad
5
- import Data.Maybe
4
+ import Control.Monad
5
+ import Data.Maybe
6
6
7
- import Data.Aeson hiding ( encode )
8
- import Data.Aeson.Types ( Pair )
9
- import qualified Data.Aeson.Key as K
10
- import Data.Yaml
7
+ import Data.Aeson hiding (encode )
8
+ import qualified Data.Aeson.Key as K
9
+ import Data.Aeson.Types ( Pair )
10
+ import Data.Yaml
11
11
12
- import qualified Data.ByteString as BS
12
+ import qualified Data.ByteString as BS
13
13
14
- import qualified Data.List as L
14
+ import qualified Data.List as L
15
15
16
- import System.Directory
17
- import System.FilePath
18
- import System.Environment
16
+ import System.Directory
17
+ import System.Environment
18
+ import System.FilePath
19
19
20
20
-------------------------------------------------------------------------------
21
21
-- Configuration parameters
@@ -27,8 +27,8 @@ data Opsys
27
27
| Windows deriving (Eq )
28
28
29
29
osName :: Opsys -> String
30
- osName Darwin = " mac"
31
- osName Windows = " windows"
30
+ osName Darwin = " mac"
31
+ osName Windows = " windows"
32
32
osName (Linux d) = " linux-" ++ distroName d
33
33
34
34
data Distro
@@ -52,27 +52,25 @@ allDistros = [minBound .. maxBound]
52
52
53
53
data Arch = Amd64 | AArch64
54
54
archName :: Arch -> String
55
- archName Amd64 = " x86_64"
55
+ archName Amd64 = " x86_64"
56
56
archName AArch64 = " aarch64"
57
57
58
58
artifactName :: Arch -> Opsys -> String
59
59
artifactName arch opsys = archName arch ++ " -" ++ case opsys of
60
60
Linux distro -> " linux-" ++ distroName distro
61
- Darwin -> " apple-darwin"
62
- Windows -> " mingw64"
61
+ Darwin -> " apple-darwin"
62
+ Windows -> " mingw64"
63
63
64
64
data GHC
65
- = GHC948
66
- | GHC967
65
+ = GHC967
67
66
| GHC984
68
67
| GHC9102
69
68
| GHC9122
70
69
deriving (Eq , Enum , Bounded )
71
70
72
71
ghcVersion :: GHC -> String
73
- ghcVersion GHC948 = " 9.4.8"
74
- ghcVersion GHC967 = " 9.6.7"
75
- ghcVersion GHC984 = " 9.8.4"
72
+ ghcVersion GHC967 = " 9.6.7"
73
+ ghcVersion GHC984 = " 9.8.4"
76
74
ghcVersion GHC9102 = " 9.10.2"
77
75
ghcVersion GHC9122 = " 9.12.2"
78
76
@@ -89,34 +87,34 @@ data Stage = Build GHC | Bindist | Test
89
87
-------------------------------------------------------------------------------
90
88
91
89
distroImage :: Distro -> String
92
- distroImage Debian9 = " debian:9"
93
- distroImage Debian10 = " debian:10"
94
- distroImage Debian11 = " debian:11"
95
- distroImage Debian12 = " debian:12"
90
+ distroImage Debian9 = " debian:9"
91
+ distroImage Debian10 = " debian:10"
92
+ distroImage Debian11 = " debian:11"
93
+ distroImage Debian12 = " debian:12"
96
94
distroImage Ubuntu1804 = " ubuntu:18.04"
97
95
distroImage Ubuntu2004 = " ubuntu:20.04"
98
96
distroImage Ubuntu2204 = " ubuntu:22.04"
99
- distroImage Mint193 = " linuxmintd/mint19.3-amd64"
100
- distroImage Mint202 = " linuxmintd/mint20.2-amd64"
101
- distroImage Mint213 = " linuxmintd/mint21.3-amd64"
102
- distroImage Fedora33 = " fedora:33"
103
- distroImage Fedora40 = " fedora:40"
104
- distroImage Rocky8 = " rockylinux:8"
97
+ distroImage Mint193 = " linuxmintd/mint19.3-amd64"
98
+ distroImage Mint202 = " linuxmintd/mint20.2-amd64"
99
+ distroImage Mint213 = " linuxmintd/mint21.3-amd64"
100
+ distroImage Fedora33 = " fedora:33"
101
+ distroImage Fedora40 = " fedora:40"
102
+ distroImage Rocky8 = " rockylinux:8"
105
103
106
104
distroName :: Distro -> String
107
- distroName Debian9 = " deb9"
108
- distroName Debian10 = " deb10"
109
- distroName Debian11 = " deb11"
110
- distroName Debian12 = " deb12"
105
+ distroName Debian9 = " deb9"
106
+ distroName Debian10 = " deb10"
107
+ distroName Debian11 = " deb11"
108
+ distroName Debian12 = " deb12"
111
109
distroName Ubuntu1804 = " ubuntu1804"
112
110
distroName Ubuntu2004 = " ubuntu2004"
113
111
distroName Ubuntu2204 = " ubuntu2204"
114
- distroName Mint193 = " mint193"
115
- distroName Mint202 = " mint202"
116
- distroName Mint213 = " mint213"
117
- distroName Fedora33 = " fedora33"
118
- distroName Fedora40 = " fedora40"
119
- distroName Rocky8 = " unknown"
112
+ distroName Mint193 = " mint193"
113
+ distroName Mint202 = " mint202"
114
+ distroName Mint213 = " mint213"
115
+ distroName Fedora33 = " fedora33"
116
+ distroName Fedora40 = " fedora40"
117
+ distroName Rocky8 = " unknown"
120
118
121
119
distroInstall :: Distro -> String
122
120
distroInstall Debian9 = " 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"
@@ -165,13 +163,13 @@ envVars arch os = object $
165
163
baseEnv
166
164
++ [ " TARBALL_EXT" .= str (case os of
167
165
Windows -> " zip"
168
- _ -> " tar.xz" )
166
+ _ -> " tar.xz" )
169
167
, " ARCH" .= str (case arch of
170
- Amd64 -> " 64"
168
+ Amd64 -> " 64"
171
169
AArch64 -> " ARM64" )
172
170
, " ADD_CABAL_ARGS" .= str (case (os,arch) of
173
171
(Linux _, Amd64 ) -> " --enable-split-sections"
174
- _ -> " " )
172
+ _ -> " " )
175
173
, " ARTIFACT" .= artifactName arch os
176
174
]
177
175
++ [ " DEBIAN_FRONTEND" .= str " noninteractive"
@@ -186,21 +184,21 @@ envVars arch os = object $
186
184
187
185
-- | Runner selection
188
186
runner :: Arch -> Opsys -> [Value ]
189
- runner Amd64 (Linux _) = [" ubuntu-latest" ]
187
+ runner Amd64 (Linux _) = [" ubuntu-latest" ]
190
188
runner AArch64 (Linux _) = [" self-hosted" , " Linux" , " ARM64" , " maerwald" ]
191
- runner Amd64 Darwin = [" macOS-13" ]
192
- runner AArch64 Darwin = [" self-hosted" , " macOS" , " ARM64" ]
193
- runner Amd64 Windows = [" windows-latest" ]
194
- runner AArch64 Windows = error " aarch64 windows not supported"
189
+ runner Amd64 Darwin = [" macOS-13" ]
190
+ runner AArch64 Darwin = [" self-hosted" , " macOS" , " ARM64" ]
191
+ runner Amd64 Windows = [" windows-latest" ]
192
+ runner AArch64 Windows = error " aarch64 windows not supported"
195
193
196
194
-- | Runner selection for bindist jobs
197
195
bindistRunner :: Arch -> Opsys -> [Value ]
198
- bindistRunner Amd64 (Linux _) = [" self-hosted" , " linux-space" , " maerwald" ]
196
+ bindistRunner Amd64 (Linux _) = [" self-hosted" , " linux-space" , " maerwald" ]
199
197
bindistRunner AArch64 (Linux _) = [" self-hosted" , " Linux" , " ARM64" , " maerwald" ]
200
- bindistRunner Amd64 Darwin = [" macOS-13" ]
201
- bindistRunner AArch64 Darwin = [" self-hosted" , " macOS" , " ARM64" ]
202
- bindistRunner Amd64 Windows = [" windows-latest" ]
203
- bindistRunner AArch64 Windows = error " aarch64 windows not supported"
198
+ bindistRunner Amd64 Darwin = [" macOS-13" ]
199
+ bindistRunner AArch64 Darwin = [" self-hosted" , " macOS" , " ARM64" ]
200
+ bindistRunner Amd64 Windows = [" windows-latest" ]
201
+ bindistRunner AArch64 Windows = error " aarch64 windows not supported"
204
202
205
203
-------------------------------------------------------------------------------
206
204
-- Action generatation
@@ -220,7 +218,7 @@ bindistRunner AArch64 Windows = error "aarch64 windows not supported"
220
218
-- called 'actionName', located at 'actionPath'
221
219
data Action
222
220
= Action
223
- { actionName :: String
221
+ { actionName :: String
224
222
, actionDistro :: Distro
225
223
}
226
224
@@ -259,7 +257,7 @@ instance ToJSON Action where
259
257
260
258
configAction :: Config -> Maybe Action
261
259
configAction (MkConfig Amd64 (Linux d) _) = Just $ Action (distroActionName d) d
262
- configAction _ = Nothing
260
+ configAction _ = Nothing
263
261
264
262
distroActionName :: Distro -> String
265
263
distroActionName d = " action-" ++ distroName d
@@ -279,7 +277,7 @@ customAction d st = flip (ghAction stepName (actionPath d)) [] $ case st of
279
277
where
280
278
stepName = case st of
281
279
Build v -> " Build " ++ ghcVersion v
282
- Test -> " Test"
280
+ Test -> " Test"
283
281
Bindist -> " Bindist"
284
282
285
283
-------------------------------------------------------------------------------
0 commit comments