Skip to content

fix: publish pipeline comment #1

fix: publish pipeline comment

fix: publish pipeline comment #1

Workflow file for this run

# Publish to NPM if a new tag with format [mypackage/v1.1.1] is created
name: Publish package to registry
on:
push:
tags:
- "*/v[0-9]+.[0-9]+.[0-9]+"
- "*/v[0-9]+.[0-9]+.[0-9]+-*"
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22.x'
registry-url: 'https://registry.npmjs.org'
- run: PACKAGE_NAME=$(echo "${{ github.ref }}" | sed -E "s:refs/tags/(.+)-v[^-]+$:\1:")
- run: PACKAGE_VERSION=$(echo "${{ github.ref }}" | sed -E "s:refs/tags/.+-(v.+)$:\1:")
- run: npm version $PACKAGE_VERSION --workspace packages/$PACKAGE_NAME
- run: npm install --workspace packages/$PACKAGE_NAME
- run: npm publish --workspace packages/$PACKAGE_NAME --if-present --access public
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}