Skip to content

Commit

Permalink
Use a specific project file for static releases
Browse files Browse the repository at this point in the history
  • Loading branch information
tchoutri committed Jun 30, 2024
1 parent e466e65 commit 216a315
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,26 +108,22 @@ jobs:
cabal configure --enable-tests
- name: Freeze
run: cabal freeze --project-file=cabal.release.project
run: cabal freeze --project-file=cabal.static.project

- uses: actions/cache@v4
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-${{ hashFiles('**/plan.json') }}
restore-keys: ${{ runner.os }}-${{ steps.setup.outputs.ghc-version }}-

- name: Enable statically linked executables
run: |
echo 'executable-static: true' >> cabal.release.project
- name: Build
run: cabal build --project-file=cabal.release.project
run: cabal build --project-file=cabal.static.project

- name: Test
run: cabal test --project-file=cabal.release.project all
run: cabal test --project-file=cabal.static.project all

- name: Install
run: cabal install --project-file=cabal.release.project --installdir=distribution --install-method=copy
run: cabal install --project-file=cabal.static.project --installdir=distribution --install-method=copy

- name: Tar cabal head executable
run: |
Expand Down
7 changes: 7 additions & 0 deletions cabal.static.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import: ./cabal.release.project

executable-static: true

package confer
ghc-options: -static
ld-options: -static -pthread

0 comments on commit 216a315

Please sign in to comment.