Skip to content

Commit

Permalink
Make release from nix-build result
Browse files Browse the repository at this point in the history
  • Loading branch information
ninegua committed Jun 11, 2021
1 parent 138a8e9 commit 31ab333
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
SRC=src/index.js src/bare-agent.js src/index.html
DID_SRC=src/ledger.did src/governance.did
#NNS_IFACES ?= $(shell nix-prefetch-url --print-path https://codeload.github.com/dfinity/nns-ifaces/tar.gz/refs/tags/v0.8.1 | tail -n1)
NIX_SRC=default.nix ic-qr-scanner.nix node-env.nix node-packages.nix shell.nix
NPM_SRC=webpack.config.js src/simple.min.css
ALL_SRC=$(SRC) $(DID_SRC) $(NIX_SRC) $(NPM_SRC)

all: fmt build

build: dist/main.bundle.js

#NNS_IFACES ?= $(shell nix-prefetch-url --print-path https://codeload.github.com/dfinity/nns-ifaces/tar.gz/refs/tags/v0.8.1 | tail -n1)
#$(DID_SRC) &:
# cd src && cat $(NNS_IFACES) |tar zx --wildcards --strip-components=1 */ledger.did */governance.did

dist/index.html dist/main.bundle.js &: $(SRC) $(DID_SRC) webpack.config.js src/simple.min.css
dist/index.html dist/main.bundle.js &: $(SRC) $(DID_SRC) $(NPM_SRC)
npm run-script build

fmt: $(SRC) webpack.config.js
Expand All @@ -19,14 +22,21 @@ dist/monic.wasm: dist/index.html
cd dist && sh ../monic.sh index.html
sha256sum dist/index.html dist/monic.wasm

install: dist/monic.wasm
install -D dist/monic.did ${out}/bin/ic-qr-scanner.did
install -D dist/monic.wasm ${out}/bin/ic-qr-scanner.wasm

dist/canister_ids.json: canister_ids.json
cd dist && ln -s ../canister_ids.json .

release: dist/monic.wasm dist/canister_ids.json
cd dist && dfx deploy --network=ic
result : $(ALL_SRC)
nix-build ic-qr-scanner.nix

install: dist/monic.wasm
install -D dist/monic.wasm ${out}/bin/ic-qr-scanner.wasm
dfx.json:
echo '{"canisters":{"monic":{"type":"custom","candid":"result/bin/ic-qr-scanner.did","wasm":"result/bin/ic-qr-scanner.wasm","build":""}}}' > dfx.json

release: result dfx.json
dfx deploy --network=ic

clean:
rm -rf dist
Expand Down

0 comments on commit 31ab333

Please sign in to comment.