Skip to content

binaries

binaries #63

Workflow file for this run

name: binaries
on:
workflow_dispatch:
permissions:
contents: read
jobs:
build-binaries:
name: ${{ matrix.os }} / create binary
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v5
- uses: haskell-actions/setup@v2
id: setup
with:
ghc-version: '9.10'
- name: Configure the build
run: |
cabal configure --disable-tests --disable-benchmarks --disable-documentation
cabal build --dry-run
# The last step generates dist-newstyle/cache/plan.json for the cache key.
- name: Restore cached dependencies
uses: actions/cache/restore@v5
id: cache
env:
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }}
restore-keys: ${{ env.key }}-
- name: Install dependencies
# If we had an exact cache hit, the dependencies will be up to date.
if: steps.cache.outputs.cache-hit != 'true'
run: |
cabal build --only-dependencies
# Cache dependencies already here, so that we do not have to rebuild them should the subsequent steps fail.
- name: Save cached dependencies
uses: actions/cache/save@v5
# If we had an exact cache hit, trying to save the cache would error because of key clash.
if: steps.cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ steps.cache.outputs.cache-primary-key }}
- name: Build and install artifact
run: |
export ARTIFACTS=${{ runner.os }}/fints2ledger
mkdir -p ${ARTIFACTS}
cabal install --installdir="${ARTIFACTS}" --install-method=copy
strip "${ARTIFACTS}/fints2ledger"
- uses: actions/upload-artifact@v6
with:
name: ${{ runner.os }}
path: ${{ runner.os }}