From 90d3e82352f414abc1c43086510aa0f9fc37f9ea Mon Sep 17 00:00:00 2001 From: Fiona Date: Fri, 21 Aug 2026 07:36:56 -0700 Subject: [PATCH] ci: announce release outcome to DingTalk Add success and failure notification steps to the publish job, matching the other SDK repositories. Success is sent to both the original and the second DingTalk robot; failure is sent to the original robot only. --- .github/workflows/publish-pub-dev.yml | 45 +++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/.github/workflows/publish-pub-dev.yml b/.github/workflows/publish-pub-dev.yml index b6b58962..974d9f5e 100644 --- a/.github/workflows/publish-pub-dev.yml +++ b/.github/workflows/publish-pub-dev.yml @@ -94,3 +94,48 @@ jobs: - name: Publish ${{ steps.package.outputs.name }} working-directory: ${{ steps.package.outputs.dir }} run: flutter pub publish --force + + - name: Notify deployment success + if: success() + uses: zcong1993/actions-ding@master + with: + dingToken: ${{ secrets.DING_TALK_TOKEN }} + secret: ${{ secrets.DING_TALK_SECRET }} + body: | + { + "msgtype": "markdown", + "markdown": { + "title": "fc-sdk-flutter 发布通知", + "text": "### ✅ fc-sdk-flutter 发布成功\n\n---\n\n 📦 包名: ${{ steps.package.outputs.name }}\n\n 🔖 版本: ${{ steps.package.outputs.version }}\n\n 👨‍💻 发布者: ${{ github.actor }}\n\n 🚀 [查看详情](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})" + } + } + + - name: Notify secondary DingTalk group on success + if: success() + uses: zcong1993/actions-ding@master + with: + dingToken: ${{ secrets.DING_TALK_TOKEN_2 }} + secret: ${{ secrets.DING_TALK_SECRET_2 }} + body: | + { + "msgtype": "markdown", + "markdown": { + "title": "fc-sdk-flutter 发布通知", + "text": "### ✅ fc-sdk-flutter 发布成功\n\n---\n\n 📦 包名: ${{ steps.package.outputs.name }}\n\n 🔖 版本: ${{ steps.package.outputs.version }}\n\n 👨‍💻 发布者: ${{ github.actor }}\n\n 🚀 [查看详情](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})" + } + } + + - name: Notify deployment failure + if: failure() + uses: zcong1993/actions-ding@master + with: + dingToken: ${{ secrets.DING_TALK_TOKEN }} + secret: ${{ secrets.DING_TALK_SECRET }} + body: | + { + "msgtype": "markdown", + "markdown": { + "title": "fc-sdk-flutter 发布通知", + "text": "### ❌ fc-sdk-flutter 发布失败\n\n---\n\n 🔖 标签: ${{ github.ref_name }}\n\n 👨‍💻 发布者: ${{ github.actor }}\n\n 🚀 [查看详情](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})" + } + }