Build cabal-3.8
This commit is contained in:
parent
f92ba10ef6
commit
c1edf3545e
@ -5,7 +5,7 @@ task:
|
|||||||
env:
|
env:
|
||||||
GHC_VER: 9.2.4
|
GHC_VER: 9.2.4
|
||||||
CABAL_VER: 3.6.2.0
|
CABAL_VER: 3.6.2.0
|
||||||
ARTIFACT: "x86_64-portbld-freebsd-ghcup"
|
ARTIFACT: "x86_64-portbld-freebsd-cabal"
|
||||||
ARCH: 64
|
ARCH: 64
|
||||||
RUNNER_OS: FreeBSD
|
RUNNER_OS: FreeBSD
|
||||||
DISTRO: na
|
DISTRO: na
|
||||||
|
21
.github/scripts/cabal-cache.sh
vendored
21
.github/scripts/cabal-cache.sh
vendored
@ -17,27 +17,30 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
# ensure ghc
|
# ensure ghc
|
||||||
ghcup install ghc --set 8.10.7
|
ghcup install ghc --set "${GHC_VER}"
|
||||||
ghcup install cabal --set recommended
|
ghcup install cabal --set "${CABAL_VER}"
|
||||||
|
|
||||||
ghc --version
|
ghc --version
|
||||||
cabal --version
|
cabal --version
|
||||||
|
|
||||||
cabal update
|
cabal update
|
||||||
|
|
||||||
git clone --single-branch --branch main https://github.com/hasufell/cabal-cache.git
|
cd /tmp
|
||||||
cd cabal-cache
|
cabal unpack cabal-install-3.8.1.0
|
||||||
|
cd cabal-install-3.8.1.0
|
||||||
|
|
||||||
if [ "${DISTRO}" = "Alpine" ] ; then
|
if [ "${DISTRO}" = "Alpine" ] ; then
|
||||||
cabal build --ghc-options='-split-sections -optl-static'
|
cabal build --constraint='lukko -ofd-locking' --ghc-options='-split-sections -optl-static' cabal-install:exe:cabal
|
||||||
|
elif [ "${DISTRO}" = "Ubuntu" ] ; then
|
||||||
|
cabal build --constraint='lukko -ofd-locking' cabal-install:exe:cabal
|
||||||
else
|
else
|
||||||
cabal build
|
cabal build cabal-install:exe:cabal
|
||||||
fi
|
fi
|
||||||
|
|
||||||
binary=$(cabal list-bin cabal-cache)
|
binary=$(cabal list-bin cabal-install:exe:cabal)
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
mkdir -p out
|
mkdir -p "${CI_PROJECT_DIR}/out"
|
||||||
strip_binary "${binary}"
|
strip_binary "${binary}"
|
||||||
cp "${binary}" "out/${ARTIFACT}"
|
cp "${binary}" "${CI_PROJECT_DIR}/out/${ARTIFACT}"
|
||||||
|
|
||||||
|
67
.github/workflows/cabal-cache.yaml
vendored
67
.github/workflows/cabal-cache.yaml
vendored
@ -24,13 +24,9 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
ARTIFACT: "i386-linux-cabal-cache"
|
ARTIFACT: "i386-linux-cabal"
|
||||||
GHC_VER: 8.10.7
|
GHC_VER: 8.10.7
|
||||||
ARCH: 32
|
ARCH: 32
|
||||||
- os: ubuntu-latest
|
|
||||||
ARTIFACT: "x86_64-linux-cabal-cache"
|
|
||||||
GHC_VER: 8.10.7
|
|
||||||
ARCH: 64
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@ -87,19 +83,15 @@ jobs:
|
|||||||
fail-fast: true
|
fail-fast: true
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- os: [self-hosted, Linux, aarch64]
|
- os: [self-hosted, Linux, ARM64, aarch32-linux]
|
||||||
ARTIFACT: "armv7-linux-cabal-cache"
|
ARTIFACT: "armv7-linux-cabal"
|
||||||
GHC_VER: 8.10.7
|
GHC_VER: 8.10.7
|
||||||
ARCH: ARM
|
ARCH: ARM
|
||||||
- os: [self-hosted, Linux, aarch64]
|
|
||||||
ARTIFACT: "aarch64-linux-cabal-cache"
|
|
||||||
GHC_VER: 8.10.7
|
|
||||||
ARCH: ARM64
|
|
||||||
steps:
|
steps:
|
||||||
- uses: docker://arm64v8/ubuntu:focal
|
- uses: docker://arm64v8/ubuntu:focal
|
||||||
name: Cleanup (aarch64 linux)
|
name: Cleanup (aarch64 linux)
|
||||||
with:
|
with:
|
||||||
args: rm -rf .ghcup/ cabal/ dist-newstyle/ out/ cabal-cache
|
args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +"
|
||||||
|
|
||||||
- name: git config
|
- name: git config
|
||||||
run: |
|
run: |
|
||||||
@ -153,55 +145,4 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
args: rm -rf .ghcup/ cabal/ dist-newstyle/ out/ cabal-cache
|
args: rm -rf .ghcup/ cabal/ dist-newstyle/ out/ cabal-cache
|
||||||
|
|
||||||
build-macwin:
|
|
||||||
name: Build binary (Mac/Win)
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
env:
|
|
||||||
CABAL_VER: 3.6.2.0
|
|
||||||
MACOSX_DEPLOYMENT_TARGET: 10.13
|
|
||||||
JSON_VERSION: "0.0.7"
|
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
||||||
S3_HOST: ${{ secrets.S3_HOST }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: [self-hosted, macOS, aarch64]
|
|
||||||
ARTIFACT: "aarch64-apple-darwin-cabal-cache"
|
|
||||||
GHC_VER: 9.2.5
|
|
||||||
ARCH: ARM64
|
|
||||||
- os: macOS-10.15
|
|
||||||
ARTIFACT: "x86_64-apple-darwin-cabal-cache"
|
|
||||||
GHC_VER: 9.2.5
|
|
||||||
ARCH: 64
|
|
||||||
- os: windows-latest
|
|
||||||
ARTIFACT: "x86_64-mingw64-cabal-cache"
|
|
||||||
GHC_VER: 8.10.7
|
|
||||||
ARCH: 64
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
submodules: 'true'
|
|
||||||
|
|
||||||
- name: Run build (windows/mac)
|
|
||||||
run: bash .github/scripts/cabal-cache.sh
|
|
||||||
env:
|
|
||||||
ARTIFACT: ${{ matrix.ARTIFACT }}
|
|
||||||
ARCH: ${{ matrix.ARCH }}
|
|
||||||
GHC_VER: ${{ matrix.GHC_VER }}
|
|
||||||
DISTRO: na
|
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
|
|
||||||
AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
|
|
||||||
S3_HOST: ${{ env.S3_HOST }}
|
|
||||||
HOMEBREW_CHANGE_ARCH_TO_ARM: 1
|
|
||||||
|
|
||||||
- if: always()
|
|
||||||
name: Upload artifact
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: artifacts
|
|
||||||
path: |
|
|
||||||
./out/*
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user