Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 1 addition & 30 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,43 +144,14 @@ jobs:
bun install
bun run format

- name: Update seed price table
if: steps.check.outputs.needs_bump == 'true'
continue-on-error: true
run: |
echo "📦 正在下载最新的 LiteLLM 价格表..."

# 确保目录存在
mkdir -p public/seed

# 下载最新价格表
if curl -sSL -f "https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json" -o public/seed/litellm-prices.json; then
echo "价格表下载成功"

# 验证 JSON 格式
if node -e "JSON.parse(require('fs').readFileSync('public/seed/litellm-prices.json', 'utf-8'))"; then
echo "JSON 格式验证通过"

# 显示统计信息
TOTAL_MODELS=$(node -e "console.log(Object.keys(JSON.parse(require('fs').readFileSync('public/seed/litellm-prices.json', 'utf-8'))).length)")
CLAUDE_MODELS=$(node -e "console.log(Object.keys(JSON.parse(require('fs').readFileSync('public/seed/litellm-prices.json', 'utf-8'))).filter(m => m.toLowerCase().startsWith('claude-')).length)")
echo "📊 价格表统计: 总模型数 $TOTAL_MODELS, Claude 模型 $CLAUDE_MODELS"
else
echo "❌ JSON 格式验证失败,保留旧文件"
git checkout public/seed/litellm-prices.json
fi
else
echo "⚠️ 价格表下载失败,保留现有文件"
fi

- name: Commit VERSION and formatted code
if: steps.check.outputs.needs_bump == 'true'
run: |
# 配置git
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

# 添加所有更改(VERSION文件 + 格式化后的代码 + 价格表
# 添加所有更改(VERSION文件 + 格式化后的代码)
git add -A

# 排除 .github/ 目录的更改(workflow 文件不需要自动提交,且需要特殊权限)
Expand Down
Loading