Fix path splitting #79
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 | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_call: | |
concurrency: | |
group: build-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-latest, ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: haskell-actions/setup@v2 | |
id: setup | |
with: | |
ghc-version: '9.10.1' | |
cabal-version: '3.12.1.0' | |
- name: Generate build plan | |
run: cabal build all --dry-run | |
- name: Restore cached dependencies | |
uses: actions/cache/restore@v4 | |
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: steps.cache.outputs.cache-hit != 'true' | |
run: cabal build all --only-dependencies | |
- name: Save cached dependencies | |
uses: actions/cache/save@v4 | |
if: steps.cache.outputs.cache-hit != 'true' | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: ${{ steps.cache.outputs.cache-primary-key }} | |
- name: cabal build | |
run: cabal build | |
- name: Output binary path | |
id: output_cabal | |
run: echo "local_bin=$(cabal list-bin gwcli)}" >> "$GITHUB_OUTPUT" | |
- name: Upload binary (macOS x86) | |
if: ${{ matrix.os == 'macos-latest' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: gwcli_macos_x86 | |
path: ${{ steps.output_cabal.outputs.local_bin }} | |
- name: Upload binary (Linux) | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: gwcli_linux | |
path: ${{ steps.output_cabal.outputs.local_bin }} |