Skip to content

Commit

Permalink
更新 CI 工作流:semantic-release-action
Browse files Browse the repository at this point in the history
  • Loading branch information
yanhao98 committed Nov 15, 2024
1 parent 734924d commit 3e4b024
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 48 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- uses: yanhao98/composite-actions/setup-node-environment@main
- run: pnpm test
- name: "Memory test"
Expand Down
46 changes: 0 additions & 46 deletions .github/workflows/publish.yml

This file was deleted.

19 changes: 19 additions & 0 deletions .github/workflows/release-and-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Release and publish
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
permissions: # Job-level permissions configuration starts here
id-token: write # npm provenance requires this permission
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
steps:
- uses: yanhao98/composite-actions/setup-node-environment@main
- uses: yanhao98/semantic-release-action@main
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20 changes: 20 additions & 0 deletions .releaserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
plugins:
- "@semantic-release/commit-analyzer"
- "@semantic-release/release-notes-generator"
- "@semantic-release/changelog"
# #############################
# https://github.com/semantic-release/npm?tab=readme-ov-file#environment-variables
# #############################
- - "@semantic-release/npm"
# [provenance](https://docs.npmjs.com/generating-provenance-statements#using-third-party-package-publishing-tools)
- npmPublish: true
# #############################
# https://github.com/semantic-release/github?tab=readme-ov-file#configuration
# #############################
- "@semantic-release/github"
- - "@semantic-release/git"
- message: |-
chore(release): ${nextRelease.version} [skip ci]
${nextRelease.notes}
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,8 @@
"tsup": "^8.3.5",
"typescript": "^5.6.3",
"vitest": "^2.1.3"
}
},
"publishConfig": {
"provenance": true
}
}

0 comments on commit 3e4b024

Please sign in to comment.