Skip to content

ci: add release workflow (Docker + GitHub Release)#65

Merged
dwgx merged 3 commits into
dwgx:masterfrom
abwuge:master
Apr 25, 2026
Merged

ci: add release workflow (Docker + GitHub Release)#65
dwgx merged 3 commits into
dwgx:masterfrom
abwuge:master

Conversation

@abwuge

@abwuge abwuge commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

改了什么 / What changed

新增 .github/workflows/release.yml,仅在推送 v* tag 时触发,自动完成两件事:

  1. Docker 镜像构建 & 推送 — 构建 linux/amd64 镜像并推送到 GHCR (ghcr.io)
  2. GitHub Release 创建 — 自动创建 Release 页面,附带 Source code (zip/tar.gz) 下载

同时将 docker-compose.yml 从本地构建 (build:) 改为拉取预构建镜像 (image: ghcr.io/dwgx/windsurf-api:latest),用户无需 clone 代码即可部署。

为什么 / Why

  • 项目缺少 CI/CD 自动发布流程,每次发版需要手动构建 Docker 镜像和创建 Release
  • 用户部署时需要本地 clone 代码再 docker compose build,改为直接 docker pull 更方便

我有强迫症,用了docker 就不想下载源码,作者按需合并吧

测试 / Testing

  • 在 fork 仓库推送 vtest tag 触发 workflow,两个 job 均成功通过
  • Docker 镜像成功推送到 GHCR (ghcr.io/abwuge/windsurf-api:latest)
  • GitHub Release 页面成功创建,release notes 正确读取
  • 测试完成后已清理 vtest tag 和对应 Release

⚠️ 合并后注意 / Post-merge notes

没什么注意的,push 下一个 tag 就自动发布好了

发版流程

git tag v2.0.7
git push origin v2.0.7
  • 仓库中存在 RELEASE_NOTES_2.0.7.md → 自动作为 Release body
  • 不存在 → 自动生成 changelog
  • tag 含 -,例如 -alpha / -beta / -rc → 自动标记为 Pre-release

Checklist

  • 代码风格和现有文件一致 / Code style matches existing files
  • 没有引入 npm 依赖 / No new npm dependencies (project is zero-dep)
  • 涉及 LS binary 协议改动时 在 PR 描述里注明字段号来源 / If touching LS protocol, document field-number source in the PR description
  • 涉及 dashboard UI 用 App.confirm / App.prompt 不用浏览器原生 alert/confirm / Uses App.confirm / App.prompt, not native dialogs (if dashboard)

- Add .github/workflows/release.yml triggered only on v* tags
- Docker job: build amd64 image and push to GHCR (ghcr.io)
- Release job: create GitHub Release with auto release notes
- Update docker-compose.yml to use prebuilt GHCR image
Copilot AI review requested due to automatic review settings April 25, 2026 20:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces an automated release pipeline that publishes a Docker image to GHCR and creates a GitHub Release when a v* tag is pushed, and updates the Compose setup to run from a prebuilt image rather than building locally.

Changes:

  • Add a tag-triggered GitHub Actions workflow to build/push a Docker image to GHCR.
  • Add automated GitHub Release creation with optional RELEASE_NOTES_<version>.md body support.
  • Update docker-compose.yml to pull ghcr.io/...:latest instead of building from the local Dockerfile.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
docker-compose.yml Switch service from local build to pulling a prebuilt GHCR image.
.github/workflows/release.yml New workflow to publish Docker images and create GitHub Releases on v* tag pushes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +67 to +72
release:
name: GitHub Release
runs-on: ubuntu-latest
permissions:
contents: write

Copilot AI Apr 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The release job runs independently of the Docker publish job, so a GitHub Release could be created even if the image build/push fails. To make the release process atomic and match the PR intent (“自动完成两件事”), set the release job to depend on the docker job (e.g., via a needs: docker).

Copilot uses AI. Check for mistakes.
Comment thread docker-compose.yml
build:
context: .
dockerfile: Dockerfile
image: ghcr.io/dwgx/windsurf-api:latest

Copilot AI Apr 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard-coding ghcr.io/dwgx/windsurf-api:latest reduces portability (e.g., repo transfer/rename, self-hosted mirrors) and :latest is not reproducible for deployments. Consider using an overridable image reference via env substitution (with a sensible default) and/or pinning to a version tag in example configs.

Suggested change
image: ghcr.io/dwgx/windsurf-api:latest
image: ${WINDSURF_API_IMAGE:-ghcr.io/dwgx/windsurf-api:1.0.0}

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/release.yml
Prevent pre-release tags (e.g. v2.0.7-rc.1) from overwriting :latest tag
@dwgx

dwgx commented Apr 25, 2026

Copy link
Copy Markdown
Owner

辛苦 @abwuge,模板写得清爽,发版流程也细致到 prerelease 自动判定,这块照单收。

只有一个小细节想跟你对一下,是 docker/metadata-action@v5 处理仓库名大小写的方式 —— 它会 lowercase 但插横杠。从你 fork 上 v2.0.6 跑成功的 workflow log 里能看到:

Docker metadata: images: ghcr.io/abwuge/WindsurfAPI
Docker metadata: ghcr.io/abwuge/windsurfapi:latest   ← 实际推到这里
Build and push:  tags: ghcr.io/abwuge/windsurfapi:2.0.6

镜像落到了 windsurfapi(无横杠),但这次 PR 里 docker-compose.yml 写的是 ghcr.io/dwgx/windsurf-api:latest(带横杠)。merge 之后 docker compose pull 会直接 image-not-found,对端用户会一脸懵。

package.json 的项目名就是 windsurf-api,跟它对齐才符合直觉,所以倾向于改 workflow 那一行:

- name: Docker metadata
  id: meta
  uses: docker/metadata-action@v5
  with:
-   images: ghcr.io/${{ github.repository }}
+   images: ghcr.io/${{ github.repository_owner }}/windsurf-api

另外想顺手把 docker-compose.yml 里的 build: 块保留下来,跟 image: 并排放着 —— 拉镜像的用户照常拉,本地改代码迭代的人也能 docker compose up --build 自构建,两边都不丢。

这两处我接着 merge 你这个 PR 之后直接在 master 顺手补一下,你不用再反工,全部功劳都还是你的。再次感谢 ✨

@dwgx dwgx merged commit 250e6a8 into dwgx:master Apr 25, 2026
2 checks passed
dwgx added a commit that referenced this pull request Apr 25, 2026
…tion

- workflow 推到 `ghcr.io/dwgx/windsurf-api`(之前 `${{ github.repository }}` lowercase
  后是 `windsurfapi` 没有横杠,跟 docker-compose 期望的 `windsurf-api` 不匹配,
  merge 后会直接 image-not-found)
- docker-compose 把 `build:` 块加回去,跟 `image:` 并排:拉镜像的用户照常拉,
  本地开发改代码迭代用 `docker compose up --build` 自构建,两边都不丢

follow-up to #65 / @abwuge
@dwgx

dwgx commented Apr 26, 2026

Copy link
Copy Markdown
Owner

哎呀我去 docker出了一堆问题 不过还是谢谢你的贡献

@abwuge

abwuge commented Apr 26, 2026

Copy link
Copy Markdown
Contributor Author

哎呀我去 docker出了一堆问题 不过还是谢谢你的贡献

是吗,我本地和我的fork都测试过了来着。。。

不过我本地测了好几种方案,这个pr是最后rebase过来的,可能是这里的问题

dwgx added a commit that referenced this pull request Apr 27, 2026
把之前关掉但没合的几个外部 PR 里方向干净的 hunk 单独 cherry-pick 进
主线,作者署名通过 Co-authored-by trailer 保留;顺带把 v2.0.11 之后
陆续落主线的 Anthropic prompt-caching、cascade pool 设备隔离、tier
modal 文案修复等合一打包。

PR #80 (@ZLin98) 安全加固——三件事进主线:
- LS env allowlist:buildLanguageServerEnv 只白名单 HOME / PATH /
  LANG / TMPDIR / HTTP(S)_PROXY / SSL trust 八类,AWS / GitHub / CI
  secret 不再泄漏给 LS 子进程。proxy override 与 /root HOME fallback
  原行为保留。
- 跨平台 workspace 重置:execSync('mkdir -p /tmp/... && rm -rf') 改
  Node fs,Windows 不再因为缺 POSIX shell 启动失败。base 从硬编码
  /tmp/ 改为 os.tmpdir() 派生。
- Dashboard auth 收紧:移除 ?pwd= query string fallback。logs/stream
  早就从 EventSource 迁到 fetch + ReadableStream,query 路径已无客户端
  在用,留着只会让 password 进 access log 与浏览器历史。

#80 其余 6 项(HOST 默认 127.0.0.1 + ensurePublicAuth、feature flag
默认全关、getAccountList 默认不返 apiKey、sessionStorage 替换、
FORWARD_CALLER_ENV opt-in、scripts/start.js launcher)都是行为变化或
UX 倒退,没并是怕一次破坏现有 docker / dashboard 部署,但思路完全
合理,未来按需逐项推进。

Credits 面板补三位贡献者(src/dashboard/data/contributors.json
单一数据源,默认 + sketch 两套 dashboard 同时显示):
- ZLin98 #80 — A 级,安全加固先行者
- Yuuqq #73 — B+ 级,Windows 兼容性首位实测人(sanitize URL、
  OPTIONS 204、pool regex escape 三处摘进 44ad502)
- abwuge #65 — A 级,GHCR + GitHub Release 自动发布流水线
  (v2.0.6+ 发版链路就是他这条 workflow)

测试: 4 条新增 buildLanguageServerEnv 用例 (allowlist enforcement /
proxy override / HOME fallback / SSL trust pass-through),合 237/237
全过。

Co-authored-by: ZLin98 <ZLin98@users.noreply.github.com>
huanchen pushed a commit to huanchen/WindsurfAPI that referenced this pull request May 3, 2026
Tag 推送 v* 时自动构建 Docker 镜像推 GHCR + 创建 GitHub Release(RELEASE_NOTES_x.y.z.md 自动当 body,含 - 自动 prerelease)。docker-compose 改为拉预构建镜像,省去用户本地 build。

镜像名大小写细节将在 follow-up 提交里收尾。

感谢 @abwuge
huanchen pushed a commit to huanchen/WindsurfAPI that referenced this pull request May 3, 2026
…tion

- workflow 推到 `ghcr.io/dwgx/windsurf-api`(之前 `${{ github.repository }}` lowercase
  后是 `windsurfapi` 没有横杠,跟 docker-compose 期望的 `windsurf-api` 不匹配,
  merge 后会直接 image-not-found)
- docker-compose 把 `build:` 块加回去,跟 `image:` 并排:拉镜像的用户照常拉,
  本地开发改代码迭代用 `docker compose up --build` 自构建,两边都不丢

follow-up to dwgx#65 / @abwuge
huanchen pushed a commit to huanchen/WindsurfAPI that referenced this pull request May 3, 2026
把之前关掉但没合的几个外部 PR 里方向干净的 hunk 单独 cherry-pick 进
主线,作者署名通过 Co-authored-by trailer 保留;顺带把 v2.0.11 之后
陆续落主线的 Anthropic prompt-caching、cascade pool 设备隔离、tier
modal 文案修复等合一打包。

PR dwgx#80 (@ZLin98) 安全加固——三件事进主线:
- LS env allowlist:buildLanguageServerEnv 只白名单 HOME / PATH /
  LANG / TMPDIR / HTTP(S)_PROXY / SSL trust 八类,AWS / GitHub / CI
  secret 不再泄漏给 LS 子进程。proxy override 与 /root HOME fallback
  原行为保留。
- 跨平台 workspace 重置:execSync('mkdir -p /tmp/... && rm -rf') 改
  Node fs,Windows 不再因为缺 POSIX shell 启动失败。base 从硬编码
  /tmp/ 改为 os.tmpdir() 派生。
- Dashboard auth 收紧:移除 ?pwd= query string fallback。logs/stream
  早就从 EventSource 迁到 fetch + ReadableStream,query 路径已无客户端
  在用,留着只会让 password 进 access log 与浏览器历史。

dwgx#80 其余 6 项(HOST 默认 127.0.0.1 + ensurePublicAuth、feature flag
默认全关、getAccountList 默认不返 apiKey、sessionStorage 替换、
FORWARD_CALLER_ENV opt-in、scripts/start.js launcher)都是行为变化或
UX 倒退,没并是怕一次破坏现有 docker / dashboard 部署,但思路完全
合理,未来按需逐项推进。

Credits 面板补三位贡献者(src/dashboard/data/contributors.json
单一数据源,默认 + sketch 两套 dashboard 同时显示):
- ZLin98 dwgx#80 — A 级,安全加固先行者
- Yuuqq dwgx#73 — B+ 级,Windows 兼容性首位实测人(sanitize URL、
  OPTIONS 204、pool regex escape 三处摘进 041d139)
- abwuge dwgx#65 — A 级,GHCR + GitHub Release 自动发布流水线
  (v2.0.6+ 发版链路就是他这条 workflow)

测试: 4 条新增 buildLanguageServerEnv 用例 (allowlist enforcement /
proxy override / HOME fallback / SSL trust pass-through),合 237/237
全过。

Co-authored-by: ZLin98 <ZLin98@users.noreply.github.com>
dwgx pushed a commit that referenced this pull request May 9, 2026
Tag 推送 v* 时自动构建 Docker 镜像推 GHCR + 创建 GitHub Release(RELEASE_NOTES_x.y.z.md 自动当 body,含 - 自动 prerelease)。docker-compose 改为拉预构建镜像,省去用户本地 build。

镜像名大小写细节将在 follow-up 提交里收尾。

感谢 @abwuge
dwgx added a commit that referenced this pull request May 9, 2026
…tion

- workflow 推到 `ghcr.io/dwgx/windsurf-api`(之前 `${{ github.repository }}` lowercase
  后是 `windsurfapi` 没有横杠,跟 docker-compose 期望的 `windsurf-api` 不匹配,
  merge 后会直接 image-not-found)
- docker-compose 把 `build:` 块加回去,跟 `image:` 并排:拉镜像的用户照常拉,
  本地开发改代码迭代用 `docker compose up --build` 自构建,两边都不丢

follow-up to #65 / @abwuge
dwgx added a commit that referenced this pull request May 9, 2026
把之前关掉但没合的几个外部 PR 里方向干净的 hunk 单独 cherry-pick 进
主线,作者署名通过 Co-authored-by trailer 保留;顺带把 v2.0.11 之后
陆续落主线的 Anthropic prompt-caching、cascade pool 设备隔离、tier
modal 文案修复等合一打包。

PR #80 (@ZLin98) 安全加固——三件事进主线:
- LS env allowlist:buildLanguageServerEnv 只白名单 HOME / PATH /
  LANG / TMPDIR / HTTP(S)_PROXY / SSL trust 八类,AWS / GitHub / CI
  secret 不再泄漏给 LS 子进程。proxy override 与 /root HOME fallback
  原行为保留。
- 跨平台 workspace 重置:execSync('mkdir -p /tmp/... && rm -rf') 改
  Node fs,Windows 不再因为缺 POSIX shell 启动失败。base 从硬编码
  /tmp/ 改为 os.tmpdir() 派生。
- Dashboard auth 收紧:移除 ?pwd= query string fallback。logs/stream
  早就从 EventSource 迁到 fetch + ReadableStream,query 路径已无客户端
  在用,留着只会让 password 进 access log 与浏览器历史。

#80 其余 6 项(HOST 默认 127.0.0.1 + ensurePublicAuth、feature flag
默认全关、getAccountList 默认不返 apiKey、sessionStorage 替换、
FORWARD_CALLER_ENV opt-in、scripts/start.js launcher)都是行为变化或
UX 倒退,没并是怕一次破坏现有 docker / dashboard 部署,但思路完全
合理,未来按需逐项推进。

Credits 面板补三位贡献者(src/dashboard/data/contributors.json
单一数据源,默认 + sketch 两套 dashboard 同时显示):
- ZLin98 #80 — A 级,安全加固先行者
- Yuuqq #73 — B+ 级,Windows 兼容性首位实测人(sanitize URL、
  OPTIONS 204、pool regex escape 三处摘进 44ad502)
- abwuge #65 — A 级,GHCR + GitHub Release 自动发布流水线
  (v2.0.6+ 发版链路就是他这条 workflow)

测试: 4 条新增 buildLanguageServerEnv 用例 (allowlist enforcement /
proxy override / HOME fallback / SSL trust pass-through),合 237/237
全过。

Co-authored-by: ZLin98 <ZLin98@users.noreply.github.com>
dwgx pushed a commit that referenced this pull request Jun 4, 2026
Tag 推送 v* 时自动构建 Docker 镜像推 GHCR + 创建 GitHub Release(RELEASE_NOTES_x.y.z.md 自动当 body,含 - 自动 prerelease)。docker-compose 改为拉预构建镜像,省去用户本地 build。

镜像名大小写细节将在 follow-up 提交里收尾。

感谢 @abwuge
dwgx added a commit that referenced this pull request Jun 4, 2026
…tion

- workflow 推到 `ghcr.io/dwgx/windsurf-api`(之前 `${{ github.repository }}` lowercase
  后是 `windsurfapi` 没有横杠,跟 docker-compose 期望的 `windsurf-api` 不匹配,
  merge 后会直接 image-not-found)
- docker-compose 把 `build:` 块加回去,跟 `image:` 并排:拉镜像的用户照常拉,
  本地开发改代码迭代用 `docker compose up --build` 自构建,两边都不丢

follow-up to #65 / @abwuge
dwgx added a commit that referenced this pull request Jun 4, 2026
把之前关掉但没合的几个外部 PR 里方向干净的 hunk 单独 cherry-pick 进
主线,作者署名通过 Co-authored-by trailer 保留;顺带把 v2.0.11 之后
陆续落主线的 Anthropic prompt-caching、cascade pool 设备隔离、tier
modal 文案修复等合一打包。

PR #80 (@ZLin98) 安全加固——三件事进主线:
- LS env allowlist:buildLanguageServerEnv 只白名单 HOME / PATH /
  LANG / TMPDIR / HTTP(S)_PROXY / SSL trust 八类,AWS / GitHub / CI
  secret 不再泄漏给 LS 子进程。proxy override 与 /root HOME fallback
  原行为保留。
- 跨平台 workspace 重置:execSync('mkdir -p /tmp/... && rm -rf') 改
  Node fs,Windows 不再因为缺 POSIX shell 启动失败。base 从硬编码
  /tmp/ 改为 os.tmpdir() 派生。
- Dashboard auth 收紧:移除 ?pwd= query string fallback。logs/stream
  早就从 EventSource 迁到 fetch + ReadableStream,query 路径已无客户端
  在用,留着只会让 password 进 access log 与浏览器历史。

#80 其余 6 项(HOST 默认 127.0.0.1 + ensurePublicAuth、feature flag
默认全关、getAccountList 默认不返 apiKey、sessionStorage 替换、
FORWARD_CALLER_ENV opt-in、scripts/start.js launcher)都是行为变化或
UX 倒退,没并是怕一次破坏现有 docker / dashboard 部署,但思路完全
合理,未来按需逐项推进。

Credits 面板补三位贡献者(src/dashboard/data/contributors.json
单一数据源,默认 + sketch 两套 dashboard 同时显示):
- ZLin98 #80 — A 级,安全加固先行者
- Yuuqq #73 — B+ 级,Windows 兼容性首位实测人(sanitize URL、
  OPTIONS 204、pool regex escape 三处摘进 5a4eae9)
- abwuge #65 — A 级,GHCR + GitHub Release 自动发布流水线
  (v2.0.6+ 发版链路就是他这条 workflow)

测试: 4 条新增 buildLanguageServerEnv 用例 (allowlist enforcement /
proxy override / HOME fallback / SSL trust pass-through),合 237/237
全过。

Co-authored-by: ZLin98 <ZLin98@users.noreply.github.com>
dwgx added a commit that referenced this pull request Jun 4, 2026
把之前关掉但没合的几个外部 PR 里方向干净的 hunk 单独 cherry-pick 进
主线,作者署名通过 Co-authored-by trailer 保留;顺带把 v2.0.11 之后
陆续落主线的 Anthropic prompt-caching、cascade pool 设备隔离、tier
modal 文案修复等合一打包。

PR #80 (@ZLin98) 安全加固——三件事进主线:
- LS env allowlist:buildLanguageServerEnv 只白名单 HOME / PATH /
  LANG / TMPDIR / HTTP(S)_PROXY / SSL trust 八类,AWS / GitHub / CI
  secret 不再泄漏给 LS 子进程。proxy override 与 /root HOME fallback
  原行为保留。
- 跨平台 workspace 重置:execSync('mkdir -p /tmp/... && rm -rf') 改
  Node fs,Windows 不再因为缺 POSIX shell 启动失败。base 从硬编码
  /tmp/ 改为 os.tmpdir() 派生。
- Dashboard auth 收紧:移除 ?pwd= query string fallback。logs/stream
  早就从 EventSource 迁到 fetch + ReadableStream,query 路径已无客户端
  在用,留着只会让 password 进 access log 与浏览器历史。

#80 其余 6 项(HOST 默认 127.0.0.1 + ensurePublicAuth、feature flag
默认全关、getAccountList 默认不返 apiKey、sessionStorage 替换、
FORWARD_CALLER_ENV opt-in、scripts/start.js launcher)都是行为变化或
UX 倒退,没并是怕一次破坏现有 docker / dashboard 部署,但思路完全
合理,未来按需逐项推进。

Credits 面板补三位贡献者(src/dashboard/data/contributors.json
单一数据源,默认 + sketch 两套 dashboard 同时显示):
- ZLin98 #80 — A 级,安全加固先行者
- Yuuqq #73 — B+ 级,Windows 兼容性首位实测人(sanitize URL、
  OPTIONS 204、pool regex escape 三处摘进 5a4eae9)
- abwuge #65 — A 级,GHCR + GitHub Release 自动发布流水线
  (v2.0.6+ 发版链路就是他这条 workflow)

测试: 4 条新增 buildLanguageServerEnv 用例 (allowlist enforcement /
proxy override / HOME fallback / SSL trust pass-through),合 237/237
全过。

Co-authored-by: ZLin98 <ZLin98@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants