Skip to content
This repository was archived by the owner on Aug 9, 2024. It is now read-only.

Commit a2f88ce

Browse files
committed
WASM build on CI, clean-up sources
1 parent f9d0ae2 commit a2f88ce

File tree

9 files changed

+96
-80
lines changed

9 files changed

+96
-80
lines changed

.github/workflows/haskell.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
build:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
9+
- uses: actions/checkout@v3
1010
- uses: cachix/install-nix-action@v13
1111
with:
1212
nix_path: nixpkgs=channel:nixos-unstable
@@ -17,16 +17,15 @@ jobs:
1717
with:
1818
name: cabal2json
1919
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
20-
- run: npm ci
2120
- run: make
22-
- uses: actions/upload-artifact@v2
21+
- uses: actions/upload-artifact@v3
2322
with:
2423
name: build-${{ runner.os }}
25-
path: cabal2json.min.js
24+
path: cabal2json.wasm
2625
- name: Release
2726
uses: softprops/action-gh-release@v1
2827
if: startsWith(github.ref, 'refs/tags/')
2928
with:
30-
files: cabal2json.min.js
29+
files: cabal2json.wasm
3130
env:
3231
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
/node_modules/
44
/result
55
/cabal2json.min.js
6+
/cabal2json.wasm

Makefile

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,2 @@
1-
EXTERNS=$(shell find node_modules/google-closure-compiler/contrib/nodejs -name '*.js' | sed 's/^/--externs=/')
2-
JSEXE=result/bin/cabal2json.jsexe
3-
4-
all: cabal2json.min.js
5-
6-
$(JSEXE)/all.js: src cabal2json.cabal default.nix
7-
nix-build -A projectCross.ghcjs.hsPkgs.cabal2json.components.exes.cabal2json
8-
9-
cabal2json.min.js: $(JSEXE)/all.js
10-
node_modules/.bin/google-closure-compiler $(JSEXE)/all.js --jscomp_off=checkVars --compilation_level=ADVANCED_OPTIMIZATIONS $(EXTERNS) --externs=$(JSEXE)/all.js.externs > cabal2json.min.js
1+
all:
2+
nix shell -c wasm32-wasi-cabal install --installdir=. --install-method=copy --overwrite-policy=always

cabal.project

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
with-compiler: wasm32-wasi-ghc
22
with-hc-pkg: wasm32-wasi-ghc-pkg
33
packages: .
4-
allow-newer: ghc-prim

cabal2json.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cabal-version: 1.12
1+
cabal-version: 2.0
22
name: cabal2json
33
version: 0.1.0.0
44
license: BSD3
@@ -25,7 +25,7 @@ executable cabal2json
2525
hs-source-dirs: src
2626
default-language: Haskell2010
2727
build-depends:
28-
Cabal >=3.9 && <3.10,
28+
Cabal ^>=3.10,
2929
aeson >=1.5.6.0 && <3,
3030
base >=4.7 && <5,
3131
bytestring >=0.10.12.0 && <0.12,

default.nix

Lines changed: 0 additions & 32 deletions
This file was deleted.

flake.lock

Lines changed: 79 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
inputs.ghc-wasm-meta.url = "git+https://gitlab.haskell.org/ghc/ghc-wasm-meta.git";
3+
outputs = { ghc-wasm-meta, ... }: let
4+
pkg = ghc-wasm-meta.packages.x86_64-linux;
5+
in {
6+
packages.x86_64-linux.default = pkg.all_9_6;
7+
};
8+
}

shell.nix

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)