Skip to content

Commit

Permalink
Fix CI with zksync-crypto
Browse files Browse the repository at this point in the history
  • Loading branch information
ly0va committed May 6, 2021
1 parent 17a5a2d commit 688f4ae
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
1 change: 1 addition & 0 deletions infrastructure/zk/src/run/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export async function tokenInfo(address: string) {
// installs all dependencies and builds our js packages
export async function yarn() {
await utils.spawn('yarn');
await utils.spawn('yarn crypto build');
await utils.spawn('yarn reading-tool build');
await utils.spawn('yarn zksync prepublish');
}
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"workspaces": {
"packages": [
"sdk/zksync.js",
"sdk/zksync-crypto",
"contracts",
"infrastructure/zcli",
"infrastructure/explorer",
Expand All @@ -25,6 +26,7 @@
},
"scripts": {
"zksync": "yarn workspace zksync",
"crypto": "yarn workspace zksync-crypto",
"contracts": "yarn workspace franklin-contracts",
"zcli": "yarn workspace zcli",
"ts-tests": "yarn workspace ts-tests",
Expand Down
17 changes: 10 additions & 7 deletions sdk/zksync-crypto/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ which wasm-pack || cargo install wasm-pack

# pack for bundler (!note this verion is used in the pkg.browser field)
wasm-pack build --release --target=bundler --out-name=zksync-crypto-bundler --out-dir=dist
# pack for browser
wasm-pack build --release --target=web --out-name=zksync-crypto-web --out-dir=dist
# pack for node.js
wasm-pack build --release --target=nodejs --out-name=zksync-crypto-node --out-dir=dist

rm dist/package.json dist/.gitignore

if [ "$CI" == "1" ]; then
exit 0
fi

# convert the bundler build into JS in case the environment doesn't support WebAssembly
../build_binaryen.sh
Expand All @@ -21,11 +31,4 @@ sed -i.backup "s/^import.*/\
let wasm = require('.\/zksync-crypto-bundler_bg_asm.js');/" ./dist/zksync-crypto-bundler_asm.js
sed -i.backup "s/\.js/_asm\.js/g" $ASM

# pack for browser
wasm-pack build --release --target=web --out-name=zksync-crypto-web --out-dir=dist

# pack for node.js
wasm-pack build --release --target=nodejs --out-name=zksync-crypto-node --out-dir=dist

rm dist/package.json dist/.gitignore
rm dist/*.backup
2 changes: 1 addition & 1 deletion sdk/zksync-crypto/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
],
"scripts": {
"build": "./build.sh && node web-wasm.js",
"test": "f cargo test"
"test": "zk f cargo test"
}
}

0 comments on commit 688f4ae

Please sign in to comment.