-
-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use ghc+integer-gmp for alpine linux build release (#2615)
* Remove integer-simple workaround * Skip upload to the release * Fix echo cabal.project * Echo PATH * Use specific cache for build * runner not allowed out of steps * Use common cache * Use raw ubuntu for ghc-9.2.1 * Enable alpine for ghc-9.2.1 * Replace gitrev with githash * Handle GitInfo exception As it breaks `cabal install` * Clean up build workflow
- Loading branch information
Showing
5 changed files
with
82 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,10 +11,10 @@ on: | |
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
container: ${{ (matrix.os == 'ubuntu-18.04' && 'alpine:3.12') || '' }} | ||
container: ${{ (startsWith(matrix.os,'ubuntu') && 'alpine:3.12') || '' }} | ||
defaults: | ||
run: | ||
shell: ${{ (matrix.os == 'windows-latest' && 'bash') || 'sh' }} | ||
shell: ${{ (startsWith(matrix.os,'windows') && 'bash') || 'sh' }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -35,58 +35,45 @@ jobs: | |
|
||
steps: | ||
- name: Install system dependencies | ||
if: matrix.os == 'ubuntu-18.04' | ||
if: runner.os == 'Linux' | ||
run: | | ||
apk add --no-cache curl gcc g++ gmp-dev ncurses-dev libffi-dev make xz gzip tar perl git bash sudo binutils-gold | ||
apk add --no-cache zlib zlib-dev zlib-static gmp gmp-dev ncurses-static | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Disable tests and bechmarks | ||
run: | | ||
echo -e 'tests: false' >> cabal.project.local | ||
echo -e 'benchmarks: false' >> cabal.project.local | ||
echo "tests: false" >> cabal.project.local | ||
echo "benchmarks: false" >> cabal.project.local | ||
- uses: ./.github/actions/setup-build | ||
with: | ||
ghc: ${{ matrix.ghc }} | ||
os: ${{ runner.os }} | ||
|
||
- name: (Windows) Platform specifics | ||
if: matrix.os == 'windows-latest' | ||
env: | ||
GHC_VER: ${{ matrix.ghc }} | ||
if: runner.os == 'Windows' | ||
run: | | ||
echo "EXE_EXT=.exe" >> $GITHUB_ENV | ||
echo "GHC_VERSION=$GHC_VER" >> $GITHUB_ENV | ||
- name: (Linux) Platform specifics | ||
if: matrix.os == 'ubuntu-18.04' | ||
env: | ||
GHC_VER: ${{ matrix.ghc }} | ||
run: | | ||
echo "LINUX_CABAL_ARGS=--enable-executable-static --ghc-options=-split-sections" >> $GITHUB_ENV | ||
echo "GHC_VERSION=$GHC_VER" >> $GITHUB_ENV | ||
- name: (macOS) Platform specifics | ||
if: matrix.os == 'macOS-latest' | ||
env: | ||
GHC_VER: ${{ matrix.ghc }} | ||
if: runner.os == 'Linux' | ||
run: | | ||
echo "GHC_VERSION=$GHC_VER" >> $GITHUB_ENV | ||
echo "CABAL_ARGS=--enable-executable-static --ghc-options=-split-sections" >> $GITHUB_ENV | ||
- name: Build the 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 | ||
cabal build exe:hls -O2 $CABAL_ARGS || cabal build exe:hls -O2 $CABAL_ARGS -j1 | ||
- name: Compress server binary | ||
id: compress_server_binary | ||
run: | | ||
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}} | ||
if [[ "$OSTYPE" == "msys" ]]; then | ||
7z a $HLS.zip $HLS${{env.EXE_EXT}} | ||
HLS=haskell-language-server-${{ matrix.ghc }} | ||
mv $HLS_BUILD $HLS${{ env.EXE_EXT }} | ||
if [[ "${{ runner.os }}" == "Windows" ]]; then | ||
7z a $HLS.zip $HLS${{ env.EXE_EXT }} | ||
echo ::set-output name=path::$HLS.zip | ||
echo ::set-output name=content_type::application/zip | ||
echo ::set-output name=extension::zip | ||
|
@@ -97,36 +84,36 @@ jobs: | |
echo ::set-output name=extension::gz | ||
fi | ||
- name: (not check) Upload server to release | ||
if: ${{ !contains(github.ref_name, 'check') }} | ||
- name: Upload server to release | ||
if: ${{ !contains(github.ref_name, 'check') && github.event.release.upload_url != ''}} | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ${{ steps.compress_server_binary.outputs.path }} | ||
asset_name: haskell-language-server-${{ runner.OS }}-${{ env.GHC_VERSION }}${{env.EXE_EXT}}.${{ steps.compress_server_binary.outputs.extension }} | ||
asset_name: haskell-language-server-${{ runner.os }}-${{ matrix.ghc }}${{env.EXE_EXT}}.${{ steps.compress_server_binary.outputs.extension }} | ||
asset_content_type: ${{ steps.compress_server_binary.outputs.content_type }} | ||
|
||
- 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 }} | ||
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: (GHC 8.10) Build the wrapper | ||
- name: Build the wrapper | ||
if: matrix.ghc == '8.10.7' | ||
run: cabal build exe:hls-wrapper -O2 $LINUX_CABAL_ARGS | ||
|
||
- name: (GHC 8.10) Compress wrapper binary | ||
- name: Compress wrapper binary | ||
if: matrix.ghc == '8.10.7' | ||
id: compress_wrapper_binary | ||
run: | | ||
HLS_WRAPPER_BUILD=$(find dist-newstyle \( -name 'hls-wrapper' -o -name 'hls-wrapper.exe' \) -type f) | ||
HLS_WRAPPER=haskell-language-server-wrapper | ||
mv $HLS_WRAPPER_BUILD $HLS_WRAPPER${{env.EXE_EXT}} | ||
if [[ "$OSTYPE" == "msys" ]]; then | ||
7z a $HLS_WRAPPER.zip $HLS_WRAPPER${{env.EXE_EXT}} | ||
mv $HLS_WRAPPER_BUILD $HLS_WRAPPER${{ env.EXE_EXT }} | ||
if [[ "${{ runner.os }}" == "Windows" ]]; then | ||
7z a $HLS_WRAPPER.zip $HLS_WRAPPER${{ env.EXE_EXT }} | ||
echo ::set-output name=path::$HLS_WRAPPER.zip | ||
echo ::set-output name=content_type::application/zip | ||
echo ::set-output name=extension::zip | ||
|
@@ -137,22 +124,22 @@ jobs: | |
echo ::set-output name=extension::gz | ||
fi | ||
- name: (GHC 8.10, not check) Upload wrapper to the release | ||
if: ${{ matrix.ghc == '8.10.7' && !contains(github.ref_name, 'check') }} | ||
- name: Upload wrapper to the release | ||
if: ${{ matrix.ghc == '8.10.7' && !contains(github.ref_name, 'check') && github.event.release.upload_url != '' }} | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ${{ steps.compress_wrapper_binary.outputs.path }} | ||
asset_name: haskell-language-server-wrapper-${{ runner.OS }}${{env.EXE_EXT}}.${{ steps.compress_wrapper_binary.outputs.extension }} | ||
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}} | ||
|
||
- name: (GHC 8.10) Upload wrapper to workflow artifacts | ||
- 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 }} | ||
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` | ||
|
@@ -163,29 +150,38 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set hls release version | ||
run: | | ||
HLS_VER="${{ github.event.release.tag_name }}" | ||
if [[ -z $HLS_VER ]]; then | ||
HLS_VER=${{ github.sha }} | ||
HLS_VER=${HLS_VER:0:5} | ||
fi | ||
echo "HLS_VER=$HLS_VER" >> $GITHUB_ENV | ||
- name: Create source tarball | ||
run: | | ||
mkdir src-dist | ||
git archive --prefix=haskell-language-server-${{ github.event.release.tag_name }}/ \ | ||
git archive --prefix=haskell-language-server-${{ env.HLS_VER }}/ \ | ||
--format=tar.gz \ | ||
-o src-dist/haskell-language-server.tar.gz \ | ||
HEAD | ||
- name: (not check) Upload source tarball to the release | ||
if: ${{ !contains(github.ref_name, 'check') }} | ||
- name: Upload source tarball to the release | ||
if: ${{ !contains(github.ref_name, 'check') && github.event.release.upload_url != '' }} | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: src-dist/haskell-language-server.tar.gz | ||
asset_name: haskell-language-server-${{ github.event.release.tag_name }}-src.tar.gz | ||
asset_name: haskell-language-server-${{ env.HLS_VER }}-src.tar.gz | ||
asset_content_type: application/gzip | ||
|
||
- 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 | ||
name: haskell-language-server-${{ env.HLS_VER }}-src.tar.gz | ||
path: src-dist/haskell-language-server.tar.gz | ||
|
||
# this generates .gz tarfiles containing binaries for all GHC versions and OS's | ||
|
@@ -195,44 +191,53 @@ jobs: | |
runs-on: ubuntu-18.04 | ||
strategy: | ||
matrix: | ||
os: [ "Linux" | ||
, "macOS" | ||
, "Windows" | ||
] | ||
target-os: [ "Linux" | ||
, "macOS" | ||
, "Windows" | ||
] | ||
steps: | ||
- uses: actions/download-artifact@v2 | ||
|
||
- 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 | ||
mv haskell-language-server-wrapper-${{ matrix.os }}.*/* bin | ||
mv haskell-language-server-${{ matrix.target-os }}-*/* bin | ||
mv haskell-language-server-wrapper-${{ matrix.target-os }}.*/* bin | ||
# decompress them | ||
cd bin | ||
if [[ "${{ matrix.os }}" == "Windows" ]]; then | ||
if [[ "${{ matrix.target-os }}" == "Windows" ]]; then | ||
7z x "*.zip" | ||
rm *.zip | ||
else | ||
gzip -d *.gz | ||
fi | ||
tar -czpf haskell-language-server.tar.gz * | ||
- name: (not check) Upload binaries tarball to the release | ||
if: ${{ !contains(github.ref_name, 'check') }} | ||
- name: Upload binaries tarball to the release | ||
if: ${{ !contains(github.ref_name, 'check') && github.event.release.upload_url != '' }} | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: bin/haskell-language-server.tar.gz | ||
asset_name: haskell-language-server-${{ matrix.os }}-${{ github.event.release.tag_name }}.tar.gz | ||
asset_name: haskell-language-server-${{ matrix.target-os }}-${{ github.event.release.tag_name }}.tar.gz | ||
asset_content_type: application/gzip | ||
|
||
- name: Set hls release version | ||
run: | | ||
HLS_VER="${{ github.event.release.tag_name }}" | ||
if [[ -z $HLS_VER ]]; then | ||
HLS_VER=${{ github.sha }} | ||
HLS_VER=${HLS_VER:0:5} | ||
fi | ||
echo "HLS_VER=$HLS_VER" >> $GITHUB_ENV | ||
- 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 | ||
name: haskell-language-server-${{ matrix.target-os }}-${{ env.HLS_VER }}.tar.gz | ||
path: bin/haskell-language-server.tar.gz | ||
|
||
sha256sum: | ||
|
@@ -247,8 +252,8 @@ jobs: | |
# we clean up tags to match the release file names | ||
sed -i 's/\/.*)/)/g' SHA256SUMS | ||
- name: (not check) Upload sha256sums to the release | ||
if: ${{ !contains(github.ref_name, 'check') }} | ||
- name: Upload sha256sums to the release | ||
if: ${{ !contains(github.ref_name, 'check') && github.event.release.upload_url != '' }} | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,7 +71,7 @@ library | |
, data-default | ||
, ghc | ||
, ghcide ^>=1.4 || ^>=1.5 | ||
, gitrev | ||
, githash | ||
, lsp | ||
, hie-bios | ||
, hiedb | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters