Skip to content

Commit 00bc076

Browse files
committed
feat: use semantic versioning and commit lint
1 parent 81517be commit 00bc076

6 files changed

Lines changed: 9180 additions & 1224 deletions

File tree

.github/workflows/release.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version-file: '.nvmrc'
16+
registry-url: 'https://registry.npmjs.org/'
17+
- run: npm ci
18+
- run: npm run build
19+
- run: npm run test
20+
- run: npm run release
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.releaserc.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"branches": ["main"],
3+
"plugins": [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
"@semantic-release/changelog",
7+
"@semantic-release/npm",
8+
"@semantic-release/git"
9+
]
10+
}

commitlint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default { extends: ["@commitlint/config-conventional"] };

lefthook.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,10 @@ pre-commit:
33
check:
44
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
55
run: npx @biomejs/biome check --write --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {staged_files}
6-
stage_fixed: true
6+
stage_fixed: true
7+
8+
# Validate commit messages
9+
commit-msg:
10+
commands:
11+
"lint commit message":
12+
run: npx commitlint --edit {1}

0 commit comments

Comments
 (0)