Files
gpt-load/.github/workflows/release-linux.yml
T
tbphp 275cc508e0 fix(security): 修复 Dependabot 安全告警 (pgx + 前端依赖) (#414)
* fix(deps): 升级 pgx/v5 至 5.9.2 并同步 Go 至 1.25

修复 GHSA-9jj7-4m8r-rfcm (CVE-2026-33816, critical, 内存安全)
和 GHSA-j88v-2chj-qfwx (CVE-2026-41889, low, SQL 注入)。

pgx v5.9.x 要求 go 1.25.0,因此一并把 go.mod、CI 工作流、
Dockerfile 中的 Go 版本声明从 1.24 抬到 1.25。

* fix(web): 升级前端依赖修复 12 个 npm 安全告警

通过 npm audit fix 在 semver 范围内升级 lockfile,未改 package.json:
- rollup 4.57→4.60 修复路径穿越文件写入 (GHSA-mw96-cpmx-2vgc)
- vite 6.4.1→6.4.2 修复路径穿越与 WS 文件读取
- minimatch 3.1.2/9.0.5→3.1.5/9.0.9 修复 ReDoS
- picomatch 2.3.1/4.0.3→2.3.2/4.0.4 修复方法注入与 ReDoS
- flatted 3.3.3→3.4.2 修复原型污染
- lodash/lodash-es 4.17.23→4.18.1 修复模板注入与原型污染
- postcss 8.5.6→8.5.14 修复 XSS

npm audit 已确认 0 vulnerabilities。
2026-05-05 09:28:46 +08:00

50 lines
1.4 KiB
YAML

name: Release Linux Build
permissions:
contents: write
on:
push:
tags:
- "*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
cache-dependency-path: "web/package-lock.json"
- name: Build Frontend
run: npm ci && VITE_VERSION=${{ github.ref_name }} npm run build
working-directory: ./web
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.25.x"
cache: true
cache-dependency-path: go.sum
- name: Build Backend for amd64
run: |
go mod download
go build -ldflags "-s -w -X gpt-load/internal/version.Version=${{ github.ref_name }}" -o gpt-load-linux-amd64
- name: Build Backend for arm64
run: |
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "-s -w -X gpt-load/internal/version.Version=${{ github.ref_name }}" -o gpt-load-linux-arm64
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
gpt-load-linux-amd64
gpt-load-linux-arm64
draft: true
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}