Skip to content

Commit 394ee2f

Browse files
committed
feat: adopt semantic release
1 parent 3348044 commit 394ee2f

File tree

4 files changed

+3277
-44
lines changed

4 files changed

+3277
-44
lines changed

.github/workflows/release.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Release
2+
on:
3+
workflow_dispatch:
4+
5+
permissions:
6+
contents: read # for checkout
7+
8+
jobs:
9+
release:
10+
name: Release
11+
runs-on: macos-latest
12+
permissions:
13+
contents: write # to be able to publish a GitHub release
14+
issues: write # to be able to comment on released issues
15+
pull-requests: write # to be able to comment on released pull requests
16+
id-token: write # to enable use of OIDC for npm provenance
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 20
26+
- name: Install dependencies
27+
run: npm install
28+
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
29+
run: npm audit signatures
30+
- name: Release
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
run: npx semantic-release

.releaserc.cjs

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* @type {import('semantic-release').GlobalConfig}
3+
*/
4+
module.exports = {
5+
branches: ["master"],
6+
plugins: [
7+
[
8+
"@semantic-release/commit-analyzer",
9+
{
10+
releaseRules: [
11+
{ type: "chore", release: "patch" },
12+
{ type: "refactor", release: "patch" },
13+
],
14+
},
15+
],
16+
"@semantic-release/release-notes-generator",
17+
[
18+
// update version field in package.json
19+
"@semantic-release/npm",
20+
{
21+
npmPublish: false,
22+
},
23+
],
24+
[
25+
// commit package.json
26+
"@semantic-release/git",
27+
{
28+
assets: ["package.json"],
29+
},
30+
],
31+
"@semantic-release/github",
32+
],
33+
};

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020
},
2121
"devDependencies": {
2222
"@biomejs/biome": "1.5.3",
23+
"@semantic-release/git": "^10.0.1",
2324
"@types/dotenv": "^8.2.0",
2425
"@types/node": "^18.18.7",
2526
"@vercel/ncc": "^0.38.1",
27+
"semantic-release": "^23.0.2",
2628
"ts-node": "^10.9.2",
2729
"typescript": "^5.3.3"
2830
}

0 commit comments

Comments
 (0)