v0.1.4 #4
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: | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
name: Checkout | |
# Necessary step top pnpm run publish due Bug: https://github.com/pnpm/pnpm/issues/9011 | |
- name: Ensure correct branch is checked out | |
run: | | |
git checkout $(git rev-parse --abbrev-ref HEAD) | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm with the version of packageManager in package.json | |
# Setup .npmrc file to publish to npm | |
- uses: actions/setup-node@v4 | |
name: Install NodeJs | |
with: | |
node-version: '22.x' | |
registry-url: 'https://registry.npmjs.org' | |
- run: pnpm i | |
- run: pnpm run publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |