ci: add release workflow (Docker + GitHub Release)#65
Conversation
- 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
There was a problem hiding this comment.
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>.mdbody support. - Update
docker-compose.ymlto pullghcr.io/...:latestinstead 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.
| release: | ||
| name: GitHub Release | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
|
|
There was a problem hiding this comment.
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).
| build: | ||
| context: . | ||
| dockerfile: Dockerfile | ||
| image: ghcr.io/dwgx/windsurf-api:latest |
There was a problem hiding this comment.
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.
| image: ghcr.io/dwgx/windsurf-api:latest | |
| image: ${WINDSURF_API_IMAGE:-ghcr.io/dwgx/windsurf-api:1.0.0} |
Prevent pre-release tags (e.g. v2.0.7-rc.1) from overwriting :latest tag
|
辛苦 @abwuge,模板写得清爽,发版流程也细致到 prerelease 自动判定,这块照单收。 只有一个小细节想跟你对一下,是 镜像落到了
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
- images: ghcr.io/${{ github.repository }}
+ images: ghcr.io/${{ github.repository_owner }}/windsurf-api另外想顺手把 这两处我接着 merge 你这个 PR 之后直接在 master 顺手补一下,你不用再反工,全部功劳都还是你的。再次感谢 ✨ |
…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
|
哎呀我去 docker出了一堆问题 不过还是谢谢你的贡献 |
是吗,我本地和我的fork都测试过了来着。。。 不过我本地测了好几种方案,这个pr是最后rebase过来的,可能是这里的问题 |
改了什么 / What changed
新增
.github/workflows/release.yml,仅在推送v*tag 时触发,自动完成两件事:linux/amd64镜像并推送到 GHCR (ghcr.io)同时将
docker-compose.yml从本地构建 (build:) 改为拉取预构建镜像 (image: ghcr.io/dwgx/windsurf-api:latest),用户无需 clone 代码即可部署。为什么 / Why
docker compose build,改为直接docker pull更方便我有强迫症,用了docker 就不想下载源码,作者按需合并吧测试 / Testing
vtesttag 触发 workflow,两个 job 均成功通过ghcr.io/abwuge/windsurf-api:latest)vtesttag 和对应 Release发版流程
RELEASE_NOTES_2.0.7.md→ 自动作为 Release body-,例如-alpha/-beta/-rc→ 自动标记为 Pre-releaseChecklist