Create a pre-release and publish it to npmjs #20
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: Create a pre-release and publish it to npmjs | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Pre-release version (without "v" prefix)' | |
required: true | |
branch: | |
description: 'Branch of this repo to build (default "master")' | |
default: master | |
required: false | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.inputs.branch }} | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 16 | |
registry-url: 'https://registry.npmjs.org' | |
- name: Replace Version in package.json | |
uses: jossef/action-set-json-field@v1 | |
with: | |
file: package.json | |
field: version | |
value: ${{ github.event.inputs.version }} | |
- run: npm ci | |
- run: npm publish --access public --tag next | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |