Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ jobs:
with:
path: ./public

- name: Install GHCup
uses: haskell/ghcup-setup@v1
with:
cabal: latest

- name: Build WASM using GHCup
run: |
make ghcup-build

deploy:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
Expand Down
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
.PHONY= update build optim

CABAL_ARGS += --allow-newer=base,template-haskell --with-compiler=wasm32-wasi-ghc --with-hc-pkg=wasm32-wasi-ghc-pkg --with-hsc2hs=wasm32-wasi-hsc2hs --with-haddock=wasm32-wasi-haddock
RELEASE_CHANNEL := https://gitlab.haskell.org/haskell-wasm/ghc-wasm-meta/-/raw/master/ghcup-wasm-0.0.9.yaml
WASM_BOOTSTRAP := https://gitlab.haskell.org/haskell-wasm/ghc-wasm-meta/-/raw/master/bootstrap.sh

all: update build optim

js: update-js build-js
Expand Down Expand Up @@ -40,3 +44,16 @@ build-js:
rm -rf public
cp -rv static public
bunx --bun swc ./all.js -o public/index.js

ghcup-update:
cabal update $(CABAL_ARGS)

ghcup-build: | install-wasm-via-ghcup ghcup-update
. ~/.ghc-wasm/env && \
cabal build $(CABAL_ARGS)

install-wasm-via-ghcup:
curl $(WASM_BOOTSTRAP) | SKIP_GHC=1 sh
. ~/.ghc-wasm/env && \
ghcup config add-release-channel $(RELEASE_CHANNEL) && \
ghcup install ghc --set wasm32-wasi-9.15 -- $$CONFIGURE_ARGS
Loading