单二进制分发与 CLI 规范(version 子命令、多平台 Release)

Open
#7 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@linuxsuren-fs is already working on this.

Since Nov 18, 2026.

  • #20 by @linuxsuren-fs — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
github-actions, go, node.js

Research direction

Start by reading the existing Go entry point, Makefile, API version handler, and GitHub Actions workflows; the issue does not name their paths. Then inspect the open pull request #20, which already targets this work. Done means the version command and API share injected version data, builds work without Node, and tagged releases publish all five platform packages with checksums.

Written by the indexing model from the issue text.

Description

requirement
背景

目标环境多为内网,单二进制 + 拷贝即用是首发形态;容器形态见 #8。CLI 规范对齐仓库发行纪律:所有发行的 CLI 二进制必须支持 version 子命令查看语义化版本号。

需求
  1. 子命令:
    • open-img-sync serve:启动 Web + API 服务(也可无参数默认 serve,行为一致需明确)
    • open-img-sync version:输出版本、commit、构建时间(与 -version 等价可并存)
  2. 前端构建产物 go:embed 嵌入;make build(纯 Go 环境)与 make web(Node 20+)分离
  3. 多平台交叉编译:linux/darwin × amd64/arm64 + windows/amd64,打包 tar.gz/zip 附 README 与 LICENSE,附 sha256 校验
  4. Release 自动化:tag(v*)或 Release 发布触发 workflow,产物挂到 Release(含 sha256)
  5. 版本注入:ldflags 写入语义化版本(git describe),version 子命令与 /api 版本接口同源
技术要点
  • workflow 可参考 open-pdf 的 release.yml 成熟模式(5 平台矩阵 + artifact 汇总单点上传)
  • 依赖零 CGO,scratch 运行的静态链接验证
验收标准
  • open-img-sync version 输出语义化版本
  • 首个 Release 产物齐全:5 平台包 + sha256,均可下载运行
  • 无 Node 环境下 make build 成功(嵌入已提交的 dist 或等价方案)
Dominant language
Go
Stars
2
Forks
1
Avg merge
1h 37m
Merged PRs (30d)
6

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from LinuxSuRen/open-img-sync

All issues in LinuxSuRen/open-img-sync

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.