Skip to content

Create a pre-release and publish it to npmjs #20

Create a pre-release and publish it to npmjs

Create a pre-release and publish it to npmjs #20

Workflow file for this run

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}}