From c5d1f2dd7a0ee0a89ea8ab89e6b0931381caa7e6 Mon Sep 17 00:00:00 2001 From: tommyzhang100504 <137874319+tommyzhang100504@users.noreply.github.com> Date: Sun, 6 Jul 2025 20:31:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E8=87=AA=E5=8A=A8=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7=E6=9B=B4=E5=81=A5=E5=A3=AE=20(#7864?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dispatch-docs-update.yml | 27 ++++++++++++++++ .github/workflows/release.yml | 37 +--------------------- 2 files changed, 28 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/dispatch-docs-update.yml diff --git a/.github/workflows/dispatch-docs-update.yml b/.github/workflows/dispatch-docs-update.yml new file mode 100644 index 0000000000..b9457faec6 --- /dev/null +++ b/.github/workflows/dispatch-docs-update.yml @@ -0,0 +1,27 @@ +name: Dispatch Docs Update on Release + +on: + release: + types: [released] + +permissions: + contents: write + +jobs: + dispatch-docs-update: + runs-on: ubuntu-latest + steps: + - name: Get Release Tag from Event + id: get-event-tag + shell: bash + run: | + # 从当前 Release 事件中获取 tag_name + echo "tag=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT + + - name: Dispatch update-download-version workflow to cherry-studio-docs + uses: peter-evans/repository-dispatch@v3 + with: + token: ${{ secrets.REPO_DISPATCH_TOKEN }} + repository: CherryHQ/cherry-studio-docs + event-type: update-download-version + client-payload: '{"version": "${{ steps.get-event-tag.outputs.tag }}"}' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2d60f3e75c..88513e7e50 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -117,39 +117,4 @@ jobs: makeLatest: false tag: ${{ steps.get-tag.outputs.tag }} artifacts: 'dist/*.exe,dist/*.zip,dist/*.dmg,dist/*.AppImage,dist/*.snap,dist/*.deb,dist/*.rpm,dist/*.tar.gz,dist/latest*.yml,dist/rc*.yml,dist/*.blockmap' - token: ${{ secrets.GITHUB_TOKEN }} - - dispatch-docs-update: - needs: release - if: success() && github.repository == 'CherryHQ/cherry-studio' # 确保所有构建成功且在主仓库中运行 - runs-on: ubuntu-latest - steps: - - name: Get release tag - id: get-tag - shell: bash - run: | - if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then - echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT - else - echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT - fi - - - name: Check if tag is pre-release - id: check-tag - shell: bash - run: | - TAG="${{ steps.get-tag.outputs.tag }}" - if [[ "$TAG" == *"rc"* || "$TAG" == *"pre-release"* ]]; then - echo "is_pre_release=true" >> $GITHUB_OUTPUT - else - echo "is_pre_release=false" >> $GITHUB_OUTPUT - fi - - - name: Dispatch update-download-version workflow to cherry-studio-docs - if: steps.check-tag.outputs.is_pre_release == 'false' - uses: peter-evans/repository-dispatch@v3 - with: - token: ${{ secrets.REPO_DISPATCH_TOKEN }} - repository: CherryHQ/cherry-studio-docs - event-type: update-download-version - client-payload: '{"version": "${{ steps.get-tag.outputs.tag }}"}' + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file