4
4
pull_request :
5
5
push :
6
6
branches :
7
- - master
8
- - stable
9
- - rc/**
7
+ - master
8
+ - stable
9
+ - rc/**
10
10
tags :
11
- - ' **'
12
- schedule :
13
- - cron : " 0 0 * * *"
11
+ - ' **'
14
12
workflow_dispatch :
15
13
14
+ # As of 11 August 2022, ubuntu-latest, windows-latest and macos-latest come with
15
+ # Stack 2.7.5. windows-latest comes with NSIS 3.08, for which the default value
16
+ # of the 'Unicode' installer attribute is 'true'.
17
+
16
18
jobs :
17
19
integration-tests :
18
20
name : Integration tests
@@ -26,148 +28,190 @@ jobs:
26
28
cache-bust : " "
27
29
- os : windows-latest
28
30
release-args : " "
29
- cache-bust : " "
31
+ cache-bust : " 13 "
30
32
- os : macos-latest
31
33
release-args : " "
32
- cache-bust : " 1 "
34
+ cache-bust : " 23 "
33
35
steps :
34
- - name : Clone project
35
- uses : actions/checkout@v2
36
- - name : Cache dependencies
37
- uses : actions/cache@v1
38
- with :
39
- path : ~/.stack
40
- key : ${{ runner.os }}-${{ hashFiles('stack.yaml') }}${{ matrix.cache-bust }}
41
- - shell : bash
42
- name : Install deps and run checks
43
- run : |
44
- set -ex
45
-
46
- # Work around 'git status' always showing symlinks modified on Windows; see
47
- # https://github.com/git-for-windows/git/issues/2653#issuecomment-640234081
48
- git config --global core.fscache false
49
-
50
- stack upgrade || curl -sSL https://get.haskellstack.org/ | sh -s - -f
51
-
52
- if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]
53
- then
54
- # Retry installing nix due to nondeterministic error
55
- # Fatal error: glibc detected an invalid stdio handle
56
- # See:
57
- # https://github.com/nh2/static-haskell-nix/pull/27#issuecomment-502652181
58
- # https://github.com/NixOS/nix/issues/2733
59
- (for i in {1..5}; do bash <(curl -sSL https://nixos.org/nix/install) && exit 0; done; exit 1)
60
- . ~/.nix-profile/etc/profile.d/nix.sh
61
- nix-channel --add https://nixos.org/channels/nixos-19.09 nixpkgs
62
- nix-channel --update # Get GHC 8.2.2
63
- elif [[ "${{ matrix.os }}" == "windows-latest" ]]
64
- then
65
- choco install nsis-unicode -y
66
- fi
67
-
68
- # Do this in the same step as installing deps to get relevant env var modifications
69
- stack etc/scripts/release.hs check ${{ matrix.release-args }}
70
-
71
- set +ex
72
-
73
- - shell : bash
74
- name : Build bindist
75
- run : stack etc/scripts/release.hs build ${{ matrix.release-args }}
76
-
77
- - name : Upload bindist
78
- uses : actions/upload-artifact@v2
79
- with :
80
- name : ${{ runner.os }}
81
- path : _release/stack-*
36
+ - name : Clone project
37
+ uses : actions/checkout@v3
38
+ - name : Cache dependencies on Unix-like OS
39
+ if : startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS')
40
+ uses : actions/cache@v3
41
+ with :
42
+ path : ~/.stack
43
+ key : ${{ runner.os }}-${{ hashFiles('stack.yaml') }}-${{ matrix.cache-bust }}
44
+ - name : Cache dependencies on Windows
45
+ if : startsWith(runner.os, 'Windows')
46
+ uses : actions/cache@v3
47
+ with :
48
+ path : |
49
+ ~\AppData\Roaming\stack
50
+ ~\AppData\Local\Programs\stack
51
+ key : ${{ runner.os }}-${{ hashFiles('stack.yaml') }}-${{ matrix.cache-bust }}
52
+ - name : Install deps and run checks
53
+ shell : bash
54
+ run : |
55
+ set -ex
56
+
57
+ if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]
58
+ then
59
+ # Retry installing nix due to nondeterministic error
60
+ # Fatal error: glibc detected an invalid stdio handle
61
+ # See:
62
+ # https://github.com/nh2/static-haskell-nix/pull/27#issuecomment-502652181
63
+ # https://github.com/NixOS/nix/issues/2733
64
+ (for i in {1..5}; do bash <(curl -sSL https://nixos.org/nix/install) --no-daemon && exit 0; done; exit 1)
65
+ . ~/.nix-profile/etc/profile.d/nix.sh
66
+ nix-channel --add https://nixos.org/channels/nixos-22.05 nixpkgs
67
+ nix-channel --update # Get GHC 8.2.2
68
+ fi
69
+
70
+ if [[ "${{ matrix.release-args }}" == "--alpine" ]]
71
+ then
72
+ mkdir -p ~/.stack
73
+ touch ~/.stack/config.yaml
74
+ cat > ~/.stack/config.yaml <<EOF
75
+ extra-include-dirs:
76
+ - /usr/include
77
+ extra-lib-dirs:
78
+ - /lib
79
+ - /usr/lib
80
+ EOF
81
+ fi
82
+
83
+ # Do this in the same step as installing deps to get relevant env var modifications
84
+ stack etc/scripts/release.hs check ${{ matrix.release-args }}
85
+
86
+ set +ex
87
+
88
+ - name : Build bindist
89
+ shell : bash
90
+ run : stack etc/scripts/release.hs build ${{ matrix.release-args }}
91
+
92
+ - name : Upload bindist
93
+ uses : actions/upload-artifact@v3
94
+ with :
95
+ name : ${{ runner.os }}
96
+ path : _release/stack-*
97
+
98
+ linux-arm64 :
99
+ name : Linux ARM64
100
+ runs-on : [self-hosted, linux, ARM64]
101
+ steps :
102
+ - name : Clone project
103
+ uses : actions/checkout@v3
104
+
105
+ - name : Build bindist
106
+ shell : bash
107
+ run : |
108
+ set -ex
109
+ docker build . -f etc/dockerfiles/arm64.Dockerfile -t stack --build-arg USERID=$(id -u) --build-arg GROUPID=$(id -g)
110
+ rm -rf _release
111
+ mkdir -p _release
112
+ docker run --rm -v $(pwd):/src -w /src stack bash -c "/home/stack/release build"
113
+
114
+ - name : Upload bindist
115
+ uses : actions/upload-artifact@v3
116
+ with :
117
+ name : Linux-ARM64
118
+ path : _release/stack-*
82
119
83
120
github-release :
84
121
name : Create Github release
85
- needs : integration-tests
122
+ needs :
123
+ - integration-tests
124
+ - linux-arm64
86
125
runs-on : ubuntu-latest
87
126
if : startsWith(github.ref, 'refs/tags/')
88
127
steps :
89
- - name : Download Linux artifact
90
- uses : actions/download-artifact@v2
91
- with :
92
- name : Linux
93
- path : _release
94
- - name : Download macOS artifact
95
- uses : actions/download-artifact@v2
96
- with :
97
- name : macOS
98
- path : _release
99
- - name : Download Windows artifact
100
- uses : actions/download-artifact@v2
101
- with :
102
- name : Windows
103
- path : _release
104
- - shell : bash
105
- name : Hash and sign assets
106
- env :
107
- RELEASE_SIGNING_KEY : ${{ secrets.RELEASE_SIGNING_KEY }}
108
- run : |
109
- set -e
110
- echo "$RELEASE_SIGNING_KEY"|gpg --import
111
- cd _release
112
- for asset in *; do
113
- shasum -a 256 "$asset" >"$asset.sha256"
114
- gpg --digest-algo=sha512 --detach-sig --armor -u 0x575159689BEFB442 "$asset"
115
- done
116
- - name : Set Github ref variables
117
- id : github_ref_vars
118
- run : |
119
- echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
120
- - name : Create Github release (final)
121
- if : " !startsWith(github.ref, 'refs/tags/rc/')"
122
- uses : actions/create-release@v1
123
- env :
124
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
125
- with :
126
- tag_name : ${{ github.ref }}
127
- body : |
128
- See https://haskellstack.org/ for installation and upgrade instructions.
129
-
130
- **Changes since v[INSERT PREVIOUS VERSION]:**
131
-
132
- [INSERT CHANGELOG]
133
-
134
- **Thanks to all our contributors for this release:**
135
-
136
- [INSERT CONTRIBUTORS]
137
- draft : true
138
- prerelease : false
139
- - name : Create Github release (release candidate)
140
- if : " startsWith(github.ref, 'refs/tags/rc/')"
141
- uses : actions/create-release@v1
142
- env :
143
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
144
- with :
145
- tag_name : ${{ github.ref }}
146
- body : |
147
- **Changes since v[INSERT PREVIOUS VERSION]:**
148
-
149
- [INSERT CHANGELOG]
150
- draft : true
151
- prerelease : true
152
- - name : Upload assets to Github release (final)
153
- if : " !startsWith(github.ref, 'refs/tags/rc/')"
154
- uses : xresloader/upload-to-github-release@v1
155
- env :
156
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
157
- with :
158
- file : " _release/*"
159
- tag_name : ${{ steps.github_ref_vars.outputs.SOURCE_TAG }}
160
- draft : true
161
- prerelease : false
162
- overwrite : true
163
- - name : Upload assets to Github release (release candidate)
164
- if : " startsWith(github.ref, 'refs/tags/rc/')"
165
- uses : xresloader/upload-to-github-release@v1
166
- env :
167
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
168
- with :
169
- file : " _release/*"
170
- tag_name : ${{ steps.github_ref_vars.outputs.SOURCE_TAG }}
171
- draft : true
172
- prerelease : true
173
- overwrite : true
128
+ - name : Download Linux artifact
129
+ uses : actions/download-artifact@v3
130
+ with :
131
+ name : Linux
132
+ path : _release
133
+ - name : Download macOS artifact
134
+ uses : actions/download-artifact@v3
135
+ with :
136
+ name : macOS
137
+ path : _release
138
+ - name : Download Windows artifact
139
+ uses : actions/download-artifact@v3
140
+ with :
141
+ name : Windows
142
+ path : _release
143
+ - name : Download Linux-ARM64 artifact
144
+ uses : actions/download-artifact@v3
145
+ with :
146
+ name : Linux-ARM64
147
+ path : _release
148
+ - name : Hash and sign assets
149
+ shell : bash
150
+ env :
151
+ RELEASE_SIGNING_KEY : ${{ secrets.RELEASE_SIGNING_KEY }}
152
+ run : |
153
+ set -e
154
+ echo "$RELEASE_SIGNING_KEY"|gpg --import
155
+ cd _release
156
+ for asset in *; do
157
+ shasum -a 256 "$asset" >"$asset.sha256"
158
+ gpg --digest-algo=sha512 --detach-sig --armor -u 0x575159689BEFB442 "$asset"
159
+ done
160
+ - name : Set Github ref variables
161
+ id : github_ref_vars
162
+ run : |
163
+ echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
164
+ - name : Create Github release (final)
165
+ if : " !startsWith(github.ref, 'refs/tags/rc/')"
166
+ uses : actions/create-release@v1
167
+ env :
168
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
169
+ with :
170
+ tag_name : ${{ github.ref }}
171
+ body : |
172
+ See https://haskellstack.org/ for installation and upgrade instructions.
173
+
174
+ **Changes since v[INSERT PREVIOUS VERSION]:**
175
+
176
+ [INSERT CHANGELOG]
177
+
178
+ **Thanks to all our contributors for this release:**
179
+
180
+ [INSERT CONTRIBUTORS]
181
+ draft : true
182
+ prerelease : false
183
+ - name : Create Github release (release candidate)
184
+ if : " startsWith(github.ref, 'refs/tags/rc/')"
185
+ uses : actions/create-release@v1
186
+ env :
187
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
188
+ with :
189
+ tag_name : ${{ github.ref }}
190
+ body : |
191
+ **Changes since v[INSERT PREVIOUS VERSION]:**
192
+
193
+ [INSERT CHANGELOG]
194
+ draft : true
195
+ prerelease : true
196
+ - name : Upload assets to Github release (final)
197
+ if : " !startsWith(github.ref, 'refs/tags/rc/')"
198
+ uses : xresloader/upload-to-github-release@v1
199
+ env :
200
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
201
+ with :
202
+ file : " _release/*"
203
+ tag_name : ${{ steps.github_ref_vars.outputs.SOURCE_TAG }}
204
+ draft : true
205
+ prerelease : false
206
+ overwrite : true
207
+ - name : Upload assets to Github release (release candidate)
208
+ if : " startsWith(github.ref, 'refs/tags/rc/')"
209
+ uses : xresloader/upload-to-github-release@v1
210
+ env :
211
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
212
+ with :
213
+ file : " _release/*"
214
+ tag_name : ${{ steps.github_ref_vars.outputs.SOURCE_TAG }}
215
+ draft : true
216
+ prerelease : true
217
+ overwrite : true
0 commit comments