Skip to content

Commit

Permalink
packaging: use PNPM for publishing, with correct tags
Browse files Browse the repository at this point in the history
fixes: #362

extracts the following tags:

 * rc
 * next
 * alpha
 * beta

also enables NPM provenance when publishing
  • Loading branch information
CedarMist committed Aug 26, 2024
1 parent cf0cdd5 commit 2d4a27d
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit 2d4a27d

Please sign in to comment.