Skip to content

Commit 8725eab

Browse files
committed
ci: setup semantic release automation and CI workflows
1 parent 170cdf7 commit 8725eab

File tree

5 files changed

+2097
-3
lines changed

5 files changed

+2097
-3
lines changed

.github/workflows/publish.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: read
9+
id-token: write # to enable use of OIDC for npm provenance
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '18'
22+
registry-url: 'https://registry.npmjs.org'
23+
24+
- name: Setup pnpm
25+
uses: pnpm/action-setup@v4
26+
with:
27+
version: '10.12.1'
28+
29+
- name: Install dependencies
30+
run: pnpm install --frozen-lockfile
31+
32+
- name: Build
33+
run: pnpm run build
34+
35+
- name: Publish to npm
36+
run: pnpm publish --access public --provenance
37+
env:
38+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
permissions:
9+
contents: write # to be able to publish a GitHub release
10+
issues: write # to be able to comment on released issues
11+
pull-requests: write # to be able to comment on released pull requests
12+
id-token: write # to enable use of OIDC for npm provenance
13+
14+
jobs:
15+
release:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: '18'
27+
28+
- name: Setup pnpm
29+
uses: pnpm/action-setup@v4
30+
with:
31+
version: '10.12.1'
32+
33+
- name: Install dependencies
34+
run: pnpm install --frozen-lockfile
35+
36+
- name: Lint
37+
run: pnpm run lint
38+
39+
- name: Build
40+
run: pnpm run build
41+
42+
- name: Release
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
46+
run: npx semantic-release

.releaserc.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"branches": ["master"],
3+
"plugins": [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
"@semantic-release/changelog",
7+
"@semantic-release/npm",
8+
[
9+
"@semantic-release/git",
10+
{
11+
"assets": ["CHANGELOG.md", "package.json"],
12+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
13+
}
14+
],
15+
"@semantic-release/github"
16+
]
17+
}

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,14 @@
3737
},
3838
"devDependencies": {
3939
"@anthropic-ai/dxt": "^0.2.6",
40+
"@semantic-release/changelog": "^6.0.3",
41+
"@semantic-release/git": "^10.0.1",
4042
"@types/mime-types": "^2.1.4",
4143
"@types/node": "^22.10.5",
4244
"@typescript-eslint/eslint-plugin": "^8.18.2",
4345
"@typescript-eslint/parser": "^8.18.2",
4446
"eslint": "^9.17.0",
47+
"semantic-release": "^24.2.7",
4548
"typescript": "^5.7.3"
4649
},
4750
"engines": {

0 commit comments

Comments
 (0)