Skip to content

Commit

Permalink
chore: adjust release pr workflow (#6044)
Browse files Browse the repository at this point in the history
* chore: adjust workflow and add publish doc

---------

Co-authored-by: antv <antv@antfin.com>
  • Loading branch information
Aarebecca and antv authored Jul 16, 2024
1 parent 21463f2 commit 2a7c953
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 73 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/release.yml → .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# 合并 release 分支到 v5 分支时自动发布到 npm
name: Auto Release
# 当具有 publish 标签的 PR 被合并时,自动发布新版本
# Automatically publish a new version when a PR with the publish label is merged
name: Auto Publish
on:
pull_request:
types: [closed]
branches:
- v5

jobs:
release:
publish:
runs-on: ubuntu-latest
if: github.event.pull_request.head.ref == 'release' && github.event.pull_request.merged == true
if: contains(github.event.pull_request.labels.*.name, 'publish') && github.event.pull_request.merged == true

steps:
- uses: actions/checkout@v3
Expand All @@ -23,8 +24,9 @@ jobs:
uses: pnpm/action-setup@v4
with:
version: 9
run_install: true

- name: Release
- name: Publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
27 changes: 0 additions & 27 deletions .github/workflows/release-pr.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/workflows/version.yml

This file was deleted.

19 changes: 19 additions & 0 deletions PUBLISH.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
This project uses changeset to manage version release, and the specific release process is as follows:

1. Complete related development work
2. Create a branch from v5 (any name you want)
3. Run `pnpm changeset` and fill in the information as prompted
4. run `pnpm run version` to generate the version number
5. Merge the branch into the v5 branch by creating a PR on GitHub and adding a `publish` tag
6. When a branch is merged, GitHub Actions are automatically triggered and published to npm

---

本项目通过 changeset 来管理版本发布,具体的发布流程如下:

1. 完成相关的开发工作
2. 从 v5 分支创建一个分支(任意分支名均可)
3. 执行 `pnpm changeset` 命令,根据提示填写相关信息
4. 执行 `pnpm run version` 命令,生成版本号
5. 在 GitHub 上创建一个 PR,并添加 `publish` 标签,将该分支合并到 v5 分支
6. 分支合并后,会自动触发 GitHub Actions,发布到 npm
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
"private": true,
"repository": "https://github.com/antvis/G6.git",
"scripts": {
"site": "pnpm -r --stream --filter=./packages/site run dev",
"watch": "pnpm -r --stream --filter=!./site run start",
"postinstall": "husky install",
"prepare": "husky install",
"build": "turbo build --filter=!@antv/g6-site",
"ci": "turbo run ci --filter=!@antv/g6-site",
"contribute": "node ./scripts/contribute.mjs",
"postinstall": "husky install",
"prepare": "husky install",
"publish": "pnpm publish -r --publish-branch v5",
"release": "changeset release"
"release": "changeset release",
"site": "pnpm -r --stream --filter=./packages/site run dev",
"version": "changeset version && turbo version",
"watch": "pnpm -r --stream --filter=!./site run start"
},
"commitlint": {
"extends": [
Expand Down
3 changes: 2 additions & 1 deletion turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
},
"ci": {
"dependsOn": ["^ci"]
}
},
"version": {}
}
}

0 comments on commit 2a7c953

Please sign in to comment.