Skip to content

How do we set this up to use the tag version as the publish version? #190

Closed Answered by mcous
jnovak-SM2Dev asked this question in Q&A
Discussion options

You must be logged in to vote

This action is designed to help you continuously publish to npm in the case where you are manually bumping the version number in package.json. I you push a tag to publish, you should probably use npm directly. You don't need this action if you're not CD'ing from main.

I have not tested this, but something like this could work to publish with the version from git:

name: Publish Package
on:
  push:
    tags: v*

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      # Setup .npmrc file to publish to npm
      - uses: actions/setup-node@v4
        with:
          node-version: '20.x'
          registry-url: 'https://registry.npmjs.org'

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jnovak-SM2Dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants