Skip to content
Open
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
23 changes: 18 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
- 'v*' # Ex: v1.2.3 → publish as latest
- 'beta/*' # Ex: beta/1.2.3-beta.1 → publish as beta

permissions:
contents: read
id-token: write # For npm provenance

jobs:
publish:
runs-on: ubuntu-latest
Expand All @@ -14,17 +18,26 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
node-version: '24'
registry-url: 'https://registry.npmjs.org/'
cache: 'pnpm'

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

- name: Build
run: npm run build
run: pnpm run build

- name: Run tests
run: pnpm test

- name: Verify package.json version matches tag
run: |
Expand All @@ -50,12 +63,12 @@ jobs:

- name: Publish to npm (beta)
if: startsWith(github.ref, 'refs/tags/beta/')
run: npm publish --tag beta
run: pnpm publish --tag beta --provenance --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish to npm (latest)
if: startsWith(github.ref, 'refs/tags/v')
run: npm publish
run: pnpm publish --provenance --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
27 changes: 22 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,38 @@ on:
pull_request:
branches: ['**'] # Run on all branches for PRs

# Prevent concurrent runs on the same branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build:
test:
runs-on: ubuntu-latest

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

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '22'
node-version: '24'
cache: 'pnpm'

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

- name: Build
run: pnpm run build

- name: Run tests
run: npm test
run: pnpm test