Skip to content

[skip circleci] Update release instructions #2384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Nov 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 43 additions & 27 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ defaults:
on:
release:
types: [created]
push:
branches:
- '*-check-build'

jobs:
build:
Expand All @@ -30,8 +33,8 @@ jobs:
ghc-version: ${{ matrix.ghc }}
cabal-version: '3.4'

- if: ${{ matrix.ghc == '9.0.1' }}
name: Use modified cabal.project for ghc9
- name: Use modified cabal.project for ghc9
if: ${{ matrix.ghc == '9.0.1' }}
run: cp cabal-ghc901.project cabal.project

- name: Shorten binary names
Expand Down Expand Up @@ -77,13 +80,13 @@ jobs:
echo "package floskell" >> cabal.project
echo " ghc-options: -O0" >> cabal.project

- name: Build Server
- name: Build server
# Try building it twice in case of flakey builds on Windows
run: |
cabal build exe:hls -O2 $LINUX_CABAL_ARGS || \
cabal build exe:hls -O2 $LINUX_CABAL_ARGS -j1

- name: Compress Server Binary
- name: Compress server binary
id: compress_server_binary
run: |
HLS_BUILD=$(find dist-newstyle \( -name 'hls' -o -name 'hls.exe' \) -type f)
Expand All @@ -101,7 +104,8 @@ jobs:
echo ::set-output name=extension::gz
fi

- name: Upload Server Binary
- name: Upload server to release
if: ${{ !contains(github.ref_name, 'check') }}
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -111,16 +115,17 @@ jobs:
asset_name: haskell-language-server-${{ runner.OS }}-${{ env.GHC_VERSION }}${{env.EXE_EXT}}.${{ steps.compress_server_binary.outputs.extension }}
asset_content_type: ${{ steps.compress_server_binary.outputs.content_type }}

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

- name: Build Wrapper
- name: Build wrapper
if: matrix.ghc == '8.10.7'
run: cabal build exe:hls-wrapper -O2 $LINUX_CABAL_ARGS

- name: Compress Wrapper Binary
- name: Compress wrapper binary
if: matrix.ghc == '8.10.7'
id: compress_wrapper_binary
run: |
Expand All @@ -139,8 +144,8 @@ jobs:
echo ::set-output name=extension::gz
fi

- name: Upload Wrapper
if: matrix.ghc == '8.10.7'
- name: Upload wrapper to the release
if: ${{ matrix.ghc == '8.10.7' && !contains(github.ref_name, 'check') }}
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -150,31 +155,34 @@ jobs:
asset_name: haskell-language-server-wrapper-${{ runner.OS }}${{env.EXE_EXT}}.${{ steps.compress_wrapper_binary.outputs.extension }}
asset_content_type: ${{ steps.compress_wrapper_binary.outputs.content_type}}

- uses: actions/upload-artifact@v2
- name: Upload wrapper to workflow artifacts
uses: actions/upload-artifact@v2
if: matrix.ghc == '8.10.7'
with:
name: haskell-language-server-wrapper-${{ runner.OS }}${{env.EXE_EXT}}.${{ steps.compress_wrapper_binary.outputs.extension }}
path: ${{ steps.compress_wrapper_binary.outputs.path }}
# generates a custom tarball with sources, used by `ghcup compile hls`

# generates a custom tarball with sources, used by `ghcup compile hls`
src-tar:
needs: build
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: "Create source tarball"

- name: Create source tarball
run: |
mkdir src-dist
git archive --prefix=haskell-language-server-${{ github.event.release.tag_name }}/ \
--format=tar.gz \
-o src-dist/haskell-language-server.tar.gz \
HEAD

- uses: actions/[email protected]

- name: Upload source tarball to the release
if: ${{ !contains(github.ref_name, 'check') }}
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand All @@ -183,11 +191,12 @@ jobs:
asset_name: haskell-language-server-${{ github.event.release.tag_name }}-src.tar.gz
asset_content_type: application/gzip

- uses: actions/upload-artifact@v2
- name: Upload source tarball to workflow artifacts
uses: actions/upload-artifact@v2
with:
name: haskell-language-server-${{ github.event.release.tag_name }}-src.tar.gz
path: src-dist/haskell-language-server.tar.gz

# this generates .gz tarfiles containing binaries for all GHC versions and OS's
# used by `ghcup install hls`
tar:
Expand All @@ -199,7 +208,8 @@ jobs:
steps:
- uses: actions/download-artifact@v2

- run: |
- name: Generate tarball with all binaries
run: |
# move the binaries for the specific platform into bin/
mkdir bin
mv haskell-language-server-${{ matrix.os }}-*/* bin
Expand All @@ -214,7 +224,9 @@ jobs:
fi
tar -czpf haskell-language-server.tar.gz *

- uses: actions/[email protected]
- name: Upload binaries tarball to the release
if: ${{ !contains(github.ref_name, 'check') }}
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand All @@ -223,7 +235,8 @@ jobs:
asset_name: haskell-language-server-${{ matrix.os }}-${{ github.event.release.tag_name }}.tar.gz
asset_content_type: application/gzip

- uses: actions/upload-artifact@v2
- name: Upload binaries tarball to workflow artifacts
uses: actions/upload-artifact@v2
with:
name: haskell-language-server-${{ matrix.os }}-${{ github.event.release.tag_name }}.tar.gz
path: bin/haskell-language-server.tar.gz
Expand All @@ -234,13 +247,15 @@ jobs:
steps:
- uses: actions/download-artifact@v2

- run: |
# generate sha256 sums for all current artifacts
- name: Generate sha256 sums for all workflow artifacts
run: |
sha256sum --tag haskell-language-server*/* >> SHA256SUMS
# we clean up tags to match the release file names
sed -i 's/\/.*)/)/g' SHA256SUMS

- uses: actions/[email protected]
- name: Upload sha256sums to the release
if: ${{ !contains(github.ref_name, 'check') }}
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand All @@ -249,7 +264,8 @@ jobs:
asset_name: SHA256SUMS
asset_content_type: plain/text

- uses: actions/upload-artifact@v2
- name: Upload sha256sums to workflow artifacts
uses: actions/upload-artifact@v2
with:
name: SHA256SUMS
path: SHA256SUMS
62 changes: 43 additions & 19 deletions docs/contributing/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,38 @@ and it is being used in nix environments.

## Minimal checklist

### prerelease sanity checks

- [ ] create a branch named `${version}-check-hackage`: it will trigger the hackage workflow *without* uploading the packages
- [ ] trigger the build workflow pushing a branch named `${version}-check-build`
- [ ] 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
### github release

* [ ] 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.
- [ ] 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.
Nix users should run command `gen-hls-changelogs` (a wrapper of the script) in nix-shell instead.
* [ ] add that list to the actual [Changelog](https://github.com/haskell/haskell-language-server/blob/master/ChangeLog.md) with a description of the release.
* [ ] 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).
* [ ] create the tag and make an initial prerelease to trigger the ci workflow (see details below)
* [ ] 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
* [ ] check uploaded binaries (see windows note below) and the release description (usually the changelog entry) and uncheck the prerelease box
* [ ] 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:)

- [ ] add that list to the actual [Changelog](https://github.com/haskell/haskell-language-server/blob/master/ChangeLog.md) with a description of the release.
- [ ] 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).
- [ ] create the tag and make an initial prerelease to trigger the ci workflow (see details below)
- [ ] 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
- [ ] in the github release edit page, check the attached binaries and the release description (usually the changelog entry) and uncheck the prerelease box
- [ ] make public the release in the usual social channels (not required but useful to spread the word :slightly_smiling_face:):
- [ ] irc
- [ ] matrix
- [ ] twitter
- [ ] discord
- [ ] discourse
- [ ] reddit
### hackage release

* [ ] bump up package versions following the [pvp specification](https://pvp.haskell.org/) if they are not already updated
* [ ] create ${version}-hackage branch to trigger the hackage github workflow which will upload all changed packages to hackage as candidates
* [ ] check manually candidates in hackage
* [ ] publish them definitely
- [ ] 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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how is this different to the previous verison-bumping step on line 29? should there just be one version-bumping step done before any releasing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The difference is in the All are optional but haskell-language-server itself part. For hackage bump up versions following pvp is mandatory. For the github release you only need to bump up hls itself.
At the beginning we did not have the github and hackage release in sync and we only bumped up plugin and package versions in a systematic way for the hackage one. In last releases i bumped up versions before start the release engine.

- [ ] create ${version}-hackage branch to trigger the hackage github workflow which will upload all changed packages to hackage as candidates
- [ ] check manually candidates in hackage
- [ ] publish them definitely

### ghcup release

* [ ] 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
* [ ] change ghcup metadata to include the new release in https://github.com/haskell/ghcup-metadata

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

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

That script checks, generates the tar.gz files, unpacks and builds them in isolation against hackage head
if the package version in the branch is different from hackage.
If the package in the branch has the same version as the released one,
it will check the relevant files have not changed and will throw an error
otherwise.
That script checks, generates the tar.gz files, unpacks and builds them in isolation
against hackage head if the package version in the branch is different from hackage.
If the package in the branch has the same version as the released one, it will check
the relevant files have not changed and will throw an error otherwise.

You can trigger a build which only does the above step by pushing a branch named `${version}-check-hackage`.

The script will upload the tarballs as candidates, maintainers will have to check and publish them definitely.

## haskell gitlab release pipeline

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