Skip to content

npm version and publish

Actions
Based upon a conventional changelog, versions and publishes a new npm package to the registry
1.0.0
Latest
Star (2)

Conventional changelog npm publish action

This action does a few things:

  1. Uses conventional-recommended-bump to identify required patch, minor or major version change
  2. Runs npm version with the output of the above
  3. Performs an npm publish to the already setup repository (setup-node)

Inputs

author_email

Optional The email address used when committing the new version back to your repository. Default "conventional-changelog-npm-publish@noreply.github.com".

author_name

Optional The name used when committing the new version details back to your repository. Default "conventional-changelog-npm-publish".

commit_message

Optional The message used when committing the new version details back to your repository. Default "Bumping [VERSION_TYPE] version". Replaces [VERSION_TYPE] with one of patch, minor or major. So the default becomes Bumping patch version

Outputs

Example usage

name: npm-build-publish
on:
  push:
    branches:
      - master

jobs:
  npm-build-publish:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@master
      # required - sets up auth in the node env
      - name: Set up Node.js
        uses: actions/setup-node@master
        with:
          node-version: 12.x
          registry-url: 'https://npm.pkg.github.com'
      # optional
      - run: npm install
      # optional
      - run: npm run build
        env:
          CI: true
      # required
      - name: version & publish
        uses: geeman201/conventional-changelog-npm-publish/@v14
        env:
          NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Future work

  • Push release also to github releases tab (should be a simple api call)
  • conventional-recommended-bump supports different commit message models (but I couldn't get the preset to work)
  • This library uses exec for most of its work making it near impossible to test - everything else sits within external libraries.

npm version and publish is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Based upon a conventional changelog, versions and publishes a new npm package to the registry
1.0.0
Latest

npm version and publish is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.