Skip to content

Workflow file for this run

name: Publish Package to npmjs
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: write
packages: write
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Get release version from tag
run: |
VERSION=${GITHUB_REF_NAME#v}
echo Version: $VERSION
echo "VERSION=$VERSION" >> $GITHUB_ENV
- 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'
- run: npm ci
# this would
# - name: Ensure tag matches package.json version
# run: npm version ${VERSION}
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.KEENMATE_NPM_TOKEN}}
- name: Create release
uses: softprops/action-gh-release@v1
with:
body: |
Release: ${VERSION}
draft: true