Skip to content

This action publishes npm packages when creating new releases.

License

Notifications You must be signed in to change notification settings

novom/publish-with-tag-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Publish with tag action

License: MIT

This action publishes npm packages when creating new releases. It publishes under custom tags if one is specified in the version (e.g.: v1.0.0-alpha.1).

The release tag must follow the semver standard.

Usage

This action must only be used on workflows triggered by releases.

The npm command must be available.

    - name: Publish Package
      uses: novom/[email protected]
      env:
        NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Only needed if package is published on github packages

Inputs

Name Description Default
working-directory The directory to publish .

Outputs

Name Description
version The version that was published
tag The tag that was used to publish

Example Workflow

name: Publish Example

on:
  release:
    types:
      - created

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-node@v1
      with:
        node-version: '18.16'

    - name: Publish Package
      uses: novom/[email protected]
      with:
        working-directory: '<directory to publish>'
      env:
        NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    - run: echo ${{ steps.publish.outputs.version }}
    - run: echo ${{ steps.publish.outputs.tag }}

License

This software uses the MIT license.

About

This action publishes npm packages when creating new releases.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •