Skip to content

Commit

Permalink
fix: minor problems with aztec publishing (#3095)
Browse files Browse the repository at this point in the history
Co-authored-by: Tom French <[email protected]>
  • Loading branch information
kobyhallx and TomAFrench authored Oct 12, 2023
1 parent f47d07a commit 0fc8f20
Show file tree
Hide file tree
Showing 9 changed files with 106 additions and 80 deletions.
66 changes: 43 additions & 23 deletions .github/workflows/publish-es-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
noir-ref:
description: The noir reference to checkout
required: false
default: 'master'
npm-tag:
description: Repository Tag to publish under
required: false
Expand All @@ -20,7 +21,7 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v4
with:
ref: ${{ inputs.noir-ref || 'master' }}
ref: ${{ inputs.noir-ref }}

- name: Setup Nix
uses: ./.github/actions/nix
Expand All @@ -32,85 +33,104 @@ jobs:
- name: Enable aztec features
if: ${{ inputs.npm-tag == 'aztec' }}
run: |
echo "\ndefault = [\"aztec\"]" >> compiler/noirc_frontend/Cargo.toml
echo $'\n'"default = [\"aztec\"]"$'\n' >> compiler/noirc_frontend/Cargo.toml
- name: Build wasm package
run: |
nix build -L .#noir_wasm
- uses: actions/upload-artifact@v3
with:
name: noir_wasm
path: |
result/noir_wasm/nodejs
result/noir_wasm/web
build-noirc_abi_wasm:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
ref: ${{ inputs.noir-ref || 'master' }}
ref: ${{ inputs.noir-ref }}

- name: Setup Nix
uses: ./.github/actions/nix
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
nix-cache-name: ${{ vars.NIX_CACHE_NAME }}
cachix-auth-token: ${{ secrets.CACHIXAUTHTOKEN }}

- name: Build wasm package
run: |
nix build -L .#noirc_abi_wasm
- uses: actions/upload-artifact@v3
with:
name: noirc_abi_wasm
path: |
result/noirc_abi_wasm/nodejs
result/noirc_abi_wasm/web
build-acvm_js:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
ref: ${{ inputs.noir-ref || 'master' }}
ref: ${{ inputs.noir-ref }}

- name: Setup Nix
uses: ./.github/actions/nix
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
nix-cache-name: ${{ vars.NIX_CACHE_NAME }}
cachix-auth-token: ${{ secrets.CACHIXAUTHTOKEN }}

- name: Build wasm package
run: |
nix build -L .#acvm_js
- uses: actions/upload-artifact@v3
with:
name: acvm_js
path: |
result/acvm_js/nodejs
result/acvm_js/web
publish-es-packages:
runs-on: ubuntu-latest
needs: [build-acvm_js, build-noirc_abi_wasm, build-noir_wasm]
steps:

- name: Checkout sources
uses: actions/checkout@v4
with:
ref: ${{ inputs.noir-ref || 'master' }}
ref: ${{ inputs.noir-ref }}

- name: Setup Nix
uses: ./.github/actions/nix
- uses: actions/download-artifact@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
nix-cache-name: ${{ vars.NIX_CACHE_NAME }}
cachix-auth-token: ${{ secrets.CACHIXAUTHTOKEN }}
name: acvm_js
path: acvm-repo/acvm_js
- uses: actions/download-artifact@v3
with:
name: noir_wasm
path: compiler/wasm
- uses: actions/download-artifact@v3
with:
name: noirc_abi_wasm
path: tooling/noirc_abi_wasm

- name: Install Yarn dependencies
run: yarn install

- name: Enable aztec features
if: ${{ inputs.npm-tag == 'aztec' }}
run: |
echo "\ndefault = [\"aztec\"]" >> compiler/noirc_frontend/Cargo.toml
- name: Build ES Packages
run: yarn prepare:publish
run: yarn build:js:only

- name: Prepare nightly version
if: ${{ inputs.npm-tag != 'latest' }}
run: |
yarn nightly:version
- name: Update Version as specific tag
run: |
jq '.version = .version + "-${{ inputs.npm-tag }}"' package.json > package-tmp.json && mv package-tmp.json package.json
yarn nightly:version -- .${{ inputs.npm-tag }}
- name: Authenticate with npm
run: "echo npmAuthToken: ${{ secrets.NPM_TOKEN }} > ~/.yarnrc.yml"
Expand Down
6 changes: 4 additions & 2 deletions acvm-repo/acvm_js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@
"test:browser": "web-test-runner",
"lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0",
"publish": "echo 📡 publishing `$npm_package_name` && yarn npm publish",
"nightly:version": "jq --arg new_version \"-$(git rev-parse --short HEAD)\" '.version = .version + $new_version' package.json > package-tmp.json && mv package-tmp.json package.json",
"clean": "chmod u+w web nodejs || true && rm -rf web nodejs"
"nightly:version": "jq --arg new_version \"-$(git rev-parse --short HEAD)$1\" '.version = .version + $new_version' package.json > package-tmp.json && mv package-tmp.json package.json",
"clean": "chmod u+w web nodejs || true && rm -rf web nodejs",
"build:nix": "nix build -L .#acvm_js",
"install:from:nix": "yarn clean && yarn build:nix && cp -rL ./result/acvm_js/nodejs ./ && cp -rL ./result/acvm_js/web ./"
},
"devDependencies": {
"@esm-bundle/chai": "^4.3.4-fix.0",
Expand Down
2 changes: 1 addition & 1 deletion compiler/source-resolver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"test": "ava",
"generate-types": "tsc src/*.ts --declaration --emitDeclarationOnly --outDir types",
"clean": "rm -rf ./lib ./lib-node",
"nightly:version": "jq --arg new_version \"-$(git rev-parse --short HEAD)\" '.version = .version + $new_version' package.json > package-tmp.json && mv package-tmp.json package.json",
"nightly:version": "jq --arg new_version \"-$(git rev-parse --short HEAD)$1\" '.version = .version + $new_version' package.json > package-tmp.json && mv package-tmp.json package.json",
"publish": "echo 📡 publishing `$npm_package_name` && yarn npm publish",
"lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0"
},
Expand Down
7 changes: 5 additions & 2 deletions compiler/wasm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@
"test:node": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\"}' mocha",
"test:browser": "web-test-runner",
"clean": "chmod u+w web nodejs || true && rm -rf ./nodejs ./web ./target ./result",
"nightly:version": "jq --arg new_version \"-$(git rev-parse --short HEAD)\" '.version = .version + $new_version' package.json > package-tmp.json && mv package-tmp.json package.json",
"nightly:version": "jq --arg new_version \"-$(git rev-parse --short HEAD)$1\" '.version = .version + $new_version' package.json > package-tmp.json && mv package-tmp.json package.json",
"publish": "echo 📡 publishing `$npm_package_name` && yarn npm publish",
"lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0"
"lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0",
"build:nix": "nix build -L .#noir_wasm",
"install:from:nix": "yarn clean && yarn build:nix && cp -rL ./result/noir_wasm/nodejs ./ && cp -rL ./result/noir_wasm/web ./"

},
"peerDependencies": {
"@noir-lang/source-resolver": "workspace:*"
Expand Down
93 changes: 46 additions & 47 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,49 +1,48 @@
{
"name": "@noir-lang/root",
"private": true,
"workspaces": [
"compiler/wasm",
"compiler/source-resolver",
"compiler/integration-tests",
"tooling/noir_js_types",
"tooling/noirc_abi_wasm",
"tooling/noir_js",
"tooling/noir_js_backend_barretenberg",
"acvm-repo/acvm_js",
"release-tests"
],
"scripts": {
"build": "yarn workspaces foreach --parallel --topological-dev --verbose run build",
"test": "yarn workspaces foreach run test",
"test:integration": "yarn workspace integration-tests test",
"clean:workspaces": "yarn workspaces foreach --exclude @noir-lang/root run clean",
"clean:root": "rm -rf ./result ./target",
"clean": "yarn clean:workspaces && yarn clean:root",
"lint": "yarn workspaces foreach --verbose run lint",
"build:with:nix": "nix build -L .#all_wasm",
"install:from:nix:noirc_abi_wasm": "cp -rL ./result/noirc_abi_wasm/nodejs ./tooling/noirc_abi_wasm && cp -rL ./result/noirc_abi_wasm/web ./tooling/noirc_abi_wasm",
"install:from:nix:noir_wasm": "cp -rL ./result/noir_wasm/nodejs ./compiler/wasm && cp -rL ./result/noir_wasm/web ./compiler/wasm",
"install:from:nix:acvm_js": "cp -rL ./result/acvm_js/nodejs ./acvm-repo/acvm_js && cp -rL ./result/acvm_js/web ./acvm-repo/acvm_js",
"install:from:nix": "yarn build:with:nix && yarn install:from:nix:noirc_abi_wasm && yarn install:from:nix:noir_wasm && yarn install:from:nix:acvm_js",
"build:types": "yarn workspace @noir-lang/types run build",
"build:source-resolver": "yarn workspace @noir-lang/source-resolver run build",
"build:backend_barretenberg": "yarn workspace @noir-lang/backend_barretenberg run build",
"build:noir_js": "yarn workspace @noir-lang/noir_js run build",
"build:js:only": "yarn build:types && yarn build:source-resolver && yarn build:backend_barretenberg && yarn build:noir_js",
"prepare:publish": "yarn clean && yarn install:from:nix && yarn build:js:only",
"nightly:version": "yarn workspaces foreach run nightly:version",
"publish:all": "yarn install && yarn workspaces foreach run publish"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^6.7.3",
"@typescript-eslint/parser": "^6.7.3",
"chai": "^4.3.7",
"eslint": "^8.50.0",
"eslint-plugin-prettier": "^5.0.0",
"mocha": "^10.2.0",
"prettier": "3.0.3",
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
},
"packageManager": "[email protected]"
"name": "@noir-lang/root",
"private": true,
"workspaces": [
"compiler/wasm",
"compiler/source-resolver",
"compiler/integration-tests",
"tooling/noir_js_types",
"tooling/noirc_abi_wasm",
"tooling/noir_js",
"tooling/noir_js_backend_barretenberg",
"acvm-repo/acvm_js",
"release-tests"
],
"scripts": {
"build": "yarn workspaces foreach --parallel --topological-dev --verbose run build",
"test": "yarn workspaces foreach run test",
"test:integration": "yarn workspace integration-tests test",
"clean:workspaces": "yarn workspaces foreach --exclude @noir-lang/root run clean",
"clean:root": "rm -rf ./result ./target",
"clean": "yarn clean:workspaces && yarn clean:root",
"lint": "yarn workspaces foreach --verbose run lint",
"install:acvm_js": "yarn workspace @noir-lang/acvm_js run install:from:nix",
"install:noir_wasm": "yarn workspace @noir-lang/noir_wasm run install:from:nix",
"install:noirc_abi_wasm": "yarn workspace @noir-lang/noirc_abi run install:from:nix",
"install:from:nix": "yarn install:acvm_js && yarn install:noir_wasm && yarn install:noirc_abi_wasm",
"build:types": "yarn workspace @noir-lang/types run build",
"build:source-resolver": "yarn workspace @noir-lang/source-resolver run build",
"build:backend_barretenberg": "yarn workspace @noir-lang/backend_barretenberg run build",
"build:noir_js": "yarn workspace @noir-lang/noir_js run build",
"build:js:only": "yarn build:types && yarn build:source-resolver && yarn build:backend_barretenberg && yarn build:noir_js",
"prepare:publish": "yarn clean && yarn install:from:nix && yarn build:js:only",
"nightly:version": "yarn workspaces foreach run nightly:version",
"publish:all": "yarn install && yarn workspaces foreach run publish"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^6.7.3",
"@typescript-eslint/parser": "^6.7.3",
"chai": "^4.3.7",
"eslint": "^8.50.0",
"eslint-plugin-prettier": "^5.0.0",
"mocha": "^10.2.0",
"prettier": "3.0.3",
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
},
"packageManager": "[email protected]"
}
2 changes: 1 addition & 1 deletion tooling/noir_js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"prettier": "prettier 'src/**/*.ts'",
"prettier:fix": "prettier --write 'src/**/*.ts' 'test/**/*.ts'",
"lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0",
"nightly:version": "jq --arg new_version \"-$(git rev-parse --short HEAD)\" '.version = .version + $new_version' package.json > package-tmp.json && mv package-tmp.json package.json",
"nightly:version": "jq --arg new_version \"-$(git rev-parse --short HEAD)$1\" '.version = .version + $new_version' package.json > package-tmp.json && mv package-tmp.json package.json",
"publish": "echo 📡 publishing `$npm_package_name` && yarn npm publish",
"clean": "rm -rf ./lib"
},
Expand Down
2 changes: 1 addition & 1 deletion tooling/noir_js_backend_barretenberg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"clean": "rm -rf ./lib",
"prettier": "prettier 'src/**/*.ts'",
"prettier:fix": "prettier --write 'src/**/*.ts' 'test/**/*.ts'",
"nightly:version": "jq --arg new_version \"-$(git rev-parse --short HEAD)\" '.version = .version + $new_version' package.json > package-tmp.json && mv package-tmp.json package.json",
"nightly:version": "jq --arg new_version \"-$(git rev-parse --short HEAD)$1\" '.version = .version + $new_version' package.json > package-tmp.json && mv package-tmp.json package.json",
"publish": "echo 📡 publishing `$npm_package_name` && yarn npm publish",
"lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0"
},
Expand Down
2 changes: 1 addition & 1 deletion tooling/noir_js_types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"build:esm": "tsc",
"build:cjs": "tsc --module CommonJS --outDir lib/cjs",
"build": "yarn run build:cjs && yarn run build:esm",
"nightly:version": "jq --arg new_version \"-$(git rev-parse --short HEAD)\" '.version = .version + $new_version' package.json > package-tmp.json && mv package-tmp.json package.json",
"nightly:version": "jq --arg new_version \"-$(git rev-parse --short HEAD)$1\" '.version = .version + $new_version' package.json > package-tmp.json && mv package-tmp.json package.json",
"publish": "echo 📡 publishing `$npm_package_name` && yarn npm publish",
"lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0"
},
Expand Down
6 changes: 4 additions & 2 deletions tooling/noirc_abi_wasm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@
"test": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha",
"test:browser": "web-test-runner",
"clean": "chmod u+w web nodejs || true && rm -rf ./nodejs ./web ./target ./result",
"nightly:version": "jq --arg new_version \"-$(git rev-parse --short HEAD)\" '.version = .version + $new_version' package.json > package-tmp.json && mv package-tmp.json package.json",
"nightly:version": "jq --arg new_version \"-$(git rev-parse --short HEAD)$1\" '.version = .version + $new_version' package.json > package-tmp.json && mv package-tmp.json package.json",
"publish": "echo 📡 publishing `$npm_package_name` && yarn npm publish",
"lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0"
"lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0",
"build:nix": "nix build -L .#noirc_abi_wasm",
"install:from:nix": "yarn clean && yarn build:nix && cp -rL ./result/noirc_abi_wasm/nodejs ./ && cp -rL ./result/noirc_abi_wasm/web ./"
},
"devDependencies": {
"@esm-bundle/chai": "^4.3.4-fix.0",
Expand Down

0 comments on commit 0fc8f20

Please sign in to comment.