Skip to content

Publish package

Publish package #11

Workflow file for this run

name: Publish package
# Trigger the build on release manually
on: workflow_dispatch
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: Bump version and push tag
id: bump-version
uses: anothrNick/github-tag-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_BRANCHES: master
DEFAULT_BUMP: patch
- name: Publish new version to npm
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
npm version --no-git-tag-version ${{ steps.bump-version.outputs.new_tag }}
npm publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}