Skip to content

Publish version

Publish version #25

Workflow file for this run

name: Publish Package to npmjs
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to use'
required: true
default: 'master'
type: choice
options:
- master
- feat/zustand
version:
description: 'Version'
required: true
default: 'beta'
type: choice
options:
- beta
- release
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.branch }}
- uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- name: Install pnpm
run: npm i pnpm -g
- name: Install dependencies
run: pnpm install
- name: Run lint and prettier
run: pnpm format
- name: Build
run: pnpm build
- name: Publish Beta
run: npm publish --tag beta --access public
if: ${{ github.event.inputs.version == 'beta' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish
run: npm publish --access public
if: ${{ github.event.inputs.version == 'release' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}