Skip to content

Commit 5bb42e8

Browse files
committed
Add semantic release workflow
1 parent 07afda6 commit 5bb42e8

File tree

7 files changed

+1575
-4
lines changed

7 files changed

+1575
-4
lines changed

.github/workflows/release.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: RELEASE
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
source:
10+
name: verify source
11+
uses: ./.github/workflows/source.yaml
12+
release:
13+
name: release version
14+
runs-on: ubuntu-latest
15+
needs: [source]
16+
permissions:
17+
issues: write
18+
contents: write
19+
pull-requests: write
20+
steps:
21+
- name: checkout repository
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
- name: setup package manager
26+
uses: pnpm/action-setup@v4
27+
with:
28+
run_install: false
29+
- name: install node
30+
uses: actions/setup-node@v4
31+
with:
32+
cache: 'pnpm'
33+
check-latest: true
34+
node-version-file: '.nvmrc'
35+
- name: install dependencies
36+
run: pnpm install
37+
- name: release version
38+
run: pnpm exec semantic-release
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/source.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: SOURCE
22

33
on:
4+
workflow_call:
45
merge_group:
56
pull_request:
67
push:

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
engine-strict=true
22
tag-version-prefix=
33
preid=rc
4+
access=public

knip.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
export default {
22
entry: ['src/index.ts'],
3+
ignoreDependencies: [
4+
'@semantic-release/commit-analyzer',
5+
'@semantic-release/github',
6+
'@semantic-release/npm',
7+
'@semantic-release/release-notes-generator',
8+
],
39
project: ['src/**'],
410
};

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"husky": "^9.0.11",
5252
"knip": "^5.16.0",
5353
"lint-staged": "^15.2.2",
54-
"prettier": "^3.2.5"
54+
"prettier": "^3.2.5",
55+
"semantic-release": "^24.2.0"
5556
}
5657
}

0 commit comments

Comments
 (0)