Skip to content

Commit 4b7d139

Browse files
jneiramichaelpjmergify[bot]
authored
[skip circleci] Update release instructions (#2384)
* Check the build workflow * Add gitlab/ghcup specific intructions * Apply suggestions from @michaelpj Co-authored-by: Michael Peyton Jones <[email protected]> * Note where are release artifacts Co-authored-by: Michael Peyton Jones <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent 7f469f0 commit 4b7d139

File tree

2 files changed

+86
-46
lines changed

2 files changed

+86
-46
lines changed

.github/workflows/build.yml

Lines changed: 43 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ defaults:
77
on:
88
release:
99
types: [created]
10+
push:
11+
branches:
12+
- '*-check-build'
1013

1114
jobs:
1215
build:
@@ -30,8 +33,8 @@ jobs:
3033
ghc-version: ${{ matrix.ghc }}
3134
cabal-version: '3.4'
3235

33-
- if: ${{ matrix.ghc == '9.0.1' }}
34-
name: Use modified cabal.project for ghc9
36+
- name: Use modified cabal.project for ghc9
37+
if: ${{ matrix.ghc == '9.0.1' }}
3538
run: cp cabal-ghc901.project cabal.project
3639

3740
- name: Shorten binary names
@@ -77,13 +80,13 @@ jobs:
7780
echo "package floskell" >> cabal.project
7881
echo " ghc-options: -O0" >> cabal.project
7982
80-
- name: Build Server
83+
- name: Build server
8184
# Try building it twice in case of flakey builds on Windows
8285
run: |
8386
cabal build exe:hls -O2 $LINUX_CABAL_ARGS || \
8487
cabal build exe:hls -O2 $LINUX_CABAL_ARGS -j1
8588
86-
- name: Compress Server Binary
89+
- name: Compress server binary
8790
id: compress_server_binary
8891
run: |
8992
HLS_BUILD=$(find dist-newstyle \( -name 'hls' -o -name 'hls.exe' \) -type f)
@@ -101,7 +104,8 @@ jobs:
101104
echo ::set-output name=extension::gz
102105
fi
103106
104-
- name: Upload Server Binary
107+
- name: Upload server to release
108+
if: ${{ !contains(github.ref_name, 'check') }}
105109
uses: actions/[email protected]
106110
env:
107111
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -111,16 +115,17 @@ jobs:
111115
asset_name: haskell-language-server-${{ runner.OS }}-${{ env.GHC_VERSION }}${{env.EXE_EXT}}.${{ steps.compress_server_binary.outputs.extension }}
112116
asset_content_type: ${{ steps.compress_server_binary.outputs.content_type }}
113117

114-
- uses: actions/upload-artifact@v2
118+
- name: Upload server to workflow artifacts
119+
uses: actions/upload-artifact@v2
115120
with:
116121
name: haskell-language-server-${{ runner.OS }}-${{ matrix.ghc }}${{env.EXE_EXT}}.${{ steps.compress_server_binary.outputs.extension }}
117122
path: ${{ steps.compress_server_binary.outputs.path }}
118123

119-
- name: Build Wrapper
124+
- name: Build wrapper
120125
if: matrix.ghc == '8.10.7'
121126
run: cabal build exe:hls-wrapper -O2 $LINUX_CABAL_ARGS
122127

123-
- name: Compress Wrapper Binary
128+
- name: Compress wrapper binary
124129
if: matrix.ghc == '8.10.7'
125130
id: compress_wrapper_binary
126131
run: |
@@ -139,8 +144,8 @@ jobs:
139144
echo ::set-output name=extension::gz
140145
fi
141146
142-
- name: Upload Wrapper
143-
if: matrix.ghc == '8.10.7'
147+
- name: Upload wrapper to the release
148+
if: ${{ matrix.ghc == '8.10.7' && !contains(github.ref_name, 'check') }}
144149
uses: actions/[email protected]
145150
env:
146151
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -150,31 +155,34 @@ jobs:
150155
asset_name: haskell-language-server-wrapper-${{ runner.OS }}${{env.EXE_EXT}}.${{ steps.compress_wrapper_binary.outputs.extension }}
151156
asset_content_type: ${{ steps.compress_wrapper_binary.outputs.content_type}}
152157

153-
- uses: actions/upload-artifact@v2
158+
- name: Upload wrapper to workflow artifacts
159+
uses: actions/upload-artifact@v2
154160
if: matrix.ghc == '8.10.7'
155161
with:
156162
name: haskell-language-server-wrapper-${{ runner.OS }}${{env.EXE_EXT}}.${{ steps.compress_wrapper_binary.outputs.extension }}
157163
path: ${{ steps.compress_wrapper_binary.outputs.path }}
158-
159-
# generates a custom tarball with sources, used by `ghcup compile hls`
164+
165+
# generates a custom tarball with sources, used by `ghcup compile hls`
160166
src-tar:
161167
needs: build
162168
runs-on: ubuntu-18.04
163-
169+
164170
steps:
165171
- uses: actions/checkout@v2
166172
with:
167173
submodules: true
168-
169-
- name: "Create source tarball"
174+
175+
- name: Create source tarball
170176
run: |
171177
mkdir src-dist
172178
git archive --prefix=haskell-language-server-${{ github.event.release.tag_name }}/ \
173179
--format=tar.gz \
174180
-o src-dist/haskell-language-server.tar.gz \
175181
HEAD
176-
177-
- uses: actions/[email protected]
182+
183+
- name: Upload source tarball to the release
184+
if: ${{ !contains(github.ref_name, 'check') }}
185+
uses: actions/[email protected]
178186
env:
179187
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
180188
with:
@@ -183,11 +191,12 @@ jobs:
183191
asset_name: haskell-language-server-${{ github.event.release.tag_name }}-src.tar.gz
184192
asset_content_type: application/gzip
185193

186-
- uses: actions/upload-artifact@v2
194+
- name: Upload source tarball to workflow artifacts
195+
uses: actions/upload-artifact@v2
187196
with:
188197
name: haskell-language-server-${{ github.event.release.tag_name }}-src.tar.gz
189198
path: src-dist/haskell-language-server.tar.gz
190-
199+
191200
# this generates .gz tarfiles containing binaries for all GHC versions and OS's
192201
# used by `ghcup install hls`
193202
tar:
@@ -199,7 +208,8 @@ jobs:
199208
steps:
200209
- uses: actions/download-artifact@v2
201210

202-
- run: |
211+
- name: Generate tarball with all binaries
212+
run: |
203213
# move the binaries for the specific platform into bin/
204214
mkdir bin
205215
mv haskell-language-server-${{ matrix.os }}-*/* bin
@@ -214,7 +224,9 @@ jobs:
214224
fi
215225
tar -czpf haskell-language-server.tar.gz *
216226
217-
- uses: actions/[email protected]
227+
- name: Upload binaries tarball to the release
228+
if: ${{ !contains(github.ref_name, 'check') }}
229+
uses: actions/[email protected]
218230
env:
219231
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
220232
with:
@@ -223,7 +235,8 @@ jobs:
223235
asset_name: haskell-language-server-${{ matrix.os }}-${{ github.event.release.tag_name }}.tar.gz
224236
asset_content_type: application/gzip
225237

226-
- uses: actions/upload-artifact@v2
238+
- name: Upload binaries tarball to workflow artifacts
239+
uses: actions/upload-artifact@v2
227240
with:
228241
name: haskell-language-server-${{ matrix.os }}-${{ github.event.release.tag_name }}.tar.gz
229242
path: bin/haskell-language-server.tar.gz
@@ -234,13 +247,15 @@ jobs:
234247
steps:
235248
- uses: actions/download-artifact@v2
236249

237-
- run: |
238-
# generate sha256 sums for all current artifacts
250+
- name: Generate sha256 sums for all workflow artifacts
251+
run: |
239252
sha256sum --tag haskell-language-server*/* >> SHA256SUMS
240253
# we clean up tags to match the release file names
241254
sed -i 's/\/.*)/)/g' SHA256SUMS
242255
243-
- uses: actions/[email protected]
256+
- name: Upload sha256sums to the release
257+
if: ${{ !contains(github.ref_name, 'check') }}
258+
uses: actions/[email protected]
244259
env:
245260
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
246261
with:
@@ -249,7 +264,8 @@ jobs:
249264
asset_name: SHA256SUMS
250265
asset_content_type: plain/text
251266

252-
- uses: actions/upload-artifact@v2
267+
- name: Upload sha256sums to workflow artifacts
268+
uses: actions/upload-artifact@v2
253269
with:
254270
name: SHA256SUMS
255271
path: SHA256SUMS

docs/contributing/releases.md

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,38 @@ and it is being used in nix environments.
1616

1717
## Minimal checklist
1818

19+
### prerelease sanity checks
20+
21+
- [ ] create a branch named `${version}-check-hackage`: it will trigger the hackage workflow *without* uploading the packages
22+
- [ ] trigger the build workflow pushing a branch named `${version}-check-build`
23+
- [ ] create a prerelease tag `${version}-check-gitlab` and push it to the [project repo in gitlab](https://gitlab.haskell.org/haskell/haskell-language-server) to check the build is fine
1924
### github release
2025

21-
* [ ] generate the list of pull requests finished since the last release using the [haskell script](https://github.com/haskell/haskell-language-server/blob/master/GenChangelogs.hs) in the project root.
26+
- [ ] generate the list of pull requests finished since the last release using the [haskell script](https://github.com/haskell/haskell-language-server/blob/master/GenChangelogs.hs) in the project root.
2227
Nix users should run command `gen-hls-changelogs` (a wrapper of the script) in nix-shell instead.
23-
* [ ] add that list to the actual [Changelog](https://github.com/haskell/haskell-language-server/blob/master/ChangeLog.md) with a description of the release.
24-
* [ ] bump up versions of changed packages. All are optional but [haskell-language-server itself](https://github.com/haskell/haskell-language-server/blob/master/haskell-language-server.cabal).
25-
* [ ] create the tag and make an initial prerelease to trigger the ci workflow (see details below)
26-
* [ ] contact ghcup team (#haskell-ghcup irc channel or via its [repo](https://gitlab.haskell.org/haskell/ghcup-hs/-/issues)) to try to sync our release and its inclusion in ghcup
27-
* [ ] check uploaded binaries (see windows note below) and the release description (usually the changelog entry) and uncheck the prerelease box
28-
* [ ] make public the release in the usual social channels: irc, twitter, reddit, discord, discourse, mailing lists, etc (not required but useful to spread the word :slightly_smiling_face:)
29-
28+
- [ ] add that list to the actual [Changelog](https://github.com/haskell/haskell-language-server/blob/master/ChangeLog.md) with a description of the release.
29+
- [ ] bump up versions of changed packages. All are optional but [haskell-language-server itself](https://github.com/haskell/haskell-language-server/blob/master/haskell-language-server.cabal).
30+
- [ ] create the tag and make an initial prerelease to trigger the ci workflow (see details below)
31+
- [ ] contact ghcup team (#haskell-ghcup irc channel or via its [repo](https://gitlab.haskell.org/haskell/ghcup-hs/-/issues)) to try to sync our release and its inclusion in ghcup
32+
- [ ] in the github release edit page, check the attached binaries and the release description (usually the changelog entry) and uncheck the prerelease box
33+
- [ ] make public the release in the usual social channels (not required but useful to spread the word :slightly_smiling_face:):
34+
- [ ] irc
35+
- [ ] matrix
36+
- [ ] twitter
37+
- [ ] discord
38+
- [ ] discourse
39+
- [ ] reddit
3040
### hackage release
3141

32-
* [ ] bump up package versions following the [pvp specification](https://pvp.haskell.org/) if they are not already updated
33-
* [ ] create ${version}-hackage branch to trigger the hackage github workflow which will upload all changed packages to hackage as candidates
34-
* [ ] check manually candidates in hackage
35-
* [ ] publish them definitely
42+
- [ ] bump up package versions following the [pvp specification](https://pvp.haskell.org/) if they are not already updated. You could use [policeman](https://github.com/kowainik/policeman) to help with this step.
43+
- [ ] create ${version}-hackage branch to trigger the hackage github workflow which will upload all changed packages to hackage as candidates
44+
- [ ] check manually candidates in hackage
45+
- [ ] publish them definitely
46+
47+
### ghcup release
48+
49+
* [ ] push the release tag to the [haskell-language-server gitlab repo](https://gitlab.haskell.org/haskell/haskell-language-server) to trigger the build of ghcup specific artifacts
50+
* [ ] change ghcup metadata to include the new release in https://github.com/haskell/ghcup-metadata
3651

3752
## Making a new release of haskell-language-server in github
3853

@@ -140,11 +155,20 @@ To manually upload a new binary we should:
140155
We aim to do hackage releases following the github ones described above.
141156
To help in that job we have added a [github workflow](https://github.com/haskell/haskell-language-server/blob/master/.github/workflows/hackage.yml)
142157

143-
That script checks, generates the tar.gz files, unpacks and builds them in isolation against hackage head
144-
if the package version in the branch is different from hackage.
145-
If the package in the branch has the same version as the released one,
146-
it will check the relevant files have not changed and will throw an error
147-
otherwise.
158+
That script checks, generates the tar.gz files, unpacks and builds them in isolation
159+
against hackage head if the package version in the branch is different from hackage.
160+
If the package in the branch has the same version as the released one, it will check
161+
the relevant files have not changed and will throw an error otherwise.
162+
163+
You can trigger a build which only does the above step by pushing a branch named `${version}-check-hackage`.
164+
165+
The script will upload the tarballs as candidates, maintainers will have to check and publish them definitely.
166+
167+
## haskell gitlab release pipeline
148168

149-
The script will upload the tarballs as candidates, maintainers will have
150-
to check and publish them definitely.
169+
The project is present in the haskell gitlab server: https://gitlab.haskell.org/haskell/haskell-language-server
170+
The main motivation is to leverage the ci infrastructure which includes architectures not included in the github ci.
171+
The specific architectures only available through gitlab are: `armv7-linux`, `x86_64-freebsd`, `aarch64-darwin`, `aarch64-linux`
172+
The gitlab pipeline uses the configuration file [.gitlab-ci.yml](https://github.com/haskell/haskell-language-server/blob/master/.gitlab-ci.yml)
173+
and the sh/nix scripts in [.gitlab](https://github.com/haskell/haskell-language-server/tree/master/.gitlab)
174+
It is triggered by pushing a tag to the gitlab repo.

0 commit comments

Comments
 (0)