@yorha2b-lab/autodev 2.1.5 → 2.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -21,11 +21,16 @@ jobs:
|
|
|
21
21
|
token: ${{ secrets.STATS_TOKEN }}
|
|
22
22
|
fetch-depth: 0
|
|
23
23
|
|
|
24
|
+
# 1. 环境准备:安装绘图依赖
|
|
25
|
+
- name: Setup Plotting Environment
|
|
26
|
+
run: |
|
|
27
|
+
python -m pip install --upgrade pip
|
|
28
|
+
pip install matplotlib pandas
|
|
29
|
+
|
|
30
|
+
# 2. 情报采集与账本物理焊接
|
|
24
31
|
- name: Intelligence Gathering & Sovereign Merge
|
|
25
32
|
run: |
|
|
26
|
-
echo "🤖 Pod 042:
|
|
27
|
-
|
|
28
|
-
# A. [情报收集]:修正 API 路径,加入 /popular/ 层级
|
|
33
|
+
echo "🤖 Pod 042: 启动‘全频道情报采集协议’..."
|
|
29
34
|
curl -s -H "Authorization: token ${{ secrets.STATS_TOKEN }}" \
|
|
30
35
|
-H "Accept: application/vnd.github.v3+json" \
|
|
31
36
|
https://api.github.com/repos/${{ github.repository }}/traffic/clones > raw_clones.json
|
|
@@ -34,12 +39,10 @@ jobs:
|
|
|
34
39
|
-H "Accept: application/vnd.github.v3+json" \
|
|
35
40
|
https://api.github.com/repos/${{ github.repository }}/traffic/popular/referrers > raw_referrers.json
|
|
36
41
|
|
|
37
|
-
# B. [格式处理]
|
|
38
42
|
mkdir -p ghrs-data
|
|
39
43
|
echo "date,clones,uniques" > /tmp/new_data.csv
|
|
40
44
|
jq -r '.clones[] | "\(.timestamp[0:10]),\(.count),\(.uniques)"' raw_clones.json >> /tmp/new_data.csv
|
|
41
45
|
|
|
42
|
-
# C. [物理焊接]
|
|
43
46
|
LEDGER="ghrs-data/clones_ledger.csv"
|
|
44
47
|
if [ ! -f "$LEDGER" ]; then
|
|
45
48
|
cp /tmp/new_data.csv "$LEDGER"
|
|
@@ -53,24 +56,64 @@ jobs:
|
|
|
53
56
|
if(length(a[3])==1) a[3]="0"a[3];
|
|
54
57
|
printf "%s-%s-%s,%s,%s\n", a[1], a[2], a[3], $2, $3
|
|
55
58
|
}' | awk -F',' '!a[$1]++' | sort -r > /tmp/final_ledger.csv
|
|
56
|
-
|
|
57
59
|
echo "date,clones,uniques" > "$LEDGER"
|
|
58
60
|
cat /tmp/final_ledger.csv >> "$LEDGER"
|
|
59
61
|
fi
|
|
60
62
|
|
|
61
|
-
# D. [战绩结算]
|
|
62
63
|
TOTAL_CLONES=$(awk -F',' 'NR>1 {sum+=$2} END {print sum}' "$LEDGER")
|
|
63
64
|
echo "{\"total_clones\": $TOTAL_CLONES}" > bunker-stats.json
|
|
64
65
|
|
|
65
|
-
|
|
66
|
+
# 3. 🧬 【核心新增】:构筑战绩可视化图像
|
|
67
|
+
- name: Construct Visual Radar
|
|
68
|
+
run: |
|
|
69
|
+
echo "🤖 Pod 042: 执行‘图像构筑协议’..."
|
|
70
|
+
python3 <<EOF
|
|
71
|
+
import pandas as pd
|
|
72
|
+
import matplotlib.pyplot as plt
|
|
73
|
+
import os
|
|
74
|
+
|
|
75
|
+
# 读取账本并反转顺序(变为正序绘图)
|
|
76
|
+
df = pd.read_csv('ghrs-data/clones_ledger.csv')
|
|
77
|
+
df['date'] = pd.to_datetime(df['date'])
|
|
78
|
+
df = df.sort_values('date')
|
|
79
|
+
|
|
80
|
+
# 样式设置:地堡深邃黑
|
|
81
|
+
plt.style.use('dark_background')
|
|
82
|
+
fig, ax = plt.subplots(figsize=(10, 5))
|
|
83
|
+
|
|
84
|
+
# 绘制曲线(地堡绿)
|
|
85
|
+
ax.plot(df['date'], df['clones'], color='#33cc33', marker='o', markersize=4, linewidth=2, label='Daily Clones')
|
|
86
|
+
ax.fill_between(df['date'], df['clones'], color='#33cc33', alpha=0.2)
|
|
87
|
+
|
|
88
|
+
ax.set_title('YoRHa Bunker - Physical Construction Trend', fontsize=14, pad=20, color='#33cc33')
|
|
89
|
+
ax.set_ylabel('Clone Count', color='#888')
|
|
90
|
+
ax.grid(color='#444', linestyle='--', linewidth=0.5)
|
|
91
|
+
|
|
92
|
+
# 旋转日期防挤占
|
|
93
|
+
plt.xticks(rotation=45, color='#888')
|
|
94
|
+
plt.yticks(color='#888')
|
|
95
|
+
|
|
96
|
+
# 自动保存
|
|
97
|
+
os.makedirs('plots', exist_ok=True)
|
|
98
|
+
plt.tight_layout()
|
|
99
|
+
plt.savefig('plots/clones_trend.png', dpi=100)
|
|
100
|
+
EOF
|
|
101
|
+
|
|
102
|
+
# 4. [报表装修]
|
|
103
|
+
- name: Assemble Report
|
|
104
|
+
run: |
|
|
66
105
|
echo "# 🛰️ 地堡运行报告 (Sovereign Report)" > README.md
|
|
67
|
-
echo "### 📊 累计物理克隆总数: **$
|
|
68
|
-
echo "数据已根据 AGPL-3.0 协议物理封存。愿人类荣光永存。" >> README.md
|
|
106
|
+
echo "### 📊 累计物理克隆总数: **$(grep -oE "[0-9]+" bunker-stats.json | head -n 1)**" >> README.md
|
|
69
107
|
echo "" >> README.md
|
|
108
|
+
|
|
109
|
+
# 💡 物理植入图片
|
|
110
|
+
echo "#### 📈 战绩增长雷达 (Growth Radar)" >> README.md
|
|
111
|
+
echo "" >> README.md
|
|
112
|
+
echo "" >> README.md
|
|
113
|
+
|
|
70
114
|
echo "#### 📡 流量来源实时追踪 (Top Referrers)" >> README.md
|
|
71
115
|
echo "| 来源站点 | 总访问量 | 独立指挥官 |" >> README.md
|
|
72
116
|
echo "| :--- | :--- | :--- |" >> README.md
|
|
73
|
-
# 增加判定,防止 referrers 为空时 jq 报错
|
|
74
117
|
if [ -s raw_referrers.json ]; then
|
|
75
118
|
jq -r '.[] | "| \(.referrer) | \(.count) | \(.uniques) |"' raw_referrers.json >> README.md
|
|
76
119
|
else
|
|
@@ -79,11 +122,12 @@ jobs:
|
|
|
79
122
|
echo "" >> README.md
|
|
80
123
|
echo "> 📡 信号状态:全频道在线 | 数据物理封存点: $(date +'%Y-%m-%d %H:%M:%S') CST" >> README.md
|
|
81
124
|
|
|
125
|
+
# 5. 最终物理封存
|
|
82
126
|
- name: Sync Ledger to Cloud
|
|
83
127
|
run: |
|
|
84
128
|
git config user.name github-actions
|
|
85
129
|
git config user.email github-actions@github.com
|
|
86
130
|
git add -A
|
|
87
131
|
TOTAL=$(grep -oE "[0-9]+" bunker-stats.json | head -n 1)
|
|
88
|
-
git commit -m "chore:
|
|
132
|
+
git commit -m "chore: sovereign update v5.0 - total $TOTAL [$(date +'%Y-%m-%d')]" || echo "no changes"
|
|
89
133
|
git push origin github-repo-stats --force
|
package/package.json
CHANGED
|
@@ -55,7 +55,7 @@ export const exportDataToExcel = async (url, options, columns, fileName, formatt
|
|
|
55
55
|
if (col.exportRender) {
|
|
56
56
|
value = col.exportRender(value, item)
|
|
57
57
|
}
|
|
58
|
-
if (col.render) {
|
|
58
|
+
if (col.render&&!col.exportRender) {
|
|
59
59
|
const rendered = col.render(value, item)
|
|
60
60
|
value = typeof rendered === 'object' ? (rendered?.props?.children || value) : rendered
|
|
61
61
|
}
|