feihong-code 8.0.2 → 8.3.0

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.
@@ -1,203 +1,211 @@
1
- # 飞虹 Code 发布工作流
2
- # 晋江市飞虹智科技企业管理有限公司 · 飞扬企源研发中心 · 负责人:吴赐虹
3
- #
4
- # 触发条件:
5
- # 1. 推送 v* 标签(如 v1.0.0)→ 自动发布 npm 包 + Docker 镜像 + GitHub Release
6
- # 2. 手动触发(workflow_dispatch)→ 可指定版本号
7
- #
8
- # 所需 Secrets:
9
- # - NPM_TOKEN: npm 发布令牌
10
- # - DOCKERHUB_USERNAME: Docker Hub 用户名
11
- # - DOCKERHUB_TOKEN: Docker Hub 访问令牌
12
- # - GH_TOKEN: GitHub Token(自动注入,无需手动配置)
13
-
14
- name: Release
15
-
16
- on:
17
- push:
18
- tags:
19
- - 'v*'
20
- workflow_dispatch:
21
- inputs:
22
- version:
23
- description: '发布版本号(如 1.0.0)'
24
- required: true
25
- default: 'patch'
26
-
27
- permissions:
28
- contents: write
29
-
30
- env:
31
- NODE_VERSION: '20'
32
- IMAGE_NAME: feihong-code
33
-
34
- jobs:
35
- # ---------- 1. 版本号准备 ----------
36
- version:
37
- name: 准备版本号
38
- runs-on: ubuntu-latest
39
- outputs:
40
- version: ${{ steps.get_version.outputs.version }}
41
- tag: ${{ steps.get_version.outputs.tag }}
42
- steps:
43
- - uses: actions/checkout@v4
44
- with:
45
- fetch-depth: 0
46
- - name: 获取版本号
47
- id: get_version
48
- run: |
49
- if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
50
- VERSION=${GITHUB_REF_NAME#v}
51
- else
52
- if [[ "${{ github.event.inputs.version }}" == "patch" ]]; then
53
- VERSION=$(npm version patch --no-git-tag-version | sed 's/v//')
54
- elif [[ "${{ github.event.inputs.version }}" == "minor" ]]; then
55
- VERSION=$(npm version minor --no-git-tag-version | sed 's/v//')
56
- elif [[ "${{ github.event.inputs.version }}" == "major" ]]; then
57
- VERSION=$(npm version major --no-git-tag-version | sed 's/v//')
58
- else
59
- VERSION=${{ github.event.inputs.version }}
60
- fi
61
- fi
62
- echo "version=$VERSION" >> $GITHUB_OUTPUT
63
- echo "tag=v$VERSION" >> $GITHUB_OUTPUT
64
- echo "发布版本: v$VERSION"
65
-
66
- # ---------- 2. 构建与测试(复用 CI 逻辑) ----------
67
- build:
68
- name: 构建与测试
69
- needs: version
70
- runs-on: ubuntu-latest
71
- steps:
72
- - uses: actions/checkout@v4
73
- - uses: actions/setup-node@v4
74
- with:
75
- node-version: ${{ env.NODE_VERSION }}
76
- registry-url: 'https://registry.npmjs.org'
77
- - run: npm install
78
- - name: 类型检查
79
- run: npm run typecheck
80
- - name: 编译构建
81
- run: npm run build
82
- - name: 前端资源打包
83
- run: node scripts/copy-web.cjs
84
- - name: CLI 可用性验证
85
- run: node dist/cli/index.js --version
86
- - name: P7-5 安全 CI(npm audit + CycloneDX SBOM)
87
- run: npm run security || (echo "⚠️ npm audit 网络不可达按跳过处理" && exit 0)
88
- - name: P7-5 综合冒烟门禁(本地回归)
89
- run: |
90
- node dist/cli/index.js serve --port 8099 > /tmp/fh-serve.log 2>&1 &
91
- SERVER_PID=$!
92
- READY=0
93
- for i in $(seq 1 40); do
94
- if curl -sf http://127.0.0.1:8099/api/health >/dev/null 2>&1; then READY=1; break; fi
95
- sleep 1
96
- done
97
- if [ "$READY" != "1" ]; then
98
- echo "❌ 测试服务 40s 内未就绪,serve 日志:"
99
- cat /tmp/fh-serve.log || true
100
- kill $SERVER_PID 2>/dev/null || true
101
- exit 1
102
- fi
103
- node scripts/_smoke-full.mjs
104
- EXIT_CODE=$?
105
- kill $SERVER_PID 2>/dev/null || true
106
- exit $EXIT_CODE
107
- - name: P7-1 SWE-bench harness 链路冒烟(mock)
108
- run: node dist/cli/index.js harness lite --limit 1 --mode mock || echo "⚠️ harness 需网络拉取数据集,失败不阻断(真实跑分见 docs/SWE_BENCH_REPORT.md)"
109
- - name: 上传构建产物
110
- uses: actions/upload-artifact@v7
111
- with:
112
- name: dist-${{ needs.version.outputs.version }}
113
- path: dist/
114
- retention-days: 30
115
-
116
- # ---------- 3. 发布 npm 包 ----------
117
- npm-publish:
118
- name: 发布 npm 包
119
- needs: [version, build]
120
- runs-on: ubuntu-latest
121
- if: github.event_name == 'push' || github.event.inputs.version != 'patch'
122
- steps:
123
- - uses: actions/checkout@v4
124
- - uses: actions/setup-node@v4
125
- with:
126
- node-version: ${{ env.NODE_VERSION }}
127
- registry-url: 'https://registry.npmjs.org'
128
- - name: 下载构建产物
129
- uses: actions/download-artifact@v7
130
- with:
131
- name: dist-${{ needs.version.outputs.version }}
132
- path: dist/
133
- - name: 安装依赖(prepack build 需要)
134
- run: npm ci
135
- - name: 设置版本号
136
- run: npm version ${{ needs.version.outputs.version }} --no-git-tag-version --allow-same-version
137
- - name: 发布到 npm
138
- run: npm publish --access public
139
- env:
140
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
141
-
142
- # ---------- 4. 构建并推送 Docker 镜像 ----------
143
- docker-publish:
144
- name: 发布 Docker 镜像
145
- needs: [version, build]
146
- runs-on: ubuntu-latest
147
- if: github.event_name == 'push' || github.event.inputs.version != 'patch'
148
- steps:
149
- - uses: actions/checkout@v4
150
- - name: 设置 Docker Buildx
151
- uses: docker/setup-buildx-action@v3
152
- - name: 登录 Docker Hub
153
- uses: docker/login-action@v4
154
- with:
155
- username: ${{ secrets.DOCKERHUB_USERNAME }}
156
- password: ${{ secrets.DOCKERHUB_TOKEN }}
157
- - name: 构建并推送镜像
158
- uses: docker/build-push-action@v7
159
- with:
160
- context: .
161
- push: true
162
- tags: |
163
- ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ needs.version.outputs.version }}
164
- ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:latest
165
- cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:buildcache
166
- cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:buildcache,mode=max
167
-
168
- # ---------- 5. 创建 GitHub Release ----------
169
- github-release:
170
- name: 创建 GitHub Release
171
- needs: [version, build, npm-publish, docker-publish]
172
- runs-on: ubuntu-latest
173
- if: github.event_name == 'push'
174
- steps:
175
- - uses: actions/checkout@v4
176
- with:
177
- fetch-depth: 0
178
- - name: 生成变更日志
179
- id: changelog
180
- run: |
181
- echo "## 飞虹 Code v${{ needs.version.outputs.version }}" > RELEASE_NOTES.md
182
- echo "" >> RELEASE_NOTES.md
183
- echo "### 发布说明" >> RELEASE_NOTES.md
184
- echo "" >> RELEASE_NOTES.md
185
- git log --pretty=format:"- %s (%h)" $(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo HEAD^)..HEAD >> RELEASE_NOTES.md 2>/dev/null || echo "- 首次发布" >> RELEASE_NOTES.md
186
- echo "" >> RELEASE_NOTES.md
187
- echo "### 安装方式" >> RELEASE_NOTES.md
188
- echo "" >> RELEASE_NOTES.md
189
- echo "\`\`\`bash" >> RELEASE_NOTES.md
190
- echo "npm install -g feihong-code" >> RELEASE_NOTES.md
191
- echo "# 或" >> RELEASE_NOTES.md
192
- echo "docker pull ${{ secrets.DOCKERHUB_USERNAME }}/feihong-code:latest" >> RELEASE_NOTES.md
193
- echo "\`\`\`" >> RELEASE_NOTES.md
194
- - name: 创建 Release
195
- uses: softprops/action-gh-release@v3
196
- with:
197
- tag_name: ${{ needs.version.outputs.tag }}
198
- name: 飞虹 Code ${{ needs.version.outputs.tag }}
199
- body_path: RELEASE_NOTES.md
200
- draft: false
201
- prerelease: false
202
- env:
203
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1
+ # 飞虹 Code 发布工作流
2
+ # 晋江市飞虹智科技企业管理有限公司 · 飞扬企源研发中心 · 负责人:吴赐虹
3
+ #
4
+ # 触发条件:
5
+ # 1. 推送 v* 标签(如 v1.0.0)→ 自动发布 npm 包 + Docker 镜像 + GitHub Release
6
+ # 2. 手动触发(workflow_dispatch)→ 可指定版本号
7
+ #
8
+ # 所需 Secrets:
9
+ # - NPM_TOKEN: npm 发布令牌
10
+ # - DOCKERHUB_USERNAME: Docker Hub 用户名
11
+ # - DOCKERHUB_TOKEN: Docker Hub 访问令牌
12
+ # - GH_TOKEN: GitHub Token(自动注入,无需手动配置)
13
+
14
+ name: Release
15
+
16
+ on:
17
+ push:
18
+ tags:
19
+ - 'v*'
20
+ workflow_dispatch:
21
+ inputs:
22
+ version:
23
+ description: '发布版本号(如 1.0.0)'
24
+ required: true
25
+ default: 'patch'
26
+
27
+ permissions:
28
+ contents: write
29
+
30
+ env:
31
+ NODE_VERSION: '22'
32
+ IMAGE_NAME: feihong-code
33
+
34
+ jobs:
35
+ # ---------- 1. 版本号准备 ----------
36
+ version:
37
+ name: 准备版本号
38
+ runs-on: ubuntu-latest
39
+ outputs:
40
+ version: ${{ steps.get_version.outputs.version }}
41
+ tag: ${{ steps.get_version.outputs.tag }}
42
+ steps:
43
+ - uses: actions/checkout@v4
44
+ with:
45
+ fetch-depth: 0
46
+ - name: 获取版本号
47
+ id: get_version
48
+ run: |
49
+ if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
50
+ VERSION=${GITHUB_REF_NAME#v}
51
+ else
52
+ if [[ "${{ github.event.inputs.version }}" == "patch" ]]; then
53
+ VERSION=$(npm version patch --no-git-tag-version | sed 's/v//')
54
+ elif [[ "${{ github.event.inputs.version }}" == "minor" ]]; then
55
+ VERSION=$(npm version minor --no-git-tag-version | sed 's/v//')
56
+ elif [[ "${{ github.event.inputs.version }}" == "major" ]]; then
57
+ VERSION=$(npm version major --no-git-tag-version | sed 's/v//')
58
+ else
59
+ VERSION=${{ github.event.inputs.version }}
60
+ fi
61
+ fi
62
+ echo "version=$VERSION" >> $GITHUB_OUTPUT
63
+ echo "tag=v$VERSION" >> $GITHUB_OUTPUT
64
+ echo "发布版本: v$VERSION"
65
+
66
+ # ---------- 2. 构建与测试(复用 CI 逻辑) ----------
67
+ build:
68
+ name: 构建与测试
69
+ needs: version
70
+ runs-on: ubuntu-latest
71
+ steps:
72
+ - uses: actions/checkout@v4
73
+ - uses: actions/setup-node@v4
74
+ with:
75
+ node-version: ${{ env.NODE_VERSION }}
76
+ registry-url: 'https://registry.npmjs.org'
77
+ - run: npm install
78
+ - name: 类型检查
79
+ run: npm run typecheck
80
+ - name: 编译构建
81
+ run: npm run build
82
+ - name: 前端资源打包
83
+ run: node scripts/copy-web.cjs
84
+ - name: CLI 可用性验证
85
+ run: node dist/cli/index.js --version
86
+ - name: P7-5 安全 CI(npm audit + CycloneDX SBOM)
87
+ run: npm run security || (echo "⚠️ npm audit 网络不可达按跳过处理" && exit 0)
88
+ - name: P7-5 综合冒烟门禁(本地回归)
89
+ run: |
90
+ node dist/cli/index.js serve --port 8099 > /tmp/fh-serve.log 2>&1 &
91
+ SERVER_PID=$!
92
+ READY=0
93
+ for i in $(seq 1 40); do
94
+ if curl -sf http://127.0.0.1:8099/api/health >/dev/null 2>&1; then READY=1; break; fi
95
+ sleep 1
96
+ done
97
+ if [ "$READY" != "1" ]; then
98
+ echo "❌ 测试服务 40s 内未就绪,serve 日志:"
99
+ cat /tmp/fh-serve.log || true
100
+ kill $SERVER_PID 2>/dev/null || true
101
+ exit 1
102
+ fi
103
+ node scripts/_smoke-full.mjs
104
+ EXIT_CODE=$?
105
+ kill $SERVER_PID 2>/dev/null || true
106
+ exit $EXIT_CODE
107
+ - name: P7-1 SWE-bench harness 链路冒烟(mock)
108
+ run: node dist/cli/index.js harness lite --limit 1 --mode mock || echo "⚠️ harness 需网络拉取数据集,失败不阻断(真实跑分见 docs/SWE_BENCH_REPORT.md)"
109
+ - name: 上传构建产物
110
+ uses: actions/upload-artifact@v7
111
+ with:
112
+ name: dist-${{ needs.version.outputs.version }}
113
+ path: dist/
114
+ retention-days: 30
115
+
116
+ # ---------- 3. 发布 npm 包 ----------
117
+ npm-publish:
118
+ name: 发布 npm 包
119
+ needs: [version, build]
120
+ runs-on: ubuntu-latest
121
+ if: github.event_name == 'push' || github.event.inputs.version != 'patch'
122
+ steps:
123
+ - uses: actions/checkout@v4
124
+ - uses: actions/setup-node@v4
125
+ with:
126
+ node-version: ${{ env.NODE_VERSION }}
127
+ registry-url: 'https://registry.npmjs.org'
128
+ - name: 下载构建产物
129
+ uses: actions/download-artifact@v8
130
+ with:
131
+ name: dist-${{ needs.version.outputs.version }}
132
+ path: dist/
133
+ - name: 安装依赖(prepack build 需要)
134
+ run: npm ci
135
+ - name: 设置版本号
136
+ run: npm version ${{ needs.version.outputs.version }} --no-git-tag-version --allow-same-version
137
+ - name: 检查 NPM_TOKEN 是否配置
138
+ id: npm_token_check
139
+ env:
140
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
141
+ run: |
142
+ if [ -n "$NPM_TOKEN" ]; then echo "has_token=true" >> "$GITHUB_OUTPUT"; else echo "has_token=false" >> "$GITHUB_OUTPUT"; fi
143
+ - name: 发布到 npm
144
+ if: steps.npm_token_check.outputs.has_token == 'true'
145
+ run: npm publish --access public
146
+ env:
147
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
148
+
149
+ # ---------- 4. 构建并推送 Docker 镜像 ----------
150
+ docker-publish:
151
+ name: 发布 Docker 镜像
152
+ needs: [version, build]
153
+ runs-on: ubuntu-latest
154
+ if: github.event_name == 'push' || github.event.inputs.version != 'patch'
155
+ steps:
156
+ - uses: actions/checkout@v4
157
+ - name: 设置 Docker Buildx
158
+ uses: docker/setup-buildx-action@v4
159
+ - name: 登录 Docker Hub
160
+ uses: docker/login-action@v4
161
+ with:
162
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
163
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
164
+ - name: 构建并推送镜像
165
+ uses: docker/build-push-action@v7
166
+ with:
167
+ context: .
168
+ push: true
169
+ tags: |
170
+ ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ needs.version.outputs.version }}
171
+ ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:latest
172
+ cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:buildcache
173
+ cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:buildcache,mode=max
174
+
175
+ # ---------- 5. 创建 GitHub Release ----------
176
+ github-release:
177
+ name: 创建 GitHub Release
178
+ needs: [version, build, npm-publish, docker-publish]
179
+ runs-on: ubuntu-latest
180
+ if: github.event_name == 'push'
181
+ steps:
182
+ - uses: actions/checkout@v4
183
+ with:
184
+ fetch-depth: 0
185
+ - name: 生成变更日志
186
+ id: changelog
187
+ run: |
188
+ echo "## 飞虹 Code v${{ needs.version.outputs.version }}" > RELEASE_NOTES.md
189
+ echo "" >> RELEASE_NOTES.md
190
+ echo "### 发布说明" >> RELEASE_NOTES.md
191
+ echo "" >> RELEASE_NOTES.md
192
+ git log --pretty=format:"- %s (%h)" $(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo HEAD^)..HEAD >> RELEASE_NOTES.md 2>/dev/null || echo "- 首次发布" >> RELEASE_NOTES.md
193
+ echo "" >> RELEASE_NOTES.md
194
+ echo "### 安装方式" >> RELEASE_NOTES.md
195
+ echo "" >> RELEASE_NOTES.md
196
+ echo "\`\`\`bash" >> RELEASE_NOTES.md
197
+ echo "npm install -g feihong-code" >> RELEASE_NOTES.md
198
+ echo "# 或" >> RELEASE_NOTES.md
199
+ echo "docker pull ${{ secrets.DOCKERHUB_USERNAME }}/feihong-code:latest" >> RELEASE_NOTES.md
200
+ echo "\`\`\`" >> RELEASE_NOTES.md
201
+ - name: 创建 Release
202
+ uses: softprops/action-gh-release@v3
203
+ with:
204
+ tag_name: ${{ needs.version.outputs.tag }}
205
+ name: 飞虹 Code ${{ needs.version.outputs.tag }}
206
+ body_path: RELEASE_NOTES.md
207
+ draft: false
208
+ prerelease: false
209
+ skipIfReleaseExists: true
210
+ env:
211
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -14,6 +14,14 @@ on:
14
14
  description: '实例清单路径'
15
15
  required: false
16
16
  default: 'bench/swe-bench-verified-sample.json'
17
+ model:
18
+ description: '评测模型名(如 agnes-3.0-flash / DeepSeek-V4-Flash)'
19
+ required: false
20
+ default: 'agnes-2.5-flash'
21
+ base_url:
22
+ description: 'API 通道地址(AMD 填 https://developer.amd.com.cn/radeon/api/v1)'
23
+ required: false
24
+ default: 'https://api.agnes-ai.cn/v1'
17
25
  # 可选:定时跑(UTC 18:00)
18
26
  # schedule:
19
27
  # - cron: '0 18 * * *'
@@ -29,7 +37,7 @@ jobs:
29
37
  with:
30
38
  node-version: '22'
31
39
 
32
- - uses: actions/setup-python@v7
40
+ - uses: actions/setup-python@v5
33
41
  with:
34
42
  python-version: '3.11'
35
43
 
@@ -54,6 +62,9 @@ jobs:
54
62
  - name: 真实模型生成 patch
55
63
  env:
56
64
  AGNES_API_KEY: ${{ secrets.AGNES_API_KEY }}
65
+ AMD_API_KEY: ${{ secrets.AMD_API_KEY }}
66
+ SWEEBENCH_MODEL: ${{ inputs.model }}
67
+ SWEEBENCH_BASE_URL: ${{ inputs.base_url }}
57
68
  run: node scripts/swebench-real.mjs --instances "${{ inputs.instances }}" --limit "${{ inputs.limit }}"
58
69
 
59
70
  - name: 真实测试验证(env-reconstructed)