name: Release notify

on:
  release:
    types: [published]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Send DingGroup1 Notify
        uses: zcong1993/actions-ding@master
        with:
          dingToken: ${{ secrets.DING_GROUP_1_TOKEN }}
          secret: ${{ secrets.DING_GROUP_1_SIGN }}
          body: |
            {
              "msgtype": "markdown",
              "markdown": {
                  "title": "qiankun ${{github.event.release.tag_name}} 发布公告",
                  "text": "# qiankun [${{github.event.release.tag_name}}](${{github.event.release.html_url}}) 发布公告\n${{github.event.release.body}}",
              }
            }

      - name: Send DingGroup2 Notify
        uses: zcong1993/actions-ding@master
        with:
          dingToken: ${{ secrets.DING_GROUP_2_TOKEN }}
          secret: ${{ secrets.DING_GROUP_2_SIGN }}
          body: |
            {
              "msgtype": "markdown",
              "markdown": {
                  "title": "qiankun ${{github.event.release.tag_name}} 发布公告",
                  "text": "# qiankun [${{github.event.release.tag_name}}](${{github.event.release.html_url}}) 发布公告\n${{github.event.release.body}}",
              }
            }

      - name: Send DingGroupInc Notify
        uses: zcong1993/actions-ding@master
        with:
          dingToken: ${{ secrets.DING_GROUP_INC_TOKEN }}
          secret: ${{ secrets.DING_GROUP_INC_SIGN }}
          body: |
            {
              "msgtype": "markdown",
              "markdown": {
                  "title": "qiankun ${{github.event.release.tag_name}} 发布公告",
                  "text": "# qiankun [${{github.event.release.tag_name}}](${{github.event.release.html_url}}) 发布公告\n${{github.event.release.body}}",
              }
            }
