Publish version #58
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: | |
workflow_dispatch: | |
inputs: | |
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 | |
- 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 }} |