Skip to content

Commit

Permalink
build: ci构建更新测试
Browse files Browse the repository at this point in the history
  • Loading branch information
chennlang committed Oct 29, 2024
1 parent 56cd7aa commit 7b0dc84
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 4 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release

on:
push:
branches: [main]

permissions:
contents: write
issues: write
pull-requests: write
packages: write
id-token: write

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: 签出代码
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false

- name: 安装 nodejs
uses: actions/[email protected]
with:
node-version: "20.8.1"

- name: 构建 web app
working-directory: ./packages/web
run: |
pnpm install --no-frozen-lockfile
pnpm run build
cp -r dist/* ../server/libs/web-dist/
- name: 发布 core npm 包
env:
GITHUB_TOKEN: ${{ secrets.PUBLISH_GH_TOKEN }}
NPM_TOKEN: ${{ secrets.PUBLISH_NPM_TOKEN }}
run: npx semantic-release
working-directory: packages/core

- name: 发布 server npm 包
env:
GITHUB_TOKEN: ${{ secrets.PUBLISH_GH_TOKEN }}
NPM_TOKEN: ${{ secrets.PUBLISH_NPM_TOKEN }}
run: npx semantic-release
working-directory: packages/server
2 changes: 1 addition & 1 deletion packages/core/.releaserc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
branches: ["release"], // 指定在哪个分支下要执行发布操作
branches: ["main"], // 指定在哪个分支下要执行发布操作
plugins: [
"@semantic-release/commit-analyzer", // 解析 commit 信息,默认就是 Angular 规范
"@semantic-release/release-notes-generator",
Expand Down
6 changes: 3 additions & 3 deletions packages/server/.releaserc.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
module.exports = {
branches: ["release"], // 指定在哪个分支下要执行发布操作
branches: ["main"], // 指定在哪个分支下要执行发布操作
plugins: [
"@semantic-release/commit-analyzer", // 解析 commit 信息,默认就是 Angular 规范
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
changelogFile: "CHANGELOG.md", // 把发布日志写入该文件
changelogFile: "../../CHANGELOG.md", // 把发布日志写入该文件
},
],
"@semantic-release/npm", // 发布到NPM
"@semantic-release/github",
[
"@semantic-release/git",
{
assets: ["CHANGELOG.md", "package.json"], // 前面说到日志记录和版本好是新增修改的,需要 push 回 Git
assets: ["../../CHANGELOG.md", "../../package.json"], // 前面说到日志记录和版本好是新增修改的,需要 push 回 Git
},
],
],
Expand Down

0 comments on commit 7b0dc84

Please sign in to comment.