feat: add multi-platform release skeleton - #1758
Merged
Merged
Conversation
SAKURA-CAT
requested changes
Aug 26, 2026
SAKURA-CAT
approved these changes
Aug 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
为 Go core 接入做准备,搭建多平台发包脚手架。仅搭建 skeleton,SDK 运行时暂不接入 Go core,待 core 开发完毕后再启用实际构建发布。
变更内容
core/cmd/swanlab-core/main.go:进程入口骨架——--version(构建期 ldflags 注入 version/commit)、unix:///tcp://端点监听、父进程退出监控 + SIGINT/SIGTERM 优雅退出(防孤儿进程);gRPC 服务后续迭代接入core/hatch.py:Go 编译封装,CGO_ENABLED=0静态交叉编译,产物输出至swanlab/bin/swanlab-core(.exe)hatch_build.py:hatchling 构建钩子,由SWANLAB_BUILD_PLATFORM唯一驱动——未设置时零动作产出纯 any wheel;设置时交叉编译 Go core 并写入平台 tag + artifactsscripts/build_release.sh:一键发布构建 + 校验(twine check、二进制架构/可执行位、manylinux 双 tag 展开、sdist 可重建性)Makefile:新增core-bin(本机联调)/release-build/release-verifypyproject.toml:注册构建钩子,限定hatchling>=1.18;sdist 排除根目录/core(锚定写法,避免误伤嵌套同名目录)Release 产物形态
py3-none-anypy3-none-manylinux_2_17_x86_64.manylinux2014_x86_64py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64py3-none-win_amd64py3-none-win_arm64py3-none-macosx_12_0_x86_64py3-none-macosx_12_0_arm64安装优先级:平台 wheel → any 兜底 wheel → sdist 源码构建。musllinux 以 alhpine, slim 基础镜像的 linux 发行版暂不做支持(静态 Go 二进制实际可运行,hook 解析层保留前缀兼容)。
验证
bash scripts/build_release.sh全量构建:8 个产物齐全、版本一致,twine check 全 PASSED,19 项结构校验全 PASS(含可执行位、file架构匹配、WHEEL 多行 Tag 展开、sdist 重建 wheel 与 checkout 直建.py清单一致)swanlab/bin/时无二进制泄漏go vet/go test ./internal/pkg/process/ruff check通过;CI 全绿(Python 3.9–3.14 × 三平台 + Go lint)