Build cabal-3.8
This commit is contained in:
parent
f92ba10ef6
commit
c1edf3545e
@ -5,7 +5,7 @@ task:
|
||||
env:
|
||||
GHC_VER: 9.2.4
|
||||
CABAL_VER: 3.6.2.0
|
||||
ARTIFACT: "x86_64-portbld-freebsd-ghcup"
|
||||
ARTIFACT: "x86_64-portbld-freebsd-cabal"
|
||||
ARCH: 64
|
||||
RUNNER_OS: FreeBSD
|
||||
DISTRO: na
|
||||
|
21
.github/scripts/cabal-cache.sh
vendored
21
.github/scripts/cabal-cache.sh
vendored
@ -17,27 +17,30 @@ fi
|
||||
|
||||
|
||||
# ensure ghc
|
||||
ghcup install ghc --set 8.10.7
|
||||
ghcup install cabal --set recommended
|
||||
ghcup install ghc --set "${GHC_VER}"
|
||||
ghcup install cabal --set "${CABAL_VER}"
|
||||
|
||||
ghc --version
|
||||
cabal --version
|
||||
|
||||
cabal update
|
||||
|
||||
git clone --single-branch --branch main https://github.com/hasufell/cabal-cache.git
|
||||
cd cabal-cache
|
||||
cd /tmp
|
||||
cabal unpack cabal-install-3.8.1.0
|
||||
cd cabal-install-3.8.1.0
|
||||
|
||||
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
|
||||
cabal build
|
||||
cabal build cabal-install:exe:cabal
|
||||
fi
|
||||
|
||||
binary=$(cabal list-bin cabal-cache)
|
||||
binary=$(cabal list-bin cabal-install:exe:cabal)
|
||||
cd ..
|
||||
|
||||
mkdir -p out
|
||||
mkdir -p "${CI_PROJECT_DIR}/out"
|
||||
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:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
ARTIFACT: "i386-linux-cabal-cache"
|
||||
ARTIFACT: "i386-linux-cabal"
|
||||
GHC_VER: 8.10.7
|
||||
ARCH: 32
|
||||
- os: ubuntu-latest
|
||||
ARTIFACT: "x86_64-linux-cabal-cache"
|
||||
GHC_VER: 8.10.7
|
||||
ARCH: 64
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
@ -87,19 +83,15 @@ jobs:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
include:
|
||||
- os: [self-hosted, Linux, aarch64]
|
||||
ARTIFACT: "armv7-linux-cabal-cache"
|
||||
- os: [self-hosted, Linux, ARM64, aarch32-linux]
|
||||
ARTIFACT: "armv7-linux-cabal"
|
||||
GHC_VER: 8.10.7
|
||||
ARCH: ARM
|
||||
- os: [self-hosted, Linux, aarch64]
|
||||
ARTIFACT: "aarch64-linux-cabal-cache"
|
||||
GHC_VER: 8.10.7
|
||||
ARCH: ARM64
|
||||
steps:
|
||||
- uses: docker://arm64v8/ubuntu:focal
|
||||
name: Cleanup (aarch64 linux)
|
||||
with:
|
||||
args: rm -rf .ghcup/ cabal/ dist-newstyle/ out/ cabal-cache
|
||||
args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +"
|
||||
|
||||
- name: git config
|
||||
run: |
|
||||
@ -153,55 +145,4 @@ jobs:
|
||||
with:
|
||||
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