Skip to content

Commit

Permalink
feat: 测试 CD 场景
Browse files Browse the repository at this point in the history
  • Loading branch information
ziyi2 committed Oct 17, 2023
1 parent a0d9f8d commit cc7a4e1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,16 @@ jobs:
- name: 单元测试
run: npm test

# 上传测试报告
- name: 测试报告
uses: coverallsapp/github-action@v2

- name: 文档构建
run: npm run docs:build

# 如果代码构建失败,则不需要进行文档部署
- name: 代码构建
run: npm run build

# 部署文档
- name: 部署文档
uses: peaceiris/actions-gh-pages@v3
Expand All @@ -49,5 +52,8 @@ jobs:
# 设置上传到 gs-pages 分支的 commit 信息
full_commit_message: ${{ github.event.head_commit.message }}

- name: 代码构建
run: npm run build
# 基于构建的代码进行版本发布
- name: 发布库包
run: npm run release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion build/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Release extends Base {
// 拷贝 README.md 并生成 package.json
this.prepare();
// 发布预检
await this.check();
// await this.check();
// 发布处理
this.release();
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "micro-framework",
"version": "1.0.6",
"version": "1.0.7",
"description": "深入浅出微前端",
"scripts": {
"prepare": "husky install",
"build": "ts-node build/build.ts",
"release": "npm run build && ts-node build/release.ts",
"release": "ts-node build/release.ts",
"lint": "eslint --ext .ts src test",
"prettier": "prettier src",
"test": "jest --bail",
Expand Down

0 comments on commit cc7a4e1

Please sign in to comment.