build(workflow): 更新构建配置和文件整理逻辑

- 为所有平台的发布资产名称添加版本标识符 v2
- 修改文件整理脚本以适配 download-artifact@v4 的目录结构变化
- 更新发布说明中的项目标题为"OpenAI 账号管理系统 v2"
- 在 Docker 构建中添加 linux/amd64,linux/arm64 多平台支持
- 从地区限制列表中移除台湾地区(TW)
This commit is contained in:
cnlimiter
2026-03-26 00:30:37 +08:00
parent dab5eca2d6
commit 235c60df25
3 changed files with 20 additions and 19 deletions

View File

@@ -21,13 +21,13 @@ jobs:
include: include:
- os: windows-latest - os: windows-latest
artifact_name: codex-register.exe artifact_name: codex-register.exe
asset_name: codex-register-windows-x64.exe asset_name: codex-register-v2-windows-x64.exe
- os: ubuntu-latest - os: ubuntu-latest
artifact_name: codex-register artifact_name: codex-register
asset_name: codex-register-linux-x64 asset_name: codex-register-v2-linux-x64
- os: macos-latest - os: macos-latest
artifact_name: codex-register artifact_name: codex-register
asset_name: codex-register-macos-arm64 asset_name: codex-register-v2-macos-arm64
steps: steps:
- name: 检出代码 - name: 检出代码
@@ -74,19 +74,19 @@ jobs:
- name: 整理文件并打包 zip - name: 整理文件并打包 zip
run: | run: |
mkdir -p release mkdir -p release
# 为每个平台二进制文件打包成 zip # download-artifact@v4 将每个 artifact 放在 dist/<asset_name>/ 子目录下
find dist/ -type f | while read f; do # 遍历子目录,用目录名作为平台标识(即 matrix.asset_name
name=$(basename "$f") for artifact_dir in dist/*/; do
# 根据文件名确定平台标识 platform=$(basename "$artifact_dir")
case "$name" in # 找到该目录下的二进制文件(只有一个)
*windows*) platform=$(echo "$name" | sed 's/\.[^.]*$//') ;; binary=$(find "$artifact_dir" -maxdepth 1 -type f | head -n1)
*linux*) platform="$name" ;; if [ -z "$binary" ]; then
*macos*) platform="$name" ;; echo "警告:$artifact_dir 下没有找到文件,跳过"
*) platform="$name" ;; continue
esac fi
tmpdir="tmp_${platform}" tmpdir="tmp_${platform}"
mkdir -p "$tmpdir" mkdir -p "$tmpdir"
cp "$f" "$tmpdir/" cp "$binary" "$tmpdir/"
cp README.md "$tmpdir/README.md" cp README.md "$tmpdir/README.md"
cp .env.example "$tmpdir/.env.example" cp .env.example "$tmpdir/.env.example"
[ -f LICENSE ] && cp LICENSE "$tmpdir/LICENSE" || true [ -f LICENSE ] && cp LICENSE "$tmpdir/LICENSE" || true
@@ -103,14 +103,14 @@ jobs:
files: release/* files: release/*
generate_release_notes: true generate_release_notes: true
body: | body: |
## OpenAI 自动注册系统 v2 ## OpenAI 账号管理系统 v2
### 下载说明 ### 下载说明
| 平台 | 文件 | | 平台 | 文件 |
|------|------| |------|------|
| Windows x64 | `codex-register-windows-x64.exe` | | Windows x64 | `codex-register-v2-windows-x64.exe` |
| Linux x64 | `codex-register-linux-x64` | | Linux x64 | `codex-register-v2-linux-x64` |
| macOS ARM64 | `codex-register-macos-arm64` | | macOS ARM64 | `codex-register-v2-macos-arm64` |
### 使用方法 ### 使用方法
```bash ```bash

View File

@@ -64,5 +64,6 @@ jobs:
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=max cache-to: type=gha,mode=max

View File

@@ -282,7 +282,7 @@ class OpenAIHTTPClient(HTTPClient):
loc = loc_match.group(1) if loc_match else None loc = loc_match.group(1) if loc_match else None
# 检查是否支持 # 检查是否支持
if loc in ["CN", "HK", "MO", "TW"]: if loc in ["CN", "HK", "MO"]:
return False, loc return False, loc
return True, loc return True, loc