Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Publish to npm

on:
push:
tags:
- 'v*.*.*'

permissions:
contents: write
id-token: write

jobs:
ci:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: TypeScript type checking
run: npm run type-check

- name: Lint
run: npm run lint

- name: Format check
run: npm run format:check

- name: Run tests
env:
CI: true
NODE_ENV: test
run: npm test

- name: Build package
run: npm run build

publish:
needs: ci
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: 'https://registry.npmjs.org'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build package
run: npm run build

- name: Publish to npm
run: npm publish --provenance --access public

release:
needs: publish
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true