ci: decouple notify from build to avoid blocking release
Some checks failed
Secrets CLI - Build & Release / 版本 & Release (push) Successful in 1s
Secrets CLI - Build & Release / 通知 (push) Successful in 2s
Secrets CLI - Build & Release / 质量检查 (fmt / clippy / test) (push) Successful in 23s
Secrets CLI - Build & Release / Build (aarch64-apple-darwin) (push) Successful in 20s
Secrets CLI - Build & Release / Build (x86_64-unknown-linux-musl) (push) Successful in 28s
Secrets CLI - Build & Release / Build (x86_64-pc-windows-msvc) (push) Has been cancelled
Some checks failed
Secrets CLI - Build & Release / 版本 & Release (push) Successful in 1s
Secrets CLI - Build & Release / 通知 (push) Successful in 2s
Secrets CLI - Build & Release / 质量检查 (fmt / clippy / test) (push) Successful in 23s
Secrets CLI - Build & Release / Build (aarch64-apple-darwin) (push) Successful in 20s
Secrets CLI - Build & Release / Build (x86_64-unknown-linux-musl) (push) Successful in 28s
Secrets CLI - Build & Release / Build (x86_64-pc-windows-msvc) (push) Has been cancelled
Make notification fire independently of matrix builds so stalled runners do not block release publishing. Made-with: Cursor
This commit is contained in:
@@ -238,14 +238,15 @@ jobs:
|
|||||||
# ========== 通知 ==========
|
# ========== 通知 ==========
|
||||||
notify:
|
notify:
|
||||||
name: 通知
|
name: 通知
|
||||||
needs: [version, build]
|
needs: [version]
|
||||||
if: always() && github.event_name == 'push'
|
if: always() && github.event_name == 'push'
|
||||||
runs-on: debian
|
runs-on: debian
|
||||||
|
timeout-minutes: 1
|
||||||
|
continue-on-error: true
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: 发送飞书通知
|
- name: 发送飞书通知
|
||||||
continue-on-error: true
|
|
||||||
env:
|
env:
|
||||||
WEBHOOK_URL: ${{ vars.WEBHOOK_URL }}
|
WEBHOOK_URL: ${{ vars.WEBHOOK_URL }}
|
||||||
run: |
|
run: |
|
||||||
@@ -254,23 +255,17 @@ jobs:
|
|||||||
|
|
||||||
tag="${{ needs.version.outputs.tag }}"
|
tag="${{ needs.version.outputs.tag }}"
|
||||||
tag_exists="${{ needs.version.outputs.tag_exists }}"
|
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")
|
commit=$(git log -1 --pretty=format:"%s" 2>/dev/null || echo "N/A")
|
||||||
url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }}"
|
url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }}"
|
||||||
|
|
||||||
if [ "$result" != "success" ]; then
|
msg="${{ env.BINARY_NAME }} 通知"
|
||||||
extra=""
|
if [ "$tag_exists" = "false" ]; then
|
||||||
elif [ "$tag_exists" = "false" ]; then
|
msg="${msg}
|
||||||
extra="🆕 新版本已发布 (linux / macOS / windows)"
|
🆕 已创建版本标签并开始构建发布"
|
||||||
else
|
else
|
||||||
extra="🔄 重复构建"
|
msg="${msg}
|
||||||
|
🔄 检测到已有版本标签,已开始重复构建"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
msg="${{ env.BINARY_NAME }} ${status}"
|
|
||||||
[ -n "$extra" ] && msg="${msg}
|
|
||||||
${extra}"
|
|
||||||
msg="${msg}
|
msg="${msg}
|
||||||
提交:${commit}
|
提交:${commit}
|
||||||
版本:${tag}
|
版本:${tag}
|
||||||
|
|||||||
Reference in New Issue
Block a user