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
- - ' **'
11
+ - ' **'
12
12
schedule :
13
13
- cron : " 0 0 * * *"
14
14
workflow_dispatch :
@@ -31,143 +31,152 @@ jobs:
31
31
release-args : " "
32
32
cache-bust : " 1"
33
33
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
34
+ - name : Clone project
35
+ uses : actions/checkout@v2
36
+ - name : Cache dependencies on Unix-like OS
37
+ if : startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS')
38
+ uses : actions/cache@v3
39
+ with :
40
+ path : ~/.stack
41
+ key : ${{ runner.os }}-${{ hashFiles('stack.yaml') }}${{ matrix.cache-bust }}
42
+ - name : Cache dependencies on Windows
43
+ if : startsWith(runner.os, 'Windows')
44
+ uses : actions/cache@v3
45
+ with :
46
+ path : |
47
+ ~\AppData\Roaming\stack
48
+ ~\AppData\Local\Programs\stack
49
+ key : ${{ runner.os }}-${{ hashFiles('stack.yaml') }}${{ matrix.cache-bust }}
50
+ - shell : bash
51
+ name : Install deps and run checks
52
+ run : |
53
+ set -ex
45
54
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
55
+ # Work around 'git status' always showing symlinks modified on Windows; see
56
+ # https://github.com/git-for-windows/git/issues/2653#issuecomment-640234081
57
+ git config --global core.fscache false
49
58
50
- stack upgrade || curl -sSL https://get.haskellstack.org/ | sh -s - -f
59
+ stack upgrade || curl -sSL https://get.haskellstack.org/ | sh -s - -f
51
60
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
61
+ if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]
62
+ then
63
+ # Retry installing nix due to nondeterministic error
64
+ # Fatal error: glibc detected an invalid stdio handle
65
+ # See:
66
+ # https://github.com/nh2/static-haskell-nix/pull/27#issuecomment-502652181
67
+ # https://github.com/NixOS/nix/issues/2733
68
+ (for i in {1..5}; do bash <(curl -sSL https://nixos.org/nix/install) && exit 0; done; exit 1)
69
+ . ~/.nix-profile/etc/profile.d/nix.sh
70
+ nix-channel --add https://nixos.org/channels/nixos-19.09 nixpkgs
71
+ nix-channel --update # Get GHC 8.2.2
72
+ elif [[ "${{ matrix.os }}" == "windows-latest" ]]
73
+ then
74
+ choco install nsis-unicode -y
75
+ fi
67
76
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 }}
77
+ # Do this in the same step as installing deps to get relevant env var modifications
78
+ stack etc/scripts/release.hs check ${{ matrix.release-args }}
70
79
71
- set +ex
80
+ set +ex
72
81
73
- - shell : bash
74
- name : Build bindist
75
- run : stack etc/scripts/release.hs build ${{ matrix.release-args }}
82
+ - name : Build bindist
83
+ shell : bash
84
+ run : stack etc/scripts/release.hs build ${{ matrix.release-args }}
76
85
77
- - name : Upload bindist
78
- uses : actions/upload-artifact@v2
79
- with :
80
- name : ${{ runner.os }}
81
- path : _release/stack-*
86
+ - name : Upload bindist
87
+ uses : actions/upload-artifact@v2
88
+ with :
89
+ name : ${{ runner.os }}
90
+ path : _release/stack-*
82
91
83
92
github-release :
84
93
name : Create Github release
85
94
needs : integration-tests
86
95
runs-on : ubuntu-latest
87
96
if : startsWith(github.ref, 'refs/tags/')
88
97
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.
98
+ - name : Download Linux artifact
99
+ uses : actions/download-artifact@v2
100
+ with :
101
+ name : Linux
102
+ path : _release
103
+ - name : Download macOS artifact
104
+ uses : actions/download-artifact@v2
105
+ with :
106
+ name : macOS
107
+ path : _release
108
+ - name : Download Windows artifact
109
+ uses : actions/download-artifact@v2
110
+ with :
111
+ name : Windows
112
+ path : _release
113
+ - name : Hash and sign assets
114
+ shell : bash
115
+ env :
116
+ RELEASE_SIGNING_KEY : ${{ secrets.RELEASE_SIGNING_KEY }}
117
+ run : |
118
+ set -e
119
+ echo "$RELEASE_SIGNING_KEY"|gpg --import
120
+ cd _release
121
+ for asset in *; do
122
+ shasum -a 256 "$asset" >"$asset.sha256"
123
+ gpg --digest-algo=sha512 --detach-sig --armor -u 0x575159689BEFB442 "$asset"
124
+ done
125
+ - name : Set Github ref variables
126
+ id : github_ref_vars
127
+ run : |
128
+ echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
129
+ - name : Create Github release (final)
130
+ if : " !startsWith(github.ref, 'refs/tags/rc/')"
131
+ uses : actions/create-release@v1
132
+ env :
133
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
134
+ with :
135
+ tag_name : ${{ github.ref }}
136
+ body : |
137
+ See https://haskellstack.org/ for installation and upgrade instructions.
129
138
130
- **Changes since v[INSERT PREVIOUS VERSION]:**
139
+ **Changes since v[INSERT PREVIOUS VERSION]:**
131
140
132
- [INSERT CHANGELOG]
141
+ [INSERT CHANGELOG]
133
142
134
- **Thanks to all our contributors for this release:**
143
+ **Thanks to all our contributors for this release:**
135
144
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]:**
145
+ [INSERT CONTRIBUTORS]
146
+ draft : true
147
+ prerelease : false
148
+ - name : Create Github release (release candidate)
149
+ if : " startsWith(github.ref, 'refs/tags/rc/')"
150
+ uses : actions/create-release@v1
151
+ env :
152
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
153
+ with :
154
+ tag_name : ${{ github.ref }}
155
+ body : |
156
+ **Changes since v[INSERT PREVIOUS VERSION]:**
148
157
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
158
+ [INSERT CHANGELOG]
159
+ draft : true
160
+ prerelease : true
161
+ - name : Upload assets to Github release (final)
162
+ if : " !startsWith(github.ref, 'refs/tags/rc/')"
163
+ uses : xresloader/upload-to-github-release@v1
164
+ env :
165
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
166
+ with :
167
+ file : " _release/*"
168
+ tag_name : ${{ steps.github_ref_vars.outputs.SOURCE_TAG }}
169
+ draft : true
170
+ prerelease : false
171
+ overwrite : true
172
+ - name : Upload assets to Github release (release candidate)
173
+ if : " startsWith(github.ref, 'refs/tags/rc/')"
174
+ uses : xresloader/upload-to-github-release@v1
175
+ env :
176
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
177
+ with :
178
+ file : " _release/*"
179
+ tag_name : ${{ steps.github_ref_vars.outputs.SOURCE_TAG }}
180
+ draft : true
181
+ prerelease : true
182
+ overwrite : true
0 commit comments