Skip to content

Commit a9b76cf

Browse files
author
Julien Dehos
committed
initial commit
0 parents  commit a9b76cf

File tree

12 files changed

+1112
-0
lines changed

12 files changed

+1112
-0
lines changed

.github/workflows/main.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
2+
name: Build and deploy
3+
4+
on:
5+
push:
6+
branches: main
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- uses: cachix/install-nix-action@v31
21+
with:
22+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
23+
24+
- name: Build using Nix
25+
run: nix develop .#wasm --command bash -c "make"
26+
27+
- name: Upload artifact
28+
uses: actions/upload-pages-artifact@v3
29+
with:
30+
path: ./public
31+
32+
deploy:
33+
runs-on: ubuntu-latest
34+
35+
environment:
36+
name: github-pages
37+
url: ${{ steps.deployment.outputs.page_url }}
38+
39+
needs: build
40+
41+
steps:
42+
- name: Deploy to GitHub Pages
43+
id: deployment
44+
uses: actions/deploy-pages@v4
45+

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist-*
2+
public
3+

Makefile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
.PHONY= update build optim
3+
4+
all: clean update build optim
5+
6+
update:
7+
wasm32-wasi-cabal update
8+
9+
build:
10+
wasm32-wasi-cabal build
11+
rm -rf public
12+
cp -r static public
13+
$(eval my_wasm=$(shell wasm32-wasi-cabal list-bin app | tail -n 1))
14+
$(shell wasm32-wasi-ghc --print-libdir)/post-link.mjs --input $(my_wasm) --output public/ghc_wasm_jsffi.js
15+
cp -v $(my_wasm) public/
16+
17+
optim:
18+
wasm-opt -all -O2 public/app.wasm -o public/app.wasm
19+
wasm-tools strip -o public/app.wasm public/app.wasm
20+
21+
serve:
22+
http-server public
23+
24+
clean:
25+
rm -rf dist-newstyle public
26+

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# :ramen: miso-websocket
2+
3+
## Build and run
4+
5+
Install [Nix Flakes](https://nixos.wiki/wiki/Flakes), then:
6+
7+
```
8+
nix develop .#wasm
9+
make
10+
make serve
11+
```
12+

cabal.project

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
packages:
2+
.
3+
4+
allow-newer:
5+
all:base
6+
7+
flags: +template-haskell
8+
9+
source-repository-package
10+
type: git
11+
location: https://github.com/dmjio/miso
12+
branch: master
13+

0 commit comments

Comments
 (0)