Skip to content

Add publish workflow #21

Add publish workflow

Add publish workflow #21

Workflow file for this run

name: publish
on: pull_request
# on:
# push:
# tags:
# - clients/js/[0-9].[0-9]+.[0-9]+
# - contracts/[0-9].[0-9]+.[0-9]+
# - integrations/hardhat/[0-9].[0-9]+.[0-9]+
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18"
- name: Extract package from tag
id: extract-tag
run: |
echo "NPM_PACKAGE=$(echo ${{ github.ref_name }} | grep -oE '(clients/js|contracts|integrations/hardhat)')" >> $GITHUB_OUTPUT
- name: Publish ${{ github.ref_name }} to NPM
uses: JS-DevTools/npm-publish@v2
with:
token: ${{ secrets.NPM_TOKEN }}
dry-run: true
package: ${{ steps.extract-tag.outputs.NPM_PACKAGE }}