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 }})" + } + }