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
12 changes: 12 additions & 0 deletions .commitlintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Conventional Commits — enforced on PRs via CI
# https://www.conventionalcommits.org/
rules:
type-enum:
- 2
- always
- [feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert]
type-case: [2, always, lower-case]
type-empty: [2, never]
subject-empty: [2, never]
subject-full-stop: [2, never, "."]
header-max-length: [2, always, 100]
21 changes: 21 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Commitlint

on:
pull_request:
branches: [main]

permissions:
contents: read

jobs:
commitlint:
name: Validate Commit Messages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
fetch-depth: 0

- uses: wagoid/commitlint-github-action@b948419dd99f3fd78a6548d48f94e3df7f6bf3ed # v6
with:
configFile: .commitlintrc.yml
60 changes: 60 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Release

on:
push:
branches: [main] # semantic-release determines if a new version is needed
workflow_dispatch: # manual re-run (only releases if new commits warrant it)

permissions:
contents: write
issues: write
pull-requests: write
id-token: write # npm provenance

jobs:
# ── Semantic Release ────────────────────────────────────────────────
# Analyzes conventional commits since the last tag, determines the next
# version, publishes to npm, and creates a GitHub Release + git tag.
# No release-worthy commits → no release (idempotent).
release:
name: Semantic Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
fetch-depth: 0
persist-credentials: true

- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version: "1.3.11"

- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: "lts/*"

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

- name: Test
run: bun run test -- --run

- name: Build
run: bun run build

- uses: cycjimmy/semantic-release-action@16ca923e6ccbb50770c415a0ccd43709a8c5f7a4 # v4.2.2
id: release
with:
extra_plugins: |
@semantic-release/commit-analyzer
@semantic-release/release-notes-generator
@semantic-release/npm
@semantic-release/github
@semantic-release/git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Release result
if: steps.release.outputs.new_release_published == 'true'
run: echo "Released v${{ steps.release.outputs.new_release_version }} to npm"
21 changes: 21 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/npm",
{
"npmPublish": true
}
],
"@semantic-release/github",
[
"@semantic-release/git",
{
"assets": ["package.json"],
"message": "chore(release): ${nextRelease.version} [skip ci]"
}
]
]
}
Loading