From 98336a599f74bde003dec7bd57cc9ceb1ca66b9a Mon Sep 17 00:00:00 2001 From: jneira Date: Thu, 18 Nov 2021 13:58:50 +0100 Subject: [PATCH 1/4] Check the build workflow --- .github/workflows/build.yml | 70 +++++++++++++++++++++++-------------- 1 file changed, 43 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5c666fed75..e3d9d6824a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,6 +7,9 @@ defaults: on: release: types: [created] + push: + branches: + - '*-check-build' jobs: build: @@ -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 @@ -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) @@ -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/upload-release-asset@v1.0.2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -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: | @@ -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/upload-release-asset@v1.0.2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -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/upload-release-asset@v1.0.2 + + - name: Upload source tarball to the release + if: ${{ !contains(github.ref_name, 'check') }} + uses: actions/upload-release-asset@v1.0.2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -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: @@ -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 @@ -214,7 +224,9 @@ jobs: fi tar -czpf haskell-language-server.tar.gz * - - uses: actions/upload-release-asset@v1.0.2 + - name: Upload binaries tarball to the release + if: ${{ !contains(github.ref_name, 'check') }} + uses: actions/upload-release-asset@v1.0.2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -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 @@ -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/upload-release-asset@v1.0.2 + - name: Upload sha256sums to the release + if: ${{ !contains(github.ref_name, 'check') }} + uses: actions/upload-release-asset@v1.0.2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -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 From b0497135879a9d7d446d297bb9e5b5e6baf46471 Mon Sep 17 00:00:00 2001 From: jneira Date: Thu, 18 Nov 2021 13:59:14 +0100 Subject: [PATCH 2/4] Add gitlab/ghcup specific intructions --- docs/contributing/releases.md | 62 ++++++++++++++++++++++++----------- 1 file changed, 43 insertions(+), 19 deletions(-) diff --git a/docs/contributing/releases.md b/docs/contributing/releases.md index 7f8bd40ee0..a4d14410eb 100644 --- a/docs/contributing/releases.md +++ b/docs/contributing/releases.md @@ -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 +- [ ] 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 (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. +- [ ] 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 @@ -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 only doing the above step pushing a branch named `*-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 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. From f5275b96d8f6c2f84f2327522848d4c7ffe0f2d2 Mon Sep 17 00:00:00 2001 From: Javier Neira Date: Tue, 23 Nov 2021 08:15:19 +0100 Subject: [PATCH 3/4] Apply suggestions from @michaelpj Co-authored-by: Michael Peyton Jones --- docs/contributing/releases.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/contributing/releases.md b/docs/contributing/releases.md index a4d14410eb..ec2561f33e 100644 --- a/docs/contributing/releases.md +++ b/docs/contributing/releases.md @@ -160,14 +160,14 @@ against hackage head if the package version in the branch is different from hack 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 only doing the above step pushing a branch named `*-check-hackage`. +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 project is present in the haskell gitlab server: https://gitlab.haskell.org/haskell/haskell-language-server -The main motivation is leverage the ci infrastructure which includes architectures not included in the github ci. +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) From 36eae549f3d396a74bc58243b4c2120e3a62e08e Mon Sep 17 00:00:00 2001 From: Javier Neira Date: Tue, 23 Nov 2021 08:27:49 +0100 Subject: [PATCH 4/4] Note where are release artifacts --- docs/contributing/releases.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/contributing/releases.md b/docs/contributing/releases.md index ec2561f33e..37100bf6cb 100644 --- a/docs/contributing/releases.md +++ b/docs/contributing/releases.md @@ -29,7 +29,7 @@ and it is being used in nix environments. - [ ] 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 +- [ ] 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