1.2.8 #11
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |