Skip to content

Publish

Publish #16

Workflow file for this run

name: Publish
on:
workflow_dispatch:
inputs:
release-type:
type: choice
description: Type of the release
options:
- patch
- minor
- major
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
with:
node-version: '16'
registry-url: 'https://registry.npmjs.org'
- name: Install & Build
run: |
pnpm install
pnpm build
- name: Lint
run: pnpm lint
- name: Test
run: pnpm test
- name: Configure github-actions git
run: |
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@users.noreply.github.com'
- name: Bump version
run: npm version ${{ github.event.inputs.release-type }}
- name: Generate changelog
run: |
pnpm changelog
git add CHANGELOG.md
git commit -m 'chore: changelog'
- name: Push release tag
run: git push origin master --follow-tags
- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}