forked from koka-lang/koka
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9f400dd
commit f22332f
Showing
1 changed file
with
65 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
on: | ||
push: | ||
branches: [main] | ||
tags: | ||
- 'v*' | ||
|
||
name: build | ||
jobs: | ||
build: | ||
name: Build Koka | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] #, macOS-latest] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: haskell-actions/setup@v2 | ||
with: | ||
enable-stack: true | ||
stack-version: 'latest' | ||
- run: | | ||
stack config set system-ghc --global true | ||
stack config set install-ghc --global false | ||
- name: List dependencies | ||
run: stack ls dependencies json | jq > stack-deps.json | ||
|
||
- name: Restore cached dependency of Pantry (Stackage package index) | ||
uses: actions/cache/restore@v4 | ||
id: pantry | ||
env: | ||
key: ghc-${{ steps.setup.outputs.ghc-version }}-stack-${{ steps.setup.outputs.stack-version }} | ||
with: | ||
path: ${{ steps.setup.outputs.stack-root }}/pantry | ||
key: all-plan-${{ hashFiles('stack-deps.json') }} | ||
restore-keys: all | ||
|
||
- name: Recompute Stackage package index (~/.stack/pantry) | ||
if: steps.pantry.outputs.cache-hit != 'true' | ||
run: stack update | ||
|
||
- name: Stack lock check | ||
run: stack build --dry-run --lock-file=error-on-write | ||
|
||
- name: Build | ||
run: stack build | ||
|
||
- name: Run Koka Packaging | ||
run: | | ||
stack exec koka -- -e -O2 util/bundle | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
bundle/*.tar.gz | ||
- name: Save cached dependencies of Pantry | ||
uses: actions/cache/save@v4 | ||
if: steps.pantry.outputs.cache-hit != 'true' | ||
with: | ||
path: ${{ steps.setup.outputs.stack-root }}/pantry | ||
key: ${{ steps.pantry.outputs.cache-primary-key }} | ||
make_latest: true |