Build and release #105
Workflow file for this run
This file contains hidden or 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
name: Build and release | |
on: | |
push: | |
tags: | |
- '*' | |
env: | |
CABAL_CACHE_DISABLE: ${{ vars.CABAL_CACHE_DISABLE }} | |
CABAL_CACHE_NONFATAL: ${{ vars.CABAL_CACHE_NONFATAL }} | |
jobs: | |
build-linux: | |
name: Build linux binaries | |
## We need the environment here, to have access to the `vars` context. | |
## Allows us to specify: `CABAL_CACHE_DISABLE=yes`. | |
## The environments can be seen in https://github.com/haskell/haskell-language-server/settings/environments | |
## assuming you have the proper permissions. | |
environment: CI | |
runs-on: ${{ matrix.platform.runner }} | |
env: | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
S3_HOST: ${{ secrets.S3_HOST }} | |
TARBALL_EXT: tar.xz | |
ARCH: 64 | |
DEBIAN_FRONTEND: noninteractive | |
TZ: Asia/Singapore | |
strategy: | |
fail-fast: false | |
matrix: | |
ghc: ["9.12.2", "9.10.1", "9.8.4", "9.6.7", "9.4.8"] | |
platform: [ { image: "alpine:3.16" | |
, installCmd: "apk add" | |
, toolRequirements: "curl gcc g++ binutils binutils-gold coreutils bsd-compat-headers gmp-dev ncurses-dev libffi-dev make xz tar perl bash diffutils git gzip gnupg autoconf automake patchelf zlib zlib-dev bzip2 bzip2-dev findutils" | |
, DISTRO: "Alpine" | |
, ARTIFACT: "x86_64-linux-alpine316" | |
, ADD_CABAL_ARGS: "--enable-split-sections" | |
, runner: "ubuntu-latest" | |
, ARCH: 64 | |
}, | |
{ image: "alpine:3.18" | |
, installCmd: "apk add" | |
, toolRequirements: "curl gcc g++ binutils binutils-gold coreutils bsd-compat-headers gmp-dev ncurses-dev libffi-dev make xz tar perl bash diffutils git gzip gnupg autoconf automake patchelf zlib zlib-dev bzip2 bzip2-dev findutils" | |
, DISTRO: "Alpine" | |
, ARTIFACT: "x86_64-linux-alpine318" | |
, ADD_CABAL_ARGS: "--enable-split-sections" | |
, runner: "ubuntu-latest" | |
, ARCH: 64 | |
}, | |
{ image: "fedora:33" | |
, installCmd: "dnf install -y" | |
, toolRequirements: "autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils-libs findutils gcc gcc-c++ git gmp gmp-devel jq lbzip2 make ncurses ncurses-compat-libs ncurses-devel openssh-clients patch perl pxz python3 sqlite sudo wget which xz zlib-devel patchelf" | |
, DISTRO: "Fedora" | |
, ARTIFACT: "x86_64-linux-fedora33" | |
, ADD_CABAL_ARGS: "--enable-split-sections" | |
, runner: "ubuntu-latest" | |
, ARCH: 64 | |
}, | |
{ image: "fedora:38" | |
, installCmd: "dnf install -y" | |
, toolRequirements: "autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils-libs findutils gcc gcc-c++ git gmp gmp-devel jq lbzip2 make ncurses ncurses-compat-libs ncurses-devel openssh-clients patch perl pxz python3 sqlite sudo wget which xz zlib-devel patchelf" | |
, DISTRO: "Fedora" | |
, ARTIFACT: "x86_64-linux-fedora38" | |
, ADD_CABAL_ARGS: "--enable-split-sections" | |
, runner: "ubuntu-latest" | |
, ARCH: 64 | |
} | |
] | |
container: | |
image: ${{ matrix.platform.image }} | |
steps: | |
- name: Install requirements | |
shell: sh | |
run: | | |
${{ matrix.platform.installCmd }} curl bash git ${{ matrix.platform.toolRequirements }} | |
- if: matrix.platform.DISTRO == 'Unknown' | |
run: | | |
echo "NAME=Linux" > /etc/os-release | |
echo "ID=linux" >> /etc/os-release | |
echo "PRETTY_NAME=Linux" >> /etc/os-release | |
- uses: actions/checkout@v4 | |
- name: Run build | |
run: | | |
bash .github/scripts/build.sh | |
tar cf out-${ARTIFACT}-${GHC_VERSION}.tar out/ store/ | |
env: | |
ARTIFACT: ${{ matrix.platform.ARTIFACT }} | |
DISTRO: ${{ matrix.platform.DISTRO }} | |
ADD_CABAL_ARGS: ${{ matrix.platform.ADD_CABAL_ARGS }} | |
GHC_VERSION: ${{ matrix.ghc }} | |
ARCH: ${{ matrix.platform.ARCH }} | |
- if: always() | |
name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
if-no-files-found: error | |
retention-days: 2 | |
name: artifacts-${{ matrix.platform.ARTIFACT }}-${{ matrix.ghc }} | |
path: | | |
./out-${{ matrix.platform.ARTIFACT }}-${{ matrix.ghc }}.tar | |
bindist-linux: | |
name: Tar linux bindists (linux) | |
runs-on: ${{ matrix.runs-on }} | |
needs: ["build-linux"] | |
env: | |
TARBALL_EXT: tar.xz | |
DEBIAN_FRONTEND: noninteractive | |
TZ: Asia/Singapore | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- image: "alpine:3.16" | |
installCmd: "apk add" | |
toolRequirements: "curl gcc g++ binutils binutils-gold coreutils bsd-compat-headers gmp-dev ncurses-dev libffi-dev make xz tar perl bash diffutils git gzip gnupg autoconf automake patchelf zlib zlib-dev bzip2 bzip2-dev findutils" | |
DISTRO: "Alpine" | |
ARCH: 64 | |
ARTIFACT: "x86_64-linux-alpine316" | |
runs-on: [self-hosted, linux-space, maerwald] | |
- image: "alpine:3.18" | |
installCmd: "apk add" | |
toolRequirements: "curl gcc g++ binutils binutils-gold coreutils bsd-compat-headers gmp-dev ncurses-dev libffi-dev make xz tar perl bash diffutils git gzip gnupg autoconf automake patchelf zlib zlib-dev bzip2 bzip2-dev findutils" | |
DISTRO: "Alpine" | |
ARCH: 64 | |
ARTIFACT: "x86_64-linux-alpine318" | |
runs-on: [self-hosted, linux-space, maerwald] | |
- image: fedora:33 | |
installCmd: dnf install -y | |
toolRequirements: autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils-libs findutils gcc gcc-c++ git gmp gmp-devel jq lbzip2 make ncurses ncurses-compat-libs ncurses-devel openssh-clients patch perl pxz python3 sqlite sudo wget which xz zlib-devel patchelf tree | |
DISTRO: Fedora | |
ARCH: 64 | |
ARTIFACT: "x86_64-linux-fedora33" | |
runs-on: [self-hosted, linux-space, maerwald] | |
- image: fedora:38 | |
installCmd: dnf install -y | |
toolRequirements: autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils-libs findutils gcc gcc-c++ git gmp gmp-devel jq lbzip2 make ncurses ncurses-compat-libs ncurses-devel openssh-clients patch perl pxz python3 sqlite sudo wget which xz zlib-devel patchelf tree | |
DISTRO: Fedora | |
ARCH: 64 | |
ARTIFACT: "x86_64-linux-fedora38" | |
runs-on: [self-hosted, linux-space, maerwald] | |
container: | |
image: ${{ matrix.image }} | |
steps: | |
- name: Install requirements | |
shell: sh | |
run: | | |
${{ matrix.installCmd }} curl bash git ${{ matrix.toolRequirements }} | |
- if: matrix.DISTRO == 'Unknown' | |
run: | | |
echo "NAME=Linux" > /etc/os-release | |
echo "ID=linux" >> /etc/os-release | |
echo "PRETTY_NAME=Linux" >> /etc/os-release | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: artifacts-${{ matrix.ARTIFACT }}-* | |
merge-multiple: true | |
path: ./ | |
- name: Create bindist | |
run: | | |
set -eux | |
for bindist in out-*.tar ; do | |
tar -xf "${bindist}" | |
done | |
unset bindist | |
bash .github/scripts/bindist.sh | |
env: | |
ARTIFACT: ${{ matrix.ARTIFACT }} | |
ARCH: ${{ matrix.ARCH }} | |
- name: Upload bindist | |
uses: actions/upload-artifact@v4 | |
with: | |
if-no-files-found: error | |
name: bindists-${{ matrix.ARTIFACT }} | |
path: | | |
./out/*.tar.xz | |
./out/plan.json/* | |
- uses: geekyeggo/delete-artifact@v5 | |
with: | |
name: artifacts-${{ matrix.ARTIFACT }}-* | |
test-linux: | |
name: Test linux binaries | |
runs-on: ${{ matrix.runs-on }} | |
needs: ["bindist-linux"] | |
env: | |
TARBALL_EXT: tar.xz | |
DEBIAN_FRONTEND: noninteractive | |
TZ: Asia/Singapore | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- image: "alpine:3.16" | |
installCmd: "apk add" | |
toolRequirements: "curl gcc g++ binutils binutils-gold coreutils bsd-compat-headers gmp-dev ncurses-dev libffi-dev make xz tar perl bash diffutils git gzip gnupg autoconf automake patchelf tree zlib zlib-dev bzip2 bzip2-dev findutils" | |
DISTRO: "Alpine" | |
ARTIFACT: "x86_64-linux-alpine316" | |
ARCH: 64 | |
runs-on: ubuntu-latest | |
- image: "alpine:3.18" | |
installCmd: "apk add" | |
toolRequirements: "curl gcc g++ binutils binutils-gold coreutils bsd-compat-headers gmp-dev ncurses-dev libffi-dev make xz tar perl bash diffutils git gzip gnupg autoconf automake patchelf tree zlib zlib-dev bzip2 bzip2-dev findutils" | |
DISTRO: "Alpine" | |
ARTIFACT: "x86_64-linux-alpine318" | |
ARCH: 64 | |
runs-on: ubuntu-latest | |
- image: fedora:33 | |
installCmd: dnf install -y | |
toolRequirements: autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils-libs findutils gcc gcc-c++ git gmp gmp-devel jq lbzip2 make ncurses ncurses-compat-libs ncurses-devel openssh-clients patch perl pxz python3 sqlite sudo wget which xz zlib-devel patchelf tree | |
DISTRO: Fedora | |
ARTIFACT: "x86_64-linux-fedora33" | |
ARCH: 64 | |
runs-on: ubuntu-latest | |
- image: fedora:38 | |
installCmd: dnf install -y | |
toolRequirements: autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils-libs findutils gcc gcc-c++ git gmp gmp-devel jq lbzip2 make ncurses ncurses-compat-libs ncurses-devel openssh-clients patch perl pxz python3 sqlite sudo wget which xz zlib-devel patchelf tree | |
DISTRO: Fedora | |
ARTIFACT: "x86_64-linux-fedora38" | |
ARCH: 64 | |
runs-on: ubuntu-latest | |
container: | |
image: ${{ matrix.image }} | |
steps: | |
- name: Install requirements | |
shell: sh | |
run: | | |
${{ matrix.installCmd }} curl bash git ${{ matrix.toolRequirements }} | |
- if: matrix.DISTRO == 'Unknown' | |
run: | | |
echo "NAME=Linux" > /etc/os-release | |
echo "ID=linux" >> /etc/os-release | |
echo "PRETTY_NAME=Linux" >> /etc/os-release | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: bindists-${{ matrix.ARTIFACT }} | |
path: ./out | |
- name: Run test | |
run: bash .github/scripts/test.sh | |
env: | |
ARTIFACT: ${{ matrix.ARTIFACT }} | |
DISTRO: ${{ matrix.DISTRO }} | |
ARCH: ${{ matrix.ARCH }} | |
release: | |
name: release | |
needs: ["test-linux"] | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: bindists-* | |
merge-multiple: true | |
path: ./out | |
- name: Install requirements | |
run: | | |
sudo apt-get update && sudo apt-get install -y tar xz-utils | |
shell: bash | |
- name: tar plan.json | |
run: | | |
cd out/plan.json | |
tar cf plan_json.tar * | |
mv plan_json.tar ../ | |
shell: bash | |
- name: build source tarball | |
run: | | |
export RELEASE=$GITHUB_REF_NAME | |
git archive --format=tar.gz -o "out/haskell-language-server-${RELEASE}-src.tar.gz" --prefix="haskell-language-server-${RELEASE}/" HEAD | |
shell: bash | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
draft: true | |
files: | | |
./out/*.tar.xz | |
./out/*.tar.gz | |
./out/*.tar |