This commit is contained in:
+96
@@ -0,0 +1,96 @@
|
||||
name: Auto Release
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [develop]
|
||||
types: [opened, synchronize, reopened, closed]
|
||||
paths:
|
||||
- package.json
|
||||
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@v4
|
||||
- uses: TDesignOteam/tdesign-tag-action@main
|
||||
id: tag-action
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- uses: TDesignOteam/tdesign-changelog-action@main
|
||||
id: changelog
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag: ${{ steps.tag-action.outputs.version }}
|
||||
- name: Add comment
|
||||
uses: peter-evans/create-or-update-comment@v4
|
||||
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@v4
|
||||
with:
|
||||
ref: ${{ steps.comment.outputs.branch }}
|
||||
- name: Commit and push if needed
|
||||
env:
|
||||
BODY: ${{ github.event.comment.body }}
|
||||
run: |
|
||||
txt=$(cat CHANGELOG.md)
|
||||
echo "${txt%%##*}$BODY${txt##*---}" > 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@v4
|
||||
with:
|
||||
ref: develop
|
||||
token: ${{ secrets.TDESIGN_BOT_TOKEN }}
|
||||
- uses: TDesignOteam/tdesign-tag-action@main
|
||||
id: tag-action
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: tag and push if needed
|
||||
run: |
|
||||
echo "${{ steps.tag-action.outputs.version }}"
|
||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git config --local user.name "github-actions[bot]"
|
||||
git tag ${{ steps.tag-action.outputs.version }}
|
||||
git push origin ${{ steps.tag-action.outputs.version }}
|
||||
echo "pushed tag ${{ steps.tag-action.outputs.version }}"
|
||||
@@ -0,0 +1,10 @@
|
||||
# 当打上 "help wanted" 标签时,自动留言引导社区贡献
|
||||
name: issue-help-wanted
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [labeled]
|
||||
|
||||
jobs:
|
||||
call-issue-help-wanted:
|
||||
uses: TDesignOteam/workflows/.github/workflows/reusable-issue-help-wanted.yml@main
|
||||
@@ -0,0 +1,10 @@
|
||||
# 当 comment 中回复类似 "Duplicate of #111" 时,自动打标签并关闭 issue
|
||||
name: issue-mark-duplicate
|
||||
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created, edited]
|
||||
|
||||
jobs:
|
||||
call-issue-mark-duplicate:
|
||||
uses: TDesignOteam/workflows/.github/workflows/reusable-issue-mark-duplicate.yml@main
|
||||
@@ -0,0 +1,10 @@
|
||||
# 当打上 "Need Reproduce" 标签时,自动提示提供重现实例
|
||||
name: issue-need-reproduce
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [labeled]
|
||||
|
||||
jobs:
|
||||
call-issue-need-reproduce:
|
||||
uses: TDesignOteam/workflows/.github/workflows/reusable-issue-need-reproduce.yml@main
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
# 当 issue 被创建时,自动回复引导完善信息
|
||||
name: issue-welcome
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
call-issue-welcome:
|
||||
uses: TDesignOteam/workflows/.github/workflows/reusable-issue-welcome.yml@main
|
||||
@@ -0,0 +1,12 @@
|
||||
# force copy from tencent/tdesign
|
||||
name: pr-spell-check
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
name: Spell Check with Typos
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Check spelling
|
||||
uses: crate-ci/typos@master
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
# 文件名建议统一为 preview-publish
|
||||
# 应用 preview.yml 的 demo
|
||||
name: PREVIEW_PUBLISH
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["MAIN_PULL_REQUEST"]
|
||||
types:
|
||||
- completed
|
||||
|
||||
jobs:
|
||||
call-preview:
|
||||
uses: TDesignOteam/workflows/.github/workflows/reusable-pr-preview.yml@main
|
||||
secrets:
|
||||
TDESIGN_SURGE_TOKEN: ${{ secrets.TDESIGN_SURGE_TOKEN }}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
# 文件名建议统一为 pull-request.yml
|
||||
# 应用 test-build.yml 的 demo
|
||||
|
||||
name: MAIN_PULL_REQUEST
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [develop, main, site]
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
jobs:
|
||||
call-test-build:
|
||||
uses: TDesignOteam/workflows/.github/workflows/reusable-unit-test.yml@main
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
name: Sync to CNB
|
||||
on:
|
||||
- push
|
||||
- delete
|
||||
|
||||
jobs:
|
||||
sync-push:
|
||||
if: ${{ github.repository == 'Tencent/tdesign-vue-next-starter' && github.event_name == 'push' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Sync to CNB Repository
|
||||
uses: docker://tencentcom/git-sync
|
||||
env:
|
||||
PLUGIN_TARGET_URL: "https://cnb.cool/tencent/tdesign/tdesign-vue-next-starter.git"
|
||||
PLUGIN_AUTH_TYPE: "https"
|
||||
PLUGIN_USERNAME: "cnb"
|
||||
PLUGIN_PASSWORD: ${{ secrets.CNB_TOKEN }}
|
||||
PLUGIN_FORCE: "true"
|
||||
|
||||
sync-delete-branch:
|
||||
if: ${{ github.repository == 'Tencent/tdesign-vue-next-starter' && github.event_name == 'delete' && github.event.ref_type == 'branch' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: TDesignOteam//tdesign-pr-trigger-action@develop
|
||||
with:
|
||||
repo: 'tencent/tdesign/tdesign-vue-next-starter'
|
||||
token: ${{ secrets.CNB_TOKEN }}
|
||||
branch: ${{ github.event.ref }}
|
||||
trigger: '/delete-cnb-branch'
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
# 文件名建议统一为 tag-push.yml
|
||||
# 应用 publish.yml 的 demo
|
||||
|
||||
name: TAG_PUSH
|
||||
|
||||
on: create
|
||||
|
||||
jobs:
|
||||
TAG_PUSH:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.ref_type == 'tag'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: main
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.TDESIGN_BOT_TOKEN }}
|
||||
- run: |
|
||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git config --local user.name "github-actions[bot]"
|
||||
git status
|
||||
git fetch origin
|
||||
git merge origin/develop
|
||||
git push origin main
|
||||
Reference in New Issue
Block a user