Build and release #15
Workflow file for this run
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
name: Build and release | |
on: | |
push: | |
tags: | |
- 'cabal-install-*' | |
jobs: | |
build-linux: | |
name: Build linux binaries | |
runs-on: ubuntu-latest | |
env: | |
TARBALL_EXT: tar.xz | |
ARCH: 64 | |
DEBIAN_FRONTEND: noninteractive | |
TZ: Asia/Singapore | |
GHC_VERSION: 9.8.2 | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [ { image: "debian:9" | |
, installCmd: "sed -i s/deb.debian.org/archive.debian.org/g /etc/apt/sources.list && sed -i 's|security.debian.org|archive.debian.org/|g' /etc/apt/sources.list && sed -i /-updates/d /etc/apt/sources.list && apt-get update && apt-get install -y" | |
, toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf" | |
, DISTRO: "Debian" | |
, ARTIFACT: "x86_64-linux-deb9" | |
, ADD_CABAL_ARGS: "--enable-split-sections" | |
}, | |
{ image: "debian:10" | |
, installCmd: "apt-get update && apt-get install -y" | |
, toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf" | |
, DISTRO: "Debian" | |
, ARTIFACT: "x86_64-linux-deb10" | |
, ADD_CABAL_ARGS: "--enable-split-sections" | |
}, | |
{ image: "debian:11" | |
, installCmd: "apt-get update && apt-get install -y" | |
, toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf" | |
, DISTRO: "Debian" | |
, ARTIFACT: "x86_64-linux-deb11" | |
, ADD_CABAL_ARGS: "--enable-split-sections" | |
}, | |
{ image: "ubuntu:18.04" | |
, installCmd: "apt-get update && apt-get install -y" | |
, toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf" | |
, DISTRO: "Ubuntu" | |
, ARTIFACT: "x86_64-linux-ubuntu18.04" | |
, ADD_CABAL_ARGS: "--enable-split-sections" | |
}, | |
{ image: "ubuntu:20.04" | |
, installCmd: "apt-get update && apt-get install -y" | |
, toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf" | |
, DISTRO: "Ubuntu" | |
, ARTIFACT: "x86_64-linux-ubuntu20.04" | |
, ADD_CABAL_ARGS: "--enable-split-sections" | |
}, | |
{ image: "ubuntu:22.04" | |
, installCmd: "apt-get update && apt-get install -y" | |
, toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf" | |
, DISTRO: "Ubuntu" | |
, ARTIFACT: "x86_64-linux-ubuntu22.04" | |
, ADD_CABAL_ARGS: "--enable-split-sections" | |
}, | |
{ image: "linuxmintd/mint20-amd64" | |
, installCmd: "apt-get update && apt-get install -y" | |
, toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf" | |
, DISTRO: "Mint" | |
, ARTIFACT: "x86_64-linux-mint20" | |
, ADD_CABAL_ARGS: "--enable-split-sections" | |
}, | |
{ image: "linuxmintd/mint21-amd64" | |
, installCmd: "apt-get update && apt-get install -y" | |
, toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf" | |
, DISTRO: "Mint" | |
, ARTIFACT: "x86_64-linux-mint21" | |
, ADD_CABAL_ARGS: "--enable-split-sections" | |
}, | |
{ image: "fedora:27" | |
, 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-fedora27" | |
, ADD_CABAL_ARGS: "--enable-split-sections" | |
}, | |
{ 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" | |
}, | |
{ image: "fedora:37" | |
, 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-fedora37" | |
, ADD_CABAL_ARGS: "--enable-split-sections" | |
}, | |
{ image: "centos:7" | |
, installCmd: "yum -y install epel-release && yum 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: "CentOS" | |
, ARTIFACT: "x86_64-linux-centos7" | |
, ADD_CABAL_ARGS: "--enable-split-sections" | |
}, | |
{ image: "rockylinux:8" | |
, installCmd: "yum -y install epel-release && yum install -y --allowerasing" | |
, 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: "Unknown" | |
, ARTIFACT: "x86_64-linux-rocky8" | |
, ADD_CABAL_ARGS: "--enable-split-sections" | |
}, | |
{ image: "rockylinux:9" | |
, installCmd: "yum -y install epel-release && yum install -y --allowerasing" | |
, 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: "Unknown" | |
, ARTIFACT: "x86_64-linux-rocky9" | |
, ADD_CABAL_ARGS: "--enable-split-sections" | |
}, | |
{ image: "alpine:latest" | |
, installCmd: "apk update && apk add" | |
, toolRequirements: "binutils-gold curl gcc g++ gmp-dev libc-dev libffi-dev make musl-dev ncurses-dev perl tar xz autoconf automake bzip2 coreutils elfutils-dev findutils git jq bzip2-dev patch python3 sqlite sudo wget which zlib-dev patchelf zlib zlib-dev zlib-static" | |
, DISTRO: "Unknown" | |
, ARTIFACT: "x86_64-linux-unknown" | |
, ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static" | |
}, | |
{ image: "alpine:3.12" | |
, installCmd: "apk update && apk add" | |
, toolRequirements: "binutils-gold curl gcc g++ gmp-dev libc-dev libffi-dev make musl-dev ncurses-dev perl tar xz autoconf automake bzip2 coreutils elfutils-dev findutils git jq bzip2-dev patch python3 sqlite sudo wget which zlib-dev patchelf zlib zlib-dev zlib-static" | |
, DISTRO: "Unknown" | |
, ARTIFACT: "x86_64-linux-alpine312" | |
, ADD_CABAL_ARGS: "--enable-split-sections" | |
}, | |
{ image: "alpine:3.19" | |
, installCmd: "apk update && apk add" | |
, toolRequirements: "binutils-gold curl gcc g++ gmp-dev libc-dev libffi-dev make musl-dev ncurses-dev perl tar xz autoconf automake bzip2 coreutils elfutils-dev findutils git jq bzip2-dev patch python3 sqlite sudo wget which zlib-dev patchelf zlib zlib-dev zlib-static" | |
, DISTRO: "Unknown" | |
, ARTIFACT: "x86_64-linux-alpine319" | |
, ADD_CABAL_ARGS: "--enable-split-sections" | |
}, | |
{ image: "ghcr.io/void-linux/void-glibc:latest" | |
, installCmd: "xbps-install -Sy" | |
, toolRequirements: "ncurses-libtinfo-libs autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils findutils gcc gmp gmp-devel jq lbzip2 make ncurses ncurses-devel openssh patch perl python3 sqlite sudo wget which xz tar zlib-devel patchelf" | |
, DISTRO: "Unknown" | |
, ARTIFACT: "x86_64-linux-void-glibc" | |
, ADD_CABAL_ARGS: "--enable-split-sections" | |
} | |
] | |
container: | |
image: ${{ matrix.platform.image }} | |
steps: | |
- name: Install requirements | |
shell: sh | |
run: | | |
${{ matrix.platform.installCmd }} curl bash git ${{ matrix.platform.toolRequirements }} | |
- uses: actions/checkout@v3 | |
- name: Run build | |
run: | | |
bash .github/scripts/build.sh | |
env: | |
ARTIFACT: ${{ matrix.platform.ARTIFACT }} | |
DISTRO: ${{ matrix.platform.DISTRO }} | |
ADD_CABAL_ARGS: ${{ matrix.platform.ADD_CABAL_ARGS }} | |
- if: always() | |
name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
if-no-files-found: error | |
retention-days: 2 | |
name: artifacts | |
path: | | |
./out/* | |
build-linux-32bit: | |
name: Build linux binaries (32bit) | |
runs-on: ubuntu-latest | |
env: | |
TARBALL_EXT: tar.xz | |
ARCH: 32 | |
TZ: Asia/Singapore | |
GHC_VERSION: 9.8.2 | |
DISTRO: "Unknown" | |
ARTIFACT: "i386-linux-unknown" | |
ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static" | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'true' | |
- name: Run build (32 bit linux) | |
uses: docker://hasufell/i386-alpine-haskell:3.12 | |
with: | |
args: sh -c "apk update && apk add bash binutils-gold curl gcc g++ gmp-dev libc-dev libffi-dev make musl-dev ncurses-dev perl tar xz autoconf automake bzip2 coreutils elfutils-dev findutils git jq bzip2-dev patch python3 sqlite sudo wget which zlib-dev patchelf zlib zlib-dev zlib-static && bash .github/scripts/build.sh" | |
- if: always() | |
name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
if-no-files-found: error | |
retention-days: 2 | |
name: artifacts | |
path: | | |
./out/* | |
build-arm: | |
name: Build ARM binary | |
runs-on: ${{ matrix.os }} | |
env: | |
TARBALL_EXT: tar.xz | |
ADD_CABAL_ARGS: "" | |
DEBIAN_FRONTEND: noninteractive | |
TZ: Asia/Singapore | |
ARCH: ARM64 | |
DISTRO: Debian | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: [self-hosted, Linux, ARM64, maerwald] | |
ARCH: ARM | |
ARTIFACT: "armv7-linux-deb10" | |
GHC_VERSION: 9.2.8 | |
- os: [self-hosted, Linux, ARM64, maerwald] | |
ARCH: ARM64 | |
ARTIFACT: "aarch64-linux-deb10" | |
GHC_VERSION: 9.8.2 | |
steps: | |
- name: git config | |
run: | | |
git config --global --get-all safe.directory | grep '^\*$' || git config --global --add safe.directory "*" | |
shell: bash | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- if: matrix.ARCH == 'ARM' | |
uses: docker://hasufell/arm32v7-debian-haskell:10 | |
name: Run build (armv7 linux) | |
with: | |
args: bash .github/scripts/build.sh | |
env: | |
ARTIFACT: ${{ matrix.ARTIFACT }} | |
GHC: ${{ matrix.GHC }} | |
- if: matrix.ARCH == 'ARM64' | |
uses: docker://hasufell/arm64v8-debian-haskell:10 | |
name: Run build (aarch64 linux) | |
with: | |
args: bash .github/scripts/build.sh | |
env: | |
ARTIFACT: ${{ matrix.ARTIFACT }} | |
GHC: ${{ matrix.GHC }} | |
- if: always() | |
name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
if-no-files-found: error | |
retention-days: 2 | |
name: artifacts | |
path: | | |
./out/* | |
build-mac-x86_64: | |
name: Build binary (Mac x86_64) | |
runs-on: macOS-11 | |
env: | |
MACOSX_DEPLOYMENT_TARGET: 10.13 | |
ADD_CABAL_ARGS: "" | |
ARTIFACT: "x86_64-apple-darwin" | |
ARCH: 64 | |
TARBALL_EXT: tar.xz | |
DISTRO: na | |
GHC_VERSION: 9.8.2 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Run build | |
run: | | |
brew install coreutils tree | |
bash .github/scripts/build.sh | |
- if: always() | |
name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
if-no-files-found: error | |
retention-days: 2 | |
name: artifacts | |
path: | | |
./out/* | |
build-mac-aarch64: | |
name: Build binary (Mac aarch64) | |
runs-on: [self-hosted, macOS, ARM64] | |
env: | |
MACOSX_DEPLOYMENT_TARGET: 10.13 | |
ADD_CABAL_ARGS: "" | |
ARTIFACT: "aarch64-apple-darwin" | |
ARCH: ARM64 | |
TARBALL_EXT: tar.xz | |
DISTRO: na | |
HOMEBREW_CHANGE_ARCH_TO_ARM: 1 | |
GHC_VERSION: 9.8.2 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Run build | |
run: | | |
bash .github/scripts/brew.sh git coreutils autoconf automake tree | |
export PATH="$HOME/.brew/bin:$HOME/.brew/sbin:$PATH" | |
export LD=ld | |
bash .github/scripts/build.sh | |
- if: always() | |
name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
if-no-files-found: error | |
retention-days: 2 | |
name: artifacts | |
path: | | |
./out/* | |
build-win: | |
name: Build binary (Win) | |
runs-on: windows-latest | |
env: | |
ADD_CABAL_ARGS: "" | |
ARTIFACT: "x86_64-mingw64" | |
ARCH: 64 | |
TARBALL_EXT: "zip" | |
DISTRO: na | |
GHC_VERSION: 9.8.2 | |
steps: | |
- name: install windows deps | |
shell: pwsh | |
run: | | |
C:\msys64\usr\bin\bash -lc "pacman --disable-download-timeout --noconfirm -Syuu" | |
C:\msys64\usr\bin\bash -lc "pacman --disable-download-timeout --noconfirm -Syuu" | |
C:\msys64\usr\bin\bash -lc "pacman --disable-download-timeout --noconfirm -S make mingw-w64-x86_64-clang curl autoconf mingw-w64-x86_64-pkgconf ca-certificates base-devel gettext autoconf make libtool automake python p7zip patch unzip zip git" | |
taskkill /F /FI "MODULES eq msys-2.0.dll" | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Run build (windows) | |
run: | | |
$env:CHERE_INVOKING = 1 | |
$env:MSYS2_PATH_TYPE = "inherit" | |
$ErrorActionPreference = "Stop" | |
C:\msys64\usr\bin\bash -lc "bash .github/scripts/build.sh" | |
shell: pwsh | |
- if: always() | |
name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
if-no-files-found: error | |
retention-days: 2 | |
name: artifacts | |
path: | | |
./out/* | |
build-freebsd-x86_64: | |
name: Build FreeBSD x86_64 | |
runs-on: [self-hosted, FreeBSD, X64] | |
env: | |
ADD_CABAL_ARGS: "" | |
ARTIFACT: "x86_64-portbld-freebsd" | |
ARCH: 64 | |
TARBALL_EXT: tar.xz | |
DISTRO: na | |
GHC_VERSION: 9.8.2 | |
RUNNER_OS: FreeBSD | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Run build | |
run: | | |
sed -i.bak -e 's/quarterly/latest/' /etc/pkg/FreeBSD.conf | |
pkg install -y ghc hs-cabal-install git bash misc/compat10x misc/compat11x misc/compat12x gmake llvm14 libiconv | |
tzsetup Etc/GMT | |
adjkerntz -a | |
bash .github/scripts/build.sh | |
- if: always() | |
name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
if-no-files-found: error | |
retention-days: 2 | |
name: artifacts | |
path: | | |
./out/* | |
release: | |
name: release | |
needs: ["build-linux", "build-linux-32bit", "build-arm", "build-mac-x86_64", "build-mac-aarch64", "build-win", "build-freebsd-x86_64"] | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: artifacts | |
path: ./out | |
- name: Install requirements | |
run: | | |
sudo apt-get update && sudo apt-get install -y tar xz-utils | |
shell: bash | |
- name: build sdists | |
run: | | |
cabal sdist -o out all | |
shell: bash | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: true | |
files: | | |
./out/* | |