-
Notifications
You must be signed in to change notification settings - Fork 381
chore: simplify ES workspace build and publish #2989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
f80e6cb
fix: workspaces build
kobyhallx 6d47c2f
fix: explicitly specify files of backend package
kobyhallx c7af958
chore: add publish commands
kobyhallx 82a943a
chore: publish all js packages workflow
kobyhallx cdd403d
chore: dry-run
kobyhallx 24b69df
chore: rename job
kobyhallx b1f655d
chore: add missing setup
kobyhallx 2bb97e9
chore: remove commit pin
kobyhallx b83015f
chore: ensure permissions correct
kobyhallx 0c2d038
chore: no yarn cache
kobyhallx 1bf99cc
chore: step back from chmod
kobyhallx 27a5aec
chore: ensure nix build upfront
kobyhallx d61a9ca
chore: output package name while publishing
kobyhallx b94a3e6
chore: add auth
kobyhallx 66ab2e8
chore: call publish from release
kobyhallx 54b91db
Update .github/workflows/publish-es-packages.yml
kobyhallx fcc12bb
chore: make access public
kobyhallx 484ea9a
Merge branch 'kh-fix-workspace-build' of github.com:noir-lang/noir in…
kobyhallx 99971e1
chore remove unused
kobyhallx fa9f8d3
chore: filter out more from source
kobyhallx 80ae28f
fix: token write
kobyhallx 62e8411
chore: more debug
kobyhallx 5ea5d6d
chore: define action for nix
kobyhallx 64d92b5
chore: use pre-defined nix action
kobyhallx 95db4f2
chore: see different cache
kobyhallx 0e9f970
chore: define inputs for nix action
kobyhallx 65e2506
chore: add gh token input
kobyhallx f5e6ea1
chore: populate inputs for nix
kobyhallx 91a34dd
chore: restore sh files
kobyhallx 072b66d
chore: setup nix in publish step
kobyhallx 4bb26ed
Empty-Commit
kobyhallx e12bc1b
chore: space check
kobyhallx 6438b6a
chore: build separately to avoid space issue
kobyhallx 5531af0
chore: include json and md in filter
kobyhallx a837f2e
chore: separate to individual steps
kobyhallx 77a5939
chore: follo links on installation
kobyhallx e9116ac
chore: cleanup on push
kobyhallx 47dd53e
chore: correct description
kobyhallx c0f3489
Merge branch 'master' into kh-fix-workspace-build
kobyhallx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| name: Setup Nix | ||
| description: Installs and setups Nix components | ||
|
|
||
| inputs: | ||
| github-token: | ||
| description: 'Github Access Token' | ||
| required: true | ||
| nix-cache-name: | ||
| description: 'Name of the Cachix cache to use' | ||
| required: true | ||
| cachix-auth-token: | ||
| description: 'Cachix Auth Token' | ||
| required: true | ||
|
|
||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - uses: cachix/install-nix-action@v22 | ||
| with: | ||
| nix_path: nixpkgs=channel:nixos-23.05 | ||
| github_access_token: ${{ inputs.github-token }} | ||
|
|
||
| - uses: cachix/cachix-action@v12 | ||
| with: | ||
| name: ${{ inputs.nix-cache-name }} | ||
| authToken: ${{ inputs.cachix-auth-token }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| name: Publish Noir ES Packages | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| build-noir_wasm: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout sources | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - 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 .#noir_wasm | ||
|
|
||
| build-noirc_abi_wasm: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout sources | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - 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 | ||
|
|
||
| build-acvm_js: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout sources | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - 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 | ||
|
|
||
| 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 | ||
|
|
||
| - 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: Install Yarn dependencies | ||
| run: yarn install | ||
|
|
||
| - name: Build ES Packages | ||
| run: yarn prepare:publish | ||
|
|
||
| - name: Authenticate with npm | ||
| run: "echo npmAuthToken: ${{ secrets.NPM_TOKEN }} > ~/.yarnrc.yml" | ||
|
|
||
| - name: Publish ES Packages | ||
| run: yarn publish:all --access public |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,18 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Put these package.json files in the cjs and | ||
| # mjs directory respectively, so that | ||
| # tools can recognise that the .js files are either | ||
| # tools can recognise that the .js files are either | ||
| # commonjs or ESM files. | ||
| cat >lib/cjs/package.json <<!EOF | ||
| { | ||
| self_path=$(dirname "$(readlink -f "$0")") | ||
|
|
||
| cjs_package='{ | ||
| "type": "commonjs" | ||
| } | ||
| !EOF | ||
| }' | ||
|
|
||
| cat >lib/esm/package.json <<!EOF | ||
| { | ||
| esm_package='{ | ||
| "type": "module" | ||
| } | ||
| !EOF | ||
| }' | ||
|
|
||
| echo "$cjs_package" > $self_path/lib/cjs/package.json | ||
| echo "$esm_package" > $self_path/lib/esm/package.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.