Skip to content

fix: use latest steps versions #16

fix: use latest steps versions

fix: use latest steps versions #16

Workflow file for this run

name: Increment version and publish package to NPM registry
on:
push:
branches:
- master
jobs:
increment-and-publish-to-npm-registry:
runs-on: ubuntu-latest
if: "startsWith(github.event.head_commit.message, 'fix') || startsWith(github.event.head_commit.message, 'feat')"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: latest
registry-url: https://registry.npmjs.org
- run: yarn install --frozen-lockfile
- run: grunt build
- run: git config --global user.name "Maksym Gendin"
- run: git config --global user.email "[email protected]"
- run: npm version patch
if: "startsWith(github.event.head_commit.message, 'fix:')"
- run: npm version minor
if: "startsWith(github.event.head_commit.message, 'feat:')"
- run: npm version major
if: "startsWith(github.event.head_commit.message, 'feat!:') || startsWith(github.event.head_commit.message, 'fix!:')"
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.PUBLISH_NPM_TOKEN}}
- run: git push
- run: echo NPM_PACKAGE_VERSION=$(npm pkg get version) >> $GITHUB_ENV
- run: git push origin ${{ env.NPM_PACKAGE_VERSION }}