Skip to content

Commit

Permalink
Add windows to ghcup artifacts and generate sha256 sums (#1970)
Browse files Browse the repository at this point in the history
* Add windows to ghcup artifacts

* Add 7z compress

* Make move generic per os

* Generate sha256 sums

* Include .tar.gz and sums in artefacts

* Clean up sha256sums tags
  • Loading branch information
jneira authored Jun 30, 2021
1 parent a7321ac commit 2df3d30
Showing 1 changed file with 42 additions and 6 deletions.
48 changes: 42 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
GHC_VER: ${{ matrix.ghc }}
run: |
echo "EXE_EXT=.exe" >> $GITHUB_ENV
# We normalize windows+choco ghc version 8.10.2.2
GHC_VER=$(echo $GHC_VER | sed 's/8.10.2.2/8.10.2/g')
echo "GHC_VERSION=$GHC_VER" >> $GITHUB_ENV
Expand All @@ -74,7 +75,7 @@ jobs:
run: |
echo "GHC_VERSION=$GHC_VER" >> $GITHUB_ENV
- name: Tentative Workaround for GHC 8.10.5 on macOS
- name: Workaround for GHC 8.10.5 on macOS
if: matrix.os == 'macOS-latest' && matrix.ghc == '8.10.5'
run: |
echo "# uninstalling CommandLineTools (see https://github.com/haskell/haskell-language-server/issues/1913#issuecomment-861667786)"
Expand All @@ -89,7 +90,6 @@ jobs:
- name: Compress Server Binary
id: compress_server_binary
run: |
# We normalize windows+choco ghc version 8.10.2.2
HLS_BUILD=$(find dist-newstyle \( -name 'hls' -o -name 'hls.exe' \) -type f)
HLS=haskell-language-server-${{env.GHC_VERSION}}
mv $HLS_BUILD $HLS${{env.EXE_EXT}}
Expand Down Expand Up @@ -167,18 +167,23 @@ jobs:
runs-on: ubuntu-18.04
strategy:
matrix:
os: [Linux, macOS]
os: [Linux, macOS, Windows]
steps:
- uses: actions/download-artifact@v2

- run: |
# move the binaries for the specific platform into bin/
mkdir bin
mv haskell-language-server-${{ matrix.os }}-*.gz/haskell-language-server-*.gz bin
mv haskell-language-server-wrapper-${{ matrix.os }}.gz/haskell-language-server-wrapper.gz bin
mv haskell-language-server-${{ matrix.os }}-*/* bin
mv haskell-language-server-wrapper-${{ matrix.os }}.*/* bin
# decompress them
gzip -d bin/*.gz
cd bin
if [[ "${{ matrix.os }}" == "Windows" ]]; then
7z x "*.zip"
rm *.zip
else
gzip -d *.gz
fi
tar -czpf haskell-language-server.tar.gz *
- uses: actions/[email protected]
Expand All @@ -189,3 +194,34 @@ jobs:
asset_path: bin/haskell-language-server.tar.gz
asset_name: haskell-language-server-${{ matrix.os }}-${{ github.event.release.tag_name }}.tar.gz
asset_content_type: application/gzip

- 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

sha256sum:
needs: tar
runs-on: ubuntu-18.04
steps:
- uses: actions/download-artifact@v2

- run: |
# generate sha256 sums for all current artifacts
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]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: SHA256SUMS
asset_name: SHA256SUMS
asset_content_type: plain/text

- uses: actions/upload-artifact@v2
with:
name: SHA256SUMS
path: SHA256SUMS

0 comments on commit 2df3d30

Please sign in to comment.