diff --git a/.github/workflows/release-noir-wasm.yml b/.github/workflows/release-noir-wasm.yml new file mode 100644 index 00000000000..d862ad6993a --- /dev/null +++ b/.github/workflows/release-noir-wasm.yml @@ -0,0 +1,43 @@ +name: Release Noir Wasm + +on: + workflow_dispatch: + +jobs: + publish-noir-wasm: + runs-on: ubuntu-22.04 + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + + - uses: cachix/install-nix-action@v22 + with: + nix_path: nixpkgs=channel:nixos-23.05 + + - name: Build with Nix + run: | + nix build -L .#wasm + + - name: Copy output + run: | + cp -r $(readlink result)/* . + + - name: Authenticate with npm + run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc + + - name: Publish to npm + run: | + npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1be360068da..5968577f971 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -74,11 +74,9 @@ jobs: - name: Dispatch to noir_wasm uses: benc-uk/workflow-dispatch@v1 with: - workflow: update.yml - repo: noir-lang/noir_wasm + workflow: release-noir-wasm.yml ref: master token: ${{ secrets.NOIR_REPO_TOKEN }} - inputs: '{ "noir-ref": "${{ needs.release-please.outputs.tag-name }}" }' publish-noir-js: name: Publish noir_js package diff --git a/compiler/wasm/build.sh b/compiler/wasm/build.sh index 22acdd06cba..8157e42c6de 100755 --- a/compiler/wasm/build.sh +++ b/compiler/wasm/build.sh @@ -38,7 +38,7 @@ rm -rf $self_path/result >/dev/null 2>&1 if [ -v out ]; then echo "Will install package to $out (defined outside installPhase.sh script)" else - out="$self_path/outputs/out" + export out="$self_path/outputs/out" echo "Will install package to $out" fi