改用 musl 全静态构建,零依赖跨发行版
Build and Release Mond / release (push) Successful in 19s
Build and Release Mond / build-and-test (amd64) (push) Successful in 4m11s
Build and Release Mond / build-and-test (arm64) (push) Successful in 9m19s

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-10 12:03:43 +08:00
co-authored by Claude Opus 4.8
parent 5430297ff9
commit b44b118be7
8 changed files with 111 additions and 126 deletions
+9 -8
View File
@@ -44,13 +44,13 @@ jobs:
--platform ${PLATFORM} \
--build-arg MONERO_VERSION=${MONERO_VERSION} \
--output type=local,dest=./output \
-f docker/Dockerfile.ubuntu .
-f docker/Dockerfile .
- name: Package and test
run: |
DIR="./output/linux_${{ matrix.arch }}"
VERSION=${PACKAGE_VERSION}
TARGZ="${PRODUCT_NAME}-${{ matrix.arch }}-ubuntu-${VERSION}.tar.gz"
TARGZ="${PRODUCT_NAME}-${{ matrix.arch }}-linux-static-${VERSION}.tar.gz"
tar -czf "${TARGZ}" -C "$DIR" .
@@ -60,11 +60,12 @@ jobs:
# 快速验证
mkdir -p test && tar -xzf "${TARGZ}" -C test
test/mond --version 2>/dev/null || echo "⚠️ 跳过版本检查"
# 依赖校验:第三方库(boost/ssl/zmq 等)应已被 depends 静态链入,
# 运行时只应依赖 glibclibc/libm/libpthread/ld-linux
EXTRA=$(ldd test/mond 2>/dev/null | awk '{print $1}' \
| grep -vE '(^|/)(linux-vdso|libc\.so|libm\.so|libpthread\.so|libdl\.so|librt\.so|libresolv\.so|libutil\.so|ld-linux)' || true)
[ -z "$EXTRA" ] && echo "✅ 运行时仅依赖 glibc" || echo "⚠️ 检测到非 glibc 动态依赖: ${EXTRA}"
# 依赖校验:musl fully-staticldd 应为 "statically linked"(零外部依赖,glibc/musl 均可直接运行)
if ldd test/mond 2>&1 | grep -qE 'statically linked|not a dynamic executable'; then
echo "✅ fully-static(无任何动态依赖,跨发行版)"
else
echo "⚠️ 非纯静态,仍有动态依赖:"; ldd test/mond
fi
rm -rf test
- name: Build Debian package
@@ -73,7 +74,7 @@ jobs:
sudo apt-get update && sudo apt-get install -y dpkg-dev
VERSION=${PACKAGE_VERSION}
TARGZ="${PRODUCT_NAME}-${{ matrix.arch }}-ubuntu-${VERSION}.tar.gz"
TARGZ="${PRODUCT_NAME}-${{ matrix.arch }}-linux-static-${VERSION}.tar.gz"
echo "📦 Building Debian package for ${{ matrix.arch }}..."
chmod +x debian/build-deb.sh