Skip to content

Commit 3e4b024

Browse files
committed
更新 CI 工作流:semantic-release-action
1 parent 734924d commit 3e4b024

File tree

5 files changed

+43
-48
lines changed

5 files changed

+43
-48
lines changed

.github/workflows/ci.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ jobs:
1111
test:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@main
1514
- uses: yanhao98/composite-actions/setup-node-environment@main
1615
- run: pnpm test
1716
- name: "Memory test"

.github/workflows/publish.yml

-46
This file was deleted.
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Release and publish
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
release:
8+
runs-on: ubuntu-latest
9+
permissions: # Job-level permissions configuration starts here
10+
id-token: write # npm provenance requires this permission
11+
contents: write # to be able to publish a GitHub release
12+
issues: write # to be able to comment on released issues
13+
pull-requests: write # to be able to comment on released pull requests
14+
steps:
15+
- uses: yanhao98/composite-actions/setup-node-environment@main
16+
- uses: yanhao98/semantic-release-action@main
17+
env:
18+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
19+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.releaserc.yaml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
plugins:
3+
- "@semantic-release/commit-analyzer"
4+
- "@semantic-release/release-notes-generator"
5+
- "@semantic-release/changelog"
6+
# #############################
7+
# https://github.com/semantic-release/npm?tab=readme-ov-file#environment-variables
8+
# #############################
9+
- - "@semantic-release/npm"
10+
# [provenance](https://docs.npmjs.com/generating-provenance-statements#using-third-party-package-publishing-tools)
11+
- npmPublish: true
12+
# #############################
13+
# https://github.com/semantic-release/github?tab=readme-ov-file#configuration
14+
# #############################
15+
- "@semantic-release/github"
16+
- - "@semantic-release/git"
17+
- message: |-
18+
chore(release): ${nextRelease.version} [skip ci]
19+
20+
${nextRelease.notes}

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,8 @@
4040
"tsup": "^8.3.5",
4141
"typescript": "^5.6.3",
4242
"vitest": "^2.1.3"
43-
}
43+
},
44+
"publishConfig": {
45+
"provenance": true
46+
}
4447
}

0 commit comments

Comments
 (0)