Skip to content

Commit

Permalink
Merge branch 'Tencent:main' into feature/TDSideBar
Browse files Browse the repository at this point in the history
  • Loading branch information
shizhe2018 authored May 27, 2024
2 parents 704dc2d + 45c3beb commit d220470
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 3 deletions.
89 changes: 89 additions & 0 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Auto Release

on:
pull_request:
branches: [develop]
types: [opened, synchronize, reopened, closed]
paths:
- "tdesign-component/pubspec.yaml"
issue_comment:
types: [edited]

jobs:
generator:
runs-on: ubuntu-latest
if: >
github.event_name == 'pull_request' &&
github.event.pull_request.merged == false &&
startsWith(github.head_ref, 'release/')
steps:
- run: echo "The head of this PR starts with 'release/'"
- uses: actions/checkout@v3
- uses: 94dreamer/auto-release@develop
id: changelog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Add comment
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
${{ steps.changelog.outputs.changelog }}
comment_add_log:
runs-on: ubuntu-latest
if: >
github.event_name == 'issue_comment'
&& github.event.issue.pull_request
&& github.event.sender.login == github.event.issue.user.login
&& startsWith(github.event.comment.body, '## 🌈 ')
steps:
- id: comment
shell: bash
run: |
result=$(curl ${{github.event.issue.pull_request.url}} -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}")
headrefreg='"ref": "(release/[[:digit:]]{1,2}\.[[:digit:]]{1,2}\.[[:digit:]]{1,2})",'
if [[ $result =~ $headrefreg ]]
then
echo "属于 release pr 的 comment ${BASH_REMATCH[1]}"
else
echo "不属于 release pr 的 comment" && exit 1
fi
echo "::set-output name=branch::${BASH_REMATCH[1]}"
# zsh $match[1]
- uses: actions/checkout@v3
with:
ref: ${{ steps.comment.outputs.branch }}
- name: Commit and push if needed
env:
BODY: ${{ github.event.comment.body }}
run: |
txt=$(cat tdesign-site/CHANGELOG.md)
echo "${txt%%##*}$BODY${txt##*---}" > tdesign-site/CHANGELOG.md
git add .
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -m "chore: changelog's changes"
git push
echo "💾 pushed changelog's changes"
merge_tag:
runs-on: ubuntu-latest
if: >
github.event_name == 'pull_request' &&
github.event.pull_request.merged == true &&
startsWith(github.head_ref, 'release/')
steps:
- uses: actions/checkout@v3
with:
ref: develop
token: ${{ secrets.PERSONAL_TOKEN }}
- name: tag and push if needed
run: |
data=$(cat tdesign-component/pubspec.yaml)
re="\"version\": \"([^\"]*)\""
[[ $data =~ $re ]]
echo "${BASH_REMATCH[1]}"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git tag ${BASH_REMATCH[1]}
git push origin ${BASH_REMATCH[1]}
echo "pushed tag ${BASH_REMATCH[1]}"
10 changes: 10 additions & 0 deletions PUBLISH.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 版本发布流程

## 发布流程

-`develop` 新建 `release/x.y.z` 分支,并修改 `tdesign-component/pubspec.yaml` 中的`version`版本号,推送分支至远程仓库,并提交一个合入`develop`的 Pull Request 到仓库
- 仓库的 Github Action 会自动整理上个版本至今 commit 对应的 CHANGELOG,并将 CHANGELOG 的 draft 作为一个评论推送到该 Pull Request 上
- 发布人检查 CHANGELOG,并优化内容逻辑结构,确认无误后删除对于评论首行提示,Github Action 会将优化后的内容写入 CHANGELOG.md 内
- 确认无误后,合并分支入`develop`
- 合入 `develop` 后,仓库会触发 Github Action 合入`main`分支,并将版本号作为 `tag` 打在仓库上,并触发 Github Action 执行版本发布流程
- 合入 `main` 分支后,站点的部署流水线 web hook 会监听到 `main` 分支的新增 commit,并触发流水线,官网更新站点
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@
</a>
</p>

TDesign Flutter技术栈组件库,适合在移动端项目中使用。
TDesign Flutter 技术栈组件库,适合在移动端项目中使用。

# 简介
Flutter组件库项目在tdesign-component文件夹下,相关使用详见[tdesign-component/README_zh.md](./tdesign-component/README_zh.md)

Flutter 组件库项目在 tdesign-component 文件夹下,相关使用详见[tdesign-component/README_zh.md](./tdesign-component/README_zh.md)

# 其他技术栈实现

- 桌面端 Vue 3 实现:[web-vue-next](https://github.com/Tencent/tdesign-vue-next)
- 桌面端 React 实现: [web-react](https://github.com/Tencent/tdesign-react)
- 移动端小程序实现: [小程序](https://github.com/Tencent/tdesign-miniprogram)

# 交流反馈

<img src="feedback.png" width = "200" height = "200" alt="feedback" align=center />
<img src="https://raw.githubusercontent.com/Tencent/tdesign/main/packages/components/src/images/groups/flutter-group.png" width="200" />

# 开源协议

Expand Down
Binary file removed feedback.png
Binary file not shown.

0 comments on commit d220470

Please sign in to comment.