diff --git a/.github/workflows/halo2-browser-tests.yml b/.github/workflows/halo2-browser-tests.yml index cfb18f3..01ac036 100644 --- a/.github/workflows/halo2-browser-tests.yml +++ b/.github/workflows/halo2-browser-tests.yml @@ -27,17 +27,20 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 18 - - name: Build halo2-wasm - working-directory: halo2-wasm - run: | - rustup toolchain install nightly-2023-08-12-x86_64-unknown-linux-gnu - rustup component add rust-src --toolchain nightly-2023-08-12-x86_64-unknown-linux-gnu - cargo build --target=x86_64-unknown-linux-gnu --verbose - - name: Build halo2-lib-js - working-directory: halo2-lib-js - run: | - npm install - npm add @axiom-crypto/halo2-wasm-cli@0.1.6-rc.0 + - name: Set all packages to local and build + working-directory: ./ + run: ./scripts/toggleLocal.sh ci + # - name: Build halo2-wasm + # working-directory: halo2-wasm + # run: | + # rustup toolchain install nightly-2023-08-12-x86_64-unknown-linux-gnu + # rustup component add rust-src --toolchain nightly-2023-08-12-x86_64-unknown-linux-gnu + # cargo build --target=x86_64-unknown-linux-gnu --verbose + # - name: Build halo2-lib-js + # working-directory: halo2-lib-js + # run: | + # npm install + # npm add @axiom-crypto/halo2-wasm-cli@0.1.6-rc.0 - name: Test halo2-lib-js/halo2-wasm VK equivalence working-directory: halo2-lib-js run: npm run test:vk diff --git a/cli/scripts/toggleLocal.js b/cli/scripts/toggleLocal.js index 20149f1..0fe492d 100644 --- a/cli/scripts/toggleLocal.js +++ b/cli/scripts/toggleLocal.js @@ -1,9 +1,15 @@ const fs = require('fs'); const packageJson = require('../package.json'); +let ci = false; +if (process.argv[2] === "ci") { + ci = true; +} +const local = ci ? "file:" : "link:"; + const main = () => { const packageJsonCopy = { ...packageJson }; - packageJsonCopy.dependencies['@axiom-crypto/halo2-wasm'] = 'link:../halo2-wasm/pkg'; + packageJsonCopy.dependencies['@axiom-crypto/halo2-wasm'] = `${local}../halo2-wasm/pkg`; fs.writeFileSync('./package.json', JSON.stringify(packageJsonCopy, null, 2)); } diff --git a/halo2-lib-js/scripts/toggleLocal.js b/halo2-lib-js/scripts/toggleLocal.js index 20149f1..0fe492d 100644 --- a/halo2-lib-js/scripts/toggleLocal.js +++ b/halo2-lib-js/scripts/toggleLocal.js @@ -1,9 +1,15 @@ const fs = require('fs'); const packageJson = require('../package.json'); +let ci = false; +if (process.argv[2] === "ci") { + ci = true; +} +const local = ci ? "file:" : "link:"; + const main = () => { const packageJsonCopy = { ...packageJson }; - packageJsonCopy.dependencies['@axiom-crypto/halo2-wasm'] = 'link:../halo2-wasm/pkg'; + packageJsonCopy.dependencies['@axiom-crypto/halo2-wasm'] = `${local}../halo2-wasm/pkg`; fs.writeFileSync('./package.json', JSON.stringify(packageJsonCopy, null, 2)); } diff --git a/halo2-repl/scripts/toggleLocal.js b/halo2-repl/scripts/toggleLocal.js index 930a8b4..bcefdba 100644 --- a/halo2-repl/scripts/toggleLocal.js +++ b/halo2-repl/scripts/toggleLocal.js @@ -1,10 +1,16 @@ const fs = require('fs'); const packageJson = require('../package.json'); +let ci = false; +if (process.argv[2] === "ci") { + ci = true; +} +const local = ci ? "file:" : "link:"; + const main = () => { const packageJsonCopy = { ...packageJson }; - packageJsonCopy.dependencies['@axiom-crypto/halo2-wasm'] = 'link:../halo2-wasm/pkg'; - packageJsonCopy.dependencies['@axiom-crypto/halo2-lib-js'] = 'link:../halo2-lib-js/dist'; + packageJsonCopy.dependencies['@axiom-crypto/halo2-wasm'] = `${local}../halo2-wasm/pkg`; + packageJsonCopy.dependencies['@axiom-crypto/halo2-lib-js'] = `${local}../halo2-lib-js/dist`; fs.writeFileSync('./package.json', JSON.stringify(packageJsonCopy, null, 2)); } diff --git a/halo2-wasm/Cargo.toml b/halo2-wasm/Cargo.toml index fe1babd..e0c10ea 100644 --- a/halo2-wasm/Cargo.toml +++ b/halo2-wasm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "halo2-wasm" -version = "0.2.12-alpha.0" +version = "0.2.13-rc2.0" edition = "2021" [lib] diff --git a/scripts/toggleLocal.sh b/scripts/toggleLocal.sh index 9f82dea..9ba4c38 100755 --- a/scripts/toggleLocal.sh +++ b/scripts/toggleLocal.sh @@ -1,11 +1,18 @@ #!/bin/bash + +CI="" +if [ "$1" = "ci" ]; then + CI="ci" +fi +echo $CI + ./scripts/build.sh cd halo2-lib-js -node ./scripts/toggleLocal.js +node ./scripts/toggleLocal.js $CI pnpm install cd ../halo2-repl -node ./scripts/toggleLocal.js +node ./scripts/toggleLocal.js $CI pnpm install cd ../cli -node ./scripts/toggleLocal.js +node ./scripts/toggleLocal.js $CI pnpm install \ No newline at end of file