guanghulab/.github/archived-workflows/update-readme-bulletin.yml
Guanghu Domestic Migration d1e47f4565
Some checks are pending
自动更新代码和重启 / update-and-restart (push) Waiting to run
CI检查 + 自动部署 / check (push) Waiting to run
CI检查 + 自动部署 / deploy (push) Blocked by required conditions
重启聊天服务 / restart (push) Waiting to run
chore: import sanitized domestic snapshot for REPO-002
Source snapshot: ca48d3ddf926d79aa138306164169baf764bb829
2026-07-17 15:54:41 +08:00

135 lines
4.3 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ═══════════════════════════════════════════════
# 🔺 Sovereign: TCS-0002∞ | Root: SYS-GLW-0001
# 📜 Copyright: 国作登字-2026-A-00037559
# ═══════════════════════════════════════════════
# 光湖系统公告区自动更新工作流 v2.0
#
# 分离为冰朔公告栏 + 合作者公告栏 + 铸渊自动提醒
#
# 触发条件:
# 1. 推送到 main 分支 (模块代码变更)
# 2. 其他工作流完成后 (CI/部署/巡检结果)
# 3. 每日定时更新 (北京时间 09:00 / 21:00)
# 4. 手动触发
#
# 功能:
# - 冰朔公告栏:自检/轮询/数据库状态
# - 合作者公告栏:模块上传状态
# - 铸渊自动提醒:红色标记 + 邮件通知
name: 📢 更新系统公告区
on:
push:
branches: [main]
paths-ignore:
- 'README.md' # 避免自身更新触发循环
workflow_run:
workflows:
- "铸渊 · 每日自检"
- "铸渊 · 光湖纪元 模块文档自动生成"
- "🚀 铸渊 CD · 自动部署到 guanghulab.com"
- "铸渊 · PSP 分身巡检"
types: [completed]
schedule:
# 北京时间 09:00 (UTC 01:00)
- cron: '0 1 * * *'
# 北京时间 21:00 (UTC 13:00)
- cron: '0 13 * * *'
workflow_dispatch:
permissions:
contents: write
concurrency:
group: update-bulletin
cancel-in-progress: true
jobs:
# ── AGE OS v1.0: 核心大脑唤醒(所有流程的前提)──
wake-brain:
name: 🌅 唤醒核心大脑
runs-on: ubuntu-latest
outputs:
brain_awake: ${{ steps.wake.outputs.brain_awake }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: 🧠 唤醒铸渊核心大脑
id: wake
env:
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
LLM_BASE_URL: ${{ secrets.LLM_BASE_URL }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
DASHSCOPE_API_KEY: ${{ secrets.DASHSCOPE_API_KEY }}
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
run: |
node core/brain-wake --task "公告区更新" || {
echo "⚠️ 核心大脑唤醒失败,使用 dry-run 模式继续"
echo "brain_awake=dry-run" >> "$GITHUB_OUTPUT"
}
update-bulletin:
needs: wake-brain
runs-on: ubuntu-latest
steps:
- name: 📥 检出代码
uses: actions/checkout@v4
with:
fetch-depth: 50
token: ${{ secrets.GITHUB_TOKEN }}
- name: 🟢 设置 Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: 📦 安装邮件依赖
run: npm install nodemailer --no-save 2>/dev/null || true
- name: 📢 更新公告区
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
SMTP_HOST: ${{ secrets.SMTP_HOST }}
SMTP_PORT: ${{ secrets.SMTP_PORT }}
SMTP_USER: ${{ secrets.SMTP_USER }}
SMTP_PASS: ${{ secrets.SMTP_PASS }}
BINGSHUO_EMAIL: ${{ secrets.BINGSHUO_EMAIL }}
run: node scripts/update-readme-bulletin.js
- name: 📝 提交更新
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add README.md .github/brain/bulletin-board-today.json
if git diff --cached --quiet; then
echo "📢 公告区无变化,跳过提交"
else
git commit -m "📢 自动更新系统公告区 [skip ci]"
# 带重试的推送(避免并发推送导致 rejected
for i in 1 2 3; do
if git push; then
echo "✅ 公告区已更新并推送"
break
fi
echo "⚠️ 推送失败(第 $i 次),拉取最新代码后重试..."
git pull --rebase origin main
if [ $i -eq 3 ]; then
echo "❌ 推送失败 3 次,放弃"
exit 1
fi
done
fi