Skip to content

Commit 2df3d30

Browse files
authored
Add windows to ghcup artifacts and generate sha256 sums (#1970)
* 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
1 parent a7321ac commit 2df3d30

File tree

1 file changed

+42
-6
lines changed

1 file changed

+42
-6
lines changed

.github/workflows/build.yml

+42-6
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ jobs:
5656
GHC_VER: ${{ matrix.ghc }}
5757
run: |
5858
echo "EXE_EXT=.exe" >> $GITHUB_ENV
59+
# We normalize windows+choco ghc version 8.10.2.2
5960
GHC_VER=$(echo $GHC_VER | sed 's/8.10.2.2/8.10.2/g')
6061
echo "GHC_VERSION=$GHC_VER" >> $GITHUB_ENV
6162
@@ -74,7 +75,7 @@ jobs:
7475
run: |
7576
echo "GHC_VERSION=$GHC_VER" >> $GITHUB_ENV
7677
77-
- name: Tentative Workaround for GHC 8.10.5 on macOS
78+
- name: Workaround for GHC 8.10.5 on macOS
7879
if: matrix.os == 'macOS-latest' && matrix.ghc == '8.10.5'
7980
run: |
8081
echo "# uninstalling CommandLineTools (see https://github.com/haskell/haskell-language-server/issues/1913#issuecomment-861667786)"
@@ -89,7 +90,6 @@ jobs:
8990
- name: Compress Server Binary
9091
id: compress_server_binary
9192
run: |
92-
# We normalize windows+choco ghc version 8.10.2.2
9393
HLS_BUILD=$(find dist-newstyle \( -name 'hls' -o -name 'hls.exe' \) -type f)
9494
HLS=haskell-language-server-${{env.GHC_VERSION}}
9595
mv $HLS_BUILD $HLS${{env.EXE_EXT}}
@@ -167,18 +167,23 @@ jobs:
167167
runs-on: ubuntu-18.04
168168
strategy:
169169
matrix:
170-
os: [Linux, macOS]
170+
os: [Linux, macOS, Windows]
171171
steps:
172172
- uses: actions/download-artifact@v2
173173

174174
- run: |
175175
# move the binaries for the specific platform into bin/
176176
mkdir bin
177-
mv haskell-language-server-${{ matrix.os }}-*.gz/haskell-language-server-*.gz bin
178-
mv haskell-language-server-wrapper-${{ matrix.os }}.gz/haskell-language-server-wrapper.gz bin
177+
mv haskell-language-server-${{ matrix.os }}-*/* bin
178+
mv haskell-language-server-wrapper-${{ matrix.os }}.*/* bin
179179
# decompress them
180-
gzip -d bin/*.gz
181180
cd bin
181+
if [[ "${{ matrix.os }}" == "Windows" ]]; then
182+
7z x "*.zip"
183+
rm *.zip
184+
else
185+
gzip -d *.gz
186+
fi
182187
tar -czpf haskell-language-server.tar.gz *
183188
184189
- uses: actions/upload-release-asset@v1.0.2
@@ -189,3 +194,34 @@ jobs:
189194
asset_path: bin/haskell-language-server.tar.gz
190195
asset_name: haskell-language-server-${{ matrix.os }}-${{ github.event.release.tag_name }}.tar.gz
191196
asset_content_type: application/gzip
197+
198+
- uses: actions/upload-artifact@v2
199+
with:
200+
name: haskell-language-server-${{ matrix.os }}-${{ github.event.release.tag_name }}.tar.gz
201+
path: bin/haskell-language-server.tar.gz
202+
203+
sha256sum:
204+
needs: tar
205+
runs-on: ubuntu-18.04
206+
steps:
207+
- uses: actions/download-artifact@v2
208+
209+
- run: |
210+
# generate sha256 sums for all current artifacts
211+
sha256sum --tag haskell-language-server*/* >> SHA256SUMS
212+
# we clean up tags to match the release file names
213+
sed -i 's/\/.*)/)/g' SHA256SUMS
214+
215+
- uses: actions/upload-release-asset@v1.0.2
216+
env:
217+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
218+
with:
219+
upload_url: ${{ github.event.release.upload_url }}
220+
asset_path: SHA256SUMS
221+
asset_name: SHA256SUMS
222+
asset_content_type: plain/text
223+
224+
- uses: actions/upload-artifact@v2
225+
with:
226+
name: SHA256SUMS
227+
path: SHA256SUMS

0 commit comments

Comments
 (0)