Skip to content

Publish Package to npmjs #9

Publish Package to npmjs

Publish Package to npmjs #9

Workflow file for this run

name: Publish Package to npmjs
on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: "The version to publish"
required: true
tag:
description: "Tag"
required: true
default: "latest"
type: choice
options:
- latest
- snapshot
- next
jobs:
publish:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.x"
registry-url: "https://registry.npmjs.org"
- run: npm pkg set "version=${{ inputs.version }}"
- run: npm publish --provenance --tag ${{ inputs.tag }} --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}