From 2d4a27dc54ab0493ca4968c932da172772b03bf1 Mon Sep 17 00:00:00 2001 From: CedarMist <134699267+CedarMist@users.noreply.github.com> Date: Mon, 26 Aug 2024 21:06:26 +0100 Subject: [PATCH 1/2] packaging: use PNPM for publishing, with correct tags fixes: #362 extracts the following tags: * rc * next * alpha * beta also enables NPM provenance when publishing --- .github/workflows/publish.yaml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 8811ae11..9df1fdd9 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -47,12 +47,11 @@ jobs: # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable REF_NAME: ${{ github.ref_name }} run: | - echo "NPM_PACKAGE=$(echo $REF_NAME | grep -oE '(clients/js|contracts|integrations/(hardhat|wagmi-v2|viem-v2))')" >> $GITHUB_OUTPUT + echo "NPM_PACKAGE=$(echo $REF_NAME | grep -oE '(clients/js|contracts|integrations/(ethers-v6|hardhat|wagmi-v2|viem-v2))')" >> $GITHUB_OUTPUT + echo "NPM_TAG=$(echo $REF_NAME | grep -oP '(?<=\-)(rc|next|alpha|beta)' || echo 'latest')" >> $GITHUB_OUTPUT - name: Publish ${{ github.ref_name }} to NPM - uses: JS-DevTools/npm-publish@v3 - with: - # Build runs as a prepublish script - ignore-scripts: false - token: ${{ secrets.NPM_TOKEN }} - package: ${{ steps.extract-tag.outputs.NPM_PACKAGE }} - access: public + run: pnpm publish --access public --no-git-checks --tag ${{ steps.extract-tag.outputs.NPM_TAG }} + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NPM_CONFIG_PROVENANCE: true + working-directory: ${{ steps.extract-tag.outputs.NPM_PACKAGE }} From 3399339d558663767d6f26699bea0c78ddf679f8 Mon Sep 17 00:00:00 2001 From: CedarMist <134699267+CedarMist@users.noreply.github.com> Date: Mon, 26 Aug 2024 23:07:07 +0100 Subject: [PATCH 2/2] packaging: use PNPM for publishing, with correct tags --- .github/workflows/publish.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 9df1fdd9..6a5ceb68 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -50,8 +50,9 @@ jobs: echo "NPM_PACKAGE=$(echo $REF_NAME | grep -oE '(clients/js|contracts|integrations/(ethers-v6|hardhat|wagmi-v2|viem-v2))')" >> $GITHUB_OUTPUT echo "NPM_TAG=$(echo $REF_NAME | grep -oP '(?<=\-)(rc|next|alpha|beta)' || echo 'latest')" >> $GITHUB_OUTPUT - name: Publish ${{ github.ref_name }} to NPM - run: pnpm publish --access public --no-git-checks --tag ${{ steps.extract-tag.outputs.NPM_TAG }} + run: pnpm publish --access public --no-git-checks --tag $NPM_TAG env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_CONFIG_PROVENANCE: true + NPM_TAG: ${{ steps.extract-tag.outputs.NPM_TAG }} working-directory: ${{ steps.extract-tag.outputs.NPM_PACKAGE }}