-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update build and release scripts
- Loading branch information
1 parent
d56fe36
commit 040e98d
Showing
14 changed files
with
11,885 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# 工作流名称 | ||
name: Build and Deploy | ||
|
||
on: | ||
# 指明要运行的分支,跟上面配置保持一致 | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# 把分支拉出来 | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
# 指定node版本 | ||
- name: Set node version | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
|
||
# 安装依赖,包括我们的 semantic-release 全套 | ||
- name: Install | ||
run: npm install | ||
|
||
# 执行 semantic-release 发布包 | ||
- name: Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }} | ||
run: npx semantic-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v18 | ||
v20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module.exports = { | ||
branches: ['main'], // 指定在哪个分支下要执行发布操作 | ||
plugins: [ | ||
'@semantic-release/commit-analyzer', // 用于分析提交的类型,feat和fix类型都会发版和升级版本号 | ||
'@semantic-release/release-notes-generator', // 生成 CHANGELOG.md 文件 | ||
[ | ||
'@semantic-release/changelog', // 将 commit 记录到项目的 changelog 文件中 | ||
{ | ||
changelogFile: 'CHANGELOG.md', | ||
}, | ||
], | ||
[ | ||
'@semantic-release/exec', | ||
{ | ||
// 这里可以运行你的自定义脚本 | ||
prepareCmd: 'node ./scripts/build.js ${nextRelease.version} && node ./scripts/release.js', | ||
}, | ||
], | ||
'@semantic-release/npm', // 用来更新 package.json 的,如果不需要发到 npm 可以设 npmPublish 为 false | ||
'@semantic-release/github', // 发布 GitHub Release 并对已发布的拉取请求/问题发表评论。 | ||
[ | ||
'@semantic-release/git', // 把发版过程中修改的文件提交到 Git 仓库 | ||
{ | ||
assets: ['CHANGELOG.md', 'package.json'], | ||
}, | ||
], | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.