Skip to content
Merged
Show file tree
Hide file tree
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
42 changes: 42 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publish Package

on:
push:
tags:
- 'v*'

permissions:
id-token: write # Required for OIDC
contents: read

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5

- name: Install pnpm
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4

- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
with:
node-version: 22
cache: pnpm
registry-url: 'https://registry.npmjs.org'

# Ensure npm 11.5.1 or later is installed (required for trusted publishing)
- name: Update npm
run: npm install -g npm@latest

- name: Install dependencies
run: pnpm install --frozen-lockfile

# Run checks
- run: pnpm lint
- run: pnpm typecheck
- run: pnpm test
- run: pnpm build

- name: Publish to npm
run: npm publish
Comment thread
CorentinTh marked this conversation as resolved.
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"prepack": "pnpm build",
"release": "bumpp && pnpm publish",
"release": "bumpp --commit --tag --push",
"test": "vitest run",
"test:watch": "vitest watch",
"typecheck": "tsc --noEmit"
Expand All @@ -65,5 +65,10 @@
"valibot": "^1.1.0",
"vitest": "^3.2.4",
"zod": "^4.0.10"
},
"publishConfig": {
"access": "public",
"provenance": true,
"registry": "https://registry.npmjs.org"
}
}