Skip to content

Commit

Permalink
chore: fix publishing workflows (noir-lang#2926)
Browse files Browse the repository at this point in the history
Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
  • Loading branch information
2 people authored and Sakapoi committed Oct 19, 2023
1 parent 8466a3a commit 74c95b8
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 32 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/publish-abi_wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ jobs:
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- name: Build noirc_abi_wasm
run: |
nix build -L .#noirc_abi_wasm
run: nix build .#noirc_abi_wasm

- name: Discover Build Output Path
run: echo "BUILD_OUTPUT_PATH=$(readlink -f ./result/noirc_abi_wasm)" >> $GITHUB_ENV
Expand All @@ -42,10 +41,11 @@ jobs:
run: |
mkdir temp_publish_dir
cp -r ${{ env.BUILD_OUTPUT_PATH }}/* temp_publish_dir/
touch temp_publish_dir/yarn.lock
- name: Publish to npm
- name: Publish to NPM
working-directory: ./temp_publish_dir
run: |
yarn npm publish --tag latest
run: yarn npm publish --tag latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

17 changes: 7 additions & 10 deletions .github/workflows/publish-acvm-js.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish acvm_js
name: Publish acvm-js

on:
workflow_dispatch:
Expand Down Expand Up @@ -33,22 +33,19 @@ jobs:
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"

- name: Build acvm-js
working-directory: acvm-repo
run: |
nix build .#
run: nix build .#acvm_js

- name: Discover Build Output Path
working-directory: acvm-repo
run: echo "BUILD_OUTPUT_PATH=$(readlink -f ./result)" >> $GITHUB_ENV
run: echo "BUILD_OUTPUT_PATH=$(readlink -f ./result/acvm_js)" >> $GITHUB_ENV

- name: Copy Build Output to Temporary Directory
working-directory: acvm-repo
run: |
mkdir temp_publish_dir
cp -r ${{ env.BUILD_OUTPUT_PATH }}/* temp_publish_dir/
touch temp_publish_dir/yarn.lock
- name: Publish to NPM
working-directory: ./acvm-repo/temp_publish_dir
run: npm publish
working-directory: ./temp_publish_dir
run: yarn npm publish --tag latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
17 changes: 11 additions & 6 deletions .github/workflows/publish-noir-js.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release and Publish Noir Js
name: Publish Noir Js

on:
workflow_dispatch:
Expand All @@ -17,11 +17,13 @@ jobs:
- name: Install jq
run: sudo apt-get install jq

- name: Install cargo and wasm-bindgen
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env
cargo install -f wasm-bindgen-cli --version 0.2.86
- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.66.0

- name: Install wasm-bindgen-cli
uses: taiki-e/install-action@v2
with:
tool: wasm-bindgen-cli@0.2.86

- name: Install wasm-opt
run: |
Expand All @@ -34,6 +36,9 @@ jobs:
- name: Build noirc_abi
run: yarn workspace @noir-lang/noirc_abi build

- name: Build acvm_js
run: yarn workspace @noir-lang/acvm_js build

- name: Build noir_js
run: yarn workspace @noir-lang/noir_js build

Expand Down
24 changes: 14 additions & 10 deletions .github/workflows/publish-noir-wasm.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release Noir Wasm
name: Publish Noir Wasm

on:
workflow_dispatch:
Expand Down Expand Up @@ -26,18 +26,22 @@ jobs:
nix_path: nixpkgs=channel:nixos-23.05

- name: Build with Nix
run: |
nix build -L .#wasm
run: nix build .#noir_wasm

- name: Discover Build Output Path
run: echo "BUILD_OUTPUT_PATH=$(readlink -f ./result/noir_wasm)" >> $GITHUB_ENV

- name: Copy output
- name: Copy Build Output to Temporary Directory
run: |
cp -r $(readlink result)/* .
mkdir temp_publish_dir
cp -r ${{ env.BUILD_OUTPUT_PATH }}/* temp_publish_dir/
touch temp_publish_dir/yarn.lock
- name: Authenticate with npm
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

- name: Publish to npm
run: |
npm publish --access public
- name: Publish to NPM
working-directory: ./temp_publish_dir
run: yarn npm publish --tag latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 6 additions & 0 deletions .github/workflows/publish-source-resolver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
with:
registry-url: "https://registry.npmjs.org"
node-version: 18.15

- name: Install dependencies
run: yarn install --immutable

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-noir-js.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Noir JS
name: Test Noir Js

on:
pull_request:
Expand Down

0 comments on commit 74c95b8

Please sign in to comment.