From dfd98628e5699f430d62668cdfd29d51cf6c31c8 Mon Sep 17 00:00:00 2001 From: Jonathan Bursztyn Date: Thu, 14 Sep 2023 16:29:12 +0100 Subject: [PATCH 1/4] Fix abi_wasm publish for release-please --- .github/workflows/publish-abi_wasm.yml | 3 --- .github/workflows/release.yml | 12 ++++++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-abi_wasm.yml b/.github/workflows/publish-abi_wasm.yml index ff0ea7f0cc7..9b96433951d 100644 --- a/.github/workflows/publish-abi_wasm.yml +++ b/.github/workflows/publish-abi_wasm.yml @@ -1,9 +1,6 @@ name: Publish ABI Wasm on: - push: - tags: - - "*" workflow_dispatch: jobs: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eb030f41f82..7c58dba6db7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -79,3 +79,15 @@ jobs: ref: master token: ${{ secrets.NOIR_REPO_TOKEN }} inputs: '{ "noir-ref": "${{ needs.release-please.outputs.tag-name }}" }' + + dispatch-publish-abi-wasm: + name: Dispatch to publish-abi_wasm workflow + needs: [release-please] + runs-on: ubuntu-latest + steps: + - name: Trigger publish-abi_wasm.yml workflow + uses: benc-uk/workflow-dispatch@v1 + with: + workflow: publish-abi_wasm.yml + repo: ${{ github.repository }} + token: ${{ secrets.GITHUB_TOKEN }} From c619a423c1bfaa27dde91ad7468f73d66714282d Mon Sep 17 00:00:00 2001 From: Jonathan Bursztyn Date: Thu, 14 Sep 2023 16:34:51 +0100 Subject: [PATCH 2/4] Pass noir-ref to abi_wasm --- .github/workflows/publish-abi_wasm.yml | 14 +++++++++++--- .github/workflows/release.yml | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-abi_wasm.yml b/.github/workflows/publish-abi_wasm.yml index 9b96433951d..3ca7b77f747 100644 --- a/.github/workflows/publish-abi_wasm.yml +++ b/.github/workflows/publish-abi_wasm.yml @@ -2,6 +2,10 @@ name: Publish ABI Wasm on: workflow_dispatch: + inputs: + noir-ref: + description: The noir reference to checkout + required: true jobs: noirc-abi-wasm-build: @@ -12,6 +16,9 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v3 + with: + repository: "noir-lang/noir" + ref: ${{ inputs.noir-ref }} - name: Setup Node.js uses: actions/setup-node@v3 @@ -36,8 +43,9 @@ jobs: mkdir temp_publish_dir cp -r ${{ env.BUILD_OUTPUT_PATH }}/* temp_publish_dir/ - - name: Publish to NPM + - name: Publish to npm working-directory: ./temp_publish_dir - run: npm publish + run: | + npm publish --tag latest env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7c58dba6db7..8175f14bf96 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -91,3 +91,4 @@ jobs: workflow: publish-abi_wasm.yml repo: ${{ github.repository }} token: ${{ secrets.GITHUB_TOKEN }} + inputs: '{ "noir-ref": "${{ needs.release-please.outputs.tag-name }}" }' From a55f0f943fc9221c4759d7afe390b0fb943017a4 Mon Sep 17 00:00:00 2001 From: Jonathan Bursztyn Date: Thu, 14 Sep 2023 16:35:48 +0100 Subject: [PATCH 3/4] Rename NPM token --- .github/workflows/release-source-resolver.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-source-resolver.yml b/.github/workflows/release-source-resolver.yml index 9a1a3381dd8..821d409726e 100644 --- a/.github/workflows/release-source-resolver.yml +++ b/.github/workflows/release-source-resolver.yml @@ -38,7 +38,7 @@ jobs: working-directory: ./compiler/source-resolver run: npm publish env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Configure git run: | From 622878d4b77210796ba6d3d1b785568da7ff1dd2 Mon Sep 17 00:00:00 2001 From: Jonathan Bursztyn Date: Thu, 14 Sep 2023 17:01:14 +0100 Subject: [PATCH 4/4] Add if tag-name --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8175f14bf96..b3cecf25144 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -83,6 +83,7 @@ jobs: dispatch-publish-abi-wasm: name: Dispatch to publish-abi_wasm workflow needs: [release-please] + if: ${{ needs.release-please.outputs.tag-name }} runs-on: ubuntu-latest steps: - name: Trigger publish-abi_wasm.yml workflow