From 3d00b65f55edf63ef71446c687172db9446d1825 Mon Sep 17 00:00:00 2001 From: voson Date: Wed, 18 Mar 2026 14:43:45 +0800 Subject: [PATCH] Revert "ci: decouple notify from build to avoid blocking release" This reverts commit 1acc2537b3c6d965524beed453222ce3f8e82167. --- .gitea/workflows/secrets.yml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/secrets.yml b/.gitea/workflows/secrets.yml index 9e9bbcd..17f9c6d 100644 --- a/.gitea/workflows/secrets.yml +++ b/.gitea/workflows/secrets.yml @@ -238,15 +238,14 @@ jobs: # ========== 通知 ========== notify: name: 通知 - needs: [version] + needs: [version, build] if: always() && github.event_name == 'push' runs-on: debian - timeout-minutes: 1 - continue-on-error: true steps: - uses: actions/checkout@v4 - name: 发送飞书通知 + continue-on-error: true env: WEBHOOK_URL: ${{ vars.WEBHOOK_URL }} run: | @@ -255,17 +254,23 @@ jobs: tag="${{ needs.version.outputs.tag }}" tag_exists="${{ needs.version.outputs.tag_exists }}" + result="${{ needs.build.result }}" + [ "$result" = "success" ] && status="构建成功 ✅" || status="构建失败 ❌" + commit=$(git log -1 --pretty=format:"%s" 2>/dev/null || echo "N/A") url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }}" - msg="${{ env.BINARY_NAME }} 通知" - if [ "$tag_exists" = "false" ]; then - msg="${msg} - 🆕 已创建版本标签并开始构建发布" + if [ "$result" != "success" ]; then + extra="" + elif [ "$tag_exists" = "false" ]; then + extra="🆕 新版本已发布 (linux / macOS / windows)" else - msg="${msg} - 🔄 检测到已有版本标签,已开始重复构建" + extra="🔄 重复构建" fi + + msg="${{ env.BINARY_NAME }} ${status}" + [ -n "$extra" ] && msg="${msg} + ${extra}" msg="${msg} 提交:${commit} 版本:${tag}