Skip to content

Publish

Publish #7

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:
build:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v2
- uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
- name: Install & Build
run: |
pnpm install
pnpm build
- name: Typecheck
run: pnpm typecheck
- name: Test
run: pnpm test
- name: Configure github-actions git
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
- name: Bump version
run: pnpm version ${{ github.event.inputs.release-type }}
- name: Push release tag
run: git push origin main --follow-tags
- name: Publish to npm
run: pnpm publish --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}