Skip to content

build(ci): added cabal configure fix #23

build(ci): added cabal configure fix

build(ci): added cabal configure fix #23

Workflow file for this run

name: Building and uploading Plume binaries
on:
push:
tags:
- '*'
permissions:
contents: write
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- windows-latest
- ubuntu-latest
- macos-latest
ghc-version: ['9.8.1']
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install CLang on Windows and Ubuntu
uses: KyleMayes/install-llvm-action@v2
if: startsWith(matrix.os, 'windows') || startsWith(matrix.os, 'ubuntu')
with:
version: "17.0"
- uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: latest
actions-cache-folder: '.xmake-cache'
actions-cache-key: '${{matrix.os}}'
- name: Checking for dependencies
run: |
python3 --version
xmake --version --root
- name: Update xmake repository
run: xmake repo --update --root
- name: Set up GHC ${{ matrix.ghc-version }}
uses: haskell-actions/setup@v2
id: setup
with:
ghc-version: ${{ matrix.ghc-version }}
cabal-version: 'latest'
cabal-update: true
- name: Configure the build
run: cabal build all --dry-run
# The last step generates dist-newstyle/cache/plan.json for the cache key.
- name: Restore cached dependencies
uses: actions/cache/restore@v3
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 all --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@v3
# 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 compiler and VM
run: python3 scripts/build_project.py --root
- name: Create ZIP archive on UNIX
if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos')
run: zip -r plume-${{matrix.os}}.zip bin standard README.md LICENSE
- name: Create ZIP archive on Windows
if: startsWith(matrix.os, 'windows')
run: Compress-Archive -CompressionLevel Optimal -Force -Path bin, standard, README.md, LICENSE -DestinationPath plume-${{matrix.os}}.zip
- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
path: ${{ github.workspace }}/plume-${{ matrix.os }}.zip
- name: Upload artifact to latest release
uses: softprops/action-gh-release@v2
with:
files: plume-${{ matrix.os }}.zip