Compare commits

..

2 Commits

Author SHA1 Message Date
7f537a420f ci: 更新 CI 流程移除 Alpine 构建
Some checks failed
Build and Release Mond / build-and-test (arm64) (push) Failing after 22s
Build and Release Mond / build-and-test (amd64) (push) Failing after 29s
Build and Release Mond / release (push) Has been skipped
主要改动:
- 移除 Alpine 构建,只保留 Ubuntu 构建
- 简化构建矩阵(移除 distro 维度)
- 添加静态链接验证步骤
- 更新 Release 说明,突出纯静态链接特性
- 优化构建输出和日志信息
- 更新 artifact 命名(移除 distro 后缀)
2025-12-15 14:54:57 +08:00
66ec4df557 docs: 更新 README.md 构建说明
- 移除 Alpine Linux 支持说明
- 强调纯静态链接特性
- 详细说明 Docker 多架构构建流程
- 添加静态链接验证方法
- 更新构建环境要求
- 更新本地构建说明
2025-12-15 14:52:53 +08:00
2 changed files with 87 additions and 31 deletions

View File

@@ -18,7 +18,6 @@ jobs:
strategy: strategy:
matrix: matrix:
arch: [amd64, arm64] arch: [amd64, arm64]
distro: [ubuntu, alpine]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -38,8 +37,9 @@ jobs:
PLATFORM="linux/${{ matrix.arch }}" PLATFORM="linux/${{ matrix.arch }}"
echo "🏗️ Building ${PLATFORM} on native ${{ matrix.arch }} runner" echo "🏗️ Building ${PLATFORM} on native ${{ matrix.arch }} runner"
echo "📦 Distribution: ${{ matrix.distro }}" echo "📦 Using Ubuntu 20.04 with depends system"
echo "📦 Monero Version: ${MONERO_VERSION}" echo "📦 Monero Version: ${MONERO_VERSION}"
echo "🔗 Static linking enabled"
# 设置 BuildKit 优化参数 # 设置 BuildKit 优化参数
export BUILDKIT_PROGRESS=plain export BUILDKIT_PROGRESS=plain
@@ -48,19 +48,35 @@ jobs:
--platform ${PLATFORM} \ --platform ${PLATFORM} \
--build-arg MONERO_VERSION=${MONERO_VERSION} \ --build-arg MONERO_VERSION=${MONERO_VERSION} \
--output type=local,dest=./output \ --output type=local,dest=./output \
-f docker/Dockerfile.${{ matrix.distro }} . -f docker/Dockerfile.ubuntu .
- name: Verify static linking
run: |
DIR="./output/linux_${{ matrix.arch }}"
BINARY="${DIR}/mond"
if [ ! -f "$BINARY" ]; then
echo "❌ 二进制文件不存在: $BINARY"
exit 1
fi
echo "🔍 验证静态链接..."
if ldd "$BINARY" 2>&1 | grep -q "not a dynamic executable"; then
echo "✅ 纯静态链接验证成功"
else
echo "❌ 静态链接验证失败,发现动态库依赖:"
ldd "$BINARY" || true
exit 1
fi
file "$BINARY"
- name: Package and test - name: Package and test
run: | run: |
DIR="./output/linux_${{ matrix.arch }}" DIR="./output/linux_${{ matrix.arch }}"
if [ ! -d "$DIR" ]; then
echo "❌ 构建输出目录不存在: $DIR"
exit 1
fi
VERSION=${MONERO_VERSION#v} # 移除前导 v VERSION=${MONERO_VERSION#v} # 移除前导 v
TARGZ="${PRODUCT_NAME}-${{ matrix.arch }}-${{ matrix.distro }}-${VERSION}.tar.gz" TARGZ="${PRODUCT_NAME}-${{ matrix.arch }}-ubuntu-${VERSION}.tar.gz"
tar -czf "${TARGZ}" -C "$DIR" . tar -czf "${TARGZ}" -C "$DIR" .
echo "📦 Created package: ${TARGZ}" echo "📦 Created package: ${TARGZ}"
@@ -72,7 +88,6 @@ jobs:
rm -rf test rm -rf test
- name: Build Debian package - name: Build Debian package
if: matrix.distro == 'ubuntu'
run: | run: |
# 安装 dpkg-deb如果需要 # 安装 dpkg-deb如果需要
sudo apt-get update && sudo apt-get install -y dpkg-dev sudo apt-get update && sudo apt-get install -y dpkg-dev
@@ -88,7 +103,7 @@ jobs:
- uses: https://github.com/ChristopherHX/gitea-upload-artifact@v4 - uses: https://github.com/ChristopherHX/gitea-upload-artifact@v4
with: with:
name: binaries-${{ matrix.arch }}-${{ matrix.distro }} name: binaries-${{ matrix.arch }}
path: | path: |
*.tar.gz *.tar.gz
*.deb *.deb
@@ -168,7 +183,7 @@ jobs:
echo "📝 生成 Release..." echo "📝 生成 Release..."
export REGISTRY OWNER TAG export REGISTRY OWNER TAG
RELEASE_DATA=$(python3 -c 'import json,glob,os;r=os.environ["REGISTRY"];o=os.environ["OWNER"];p=os.environ["PRODUCT_NAME"];t=os.environ["TAG"];b=["## Release "+t,"","Mond is a customized build of Monero daemon (monerod).","","### 📥 Download Methods","","#### Method 1: Direct Download (Recommended)","","Click on the file names in the **Assets** section below to download directly.","","#### Method 2: Generic Package Registry",""]+[f"- [`{f}`](https://{r}/api/packages/{o}/generic/{p}/{t}/{f})" for f in sorted(glob.glob("*.tar.gz"))]+["","#### Method 3: Debian Repository","","**Debian 12 (bookworm):**","","```bash","# Download GPG key",f"sudo curl https://{r}/api/packages/{o}/debian/repository.key -o /etc/apt/keyrings/gitea-{o}.asc","","# Add repository",f"echo \"deb [signed-by=/etc/apt/keyrings/gitea-{o}.asc] https://{r}/api/packages/{o}/debian bookworm main\" | sudo tee -a /etc/apt/sources.list.d/{o}.list","","# Update and install","sudo apt-get update","sudo apt-get install mond","```","","**Debian 13 (trixie):**","","```bash","# Download GPG key",f"sudo curl https://{r}/api/packages/{o}/debian/repository.key -o /etc/apt/keyrings/gitea-{o}.asc","","# Add repository",f"echo \"deb [signed-by=/etc/apt/keyrings/gitea-{o}.asc] https://{r}/api/packages/{o}/debian trixie main\" | sudo tee -a /etc/apt/sources.list.d/{o}.list","","# Update and install","sudo apt-get update","sudo apt-get install mond","```"];print(json.dumps({"tag_name":t,"name":f"Release {t}","body":"\n".join(b),"draft":False,"prerelease":False}))') RELEASE_DATA=$(python3 -c 'import json,glob,os;r=os.environ["REGISTRY"];o=os.environ["OWNER"];p=os.environ["PRODUCT_NAME"];t=os.environ["TAG"];b=["## Release "+t,"","Mond is a customized build of Monero daemon (monerod).","","### ✨ Key Features","","- 🔗 **Pure Static Linking** - No dependencies required, runs on any Linux system","- 🏗️ **Multi-Architecture** - Native support for AMD64 and ARM64","- 📦 **Built with Official depends System** - Using Monero official build system for reliability","","### 📥 Download Methods","","#### Method 1: Direct Download (Recommended)","","Click on the file names in the **Assets** section below to download directly.","","**Available Packages:**",""]+[f"- [`{f}`](https://{r}/api/packages/{o}/generic/{p}/{t}/{f})" for f in sorted(glob.glob("*.tar.gz"))]+["","#### Method 2: Generic Package Registry","","Download via command line:",""]+[f"```bash\nwget https://{r}/api/packages/{o}/generic/{p}/{t}/{f}\n```" for f in sorted(glob.glob("*.tar.gz"))[:1]]+["","#### Method 3: Debian Repository","","**Debian 12 (Bookworm):**","","```bash","# Download GPG key",f"sudo curl https://{r}/api/packages/{o}/debian/repository.key -o /etc/apt/keyrings/gitea-{o}.asc","","# Add repository",f"echo \"deb [signed-by=/etc/apt/keyrings/gitea-{o}.asc] https://{r}/api/packages/{o}/debian bookworm main\" | sudo tee -a /etc/apt/sources.list.d/{o}.list","","# Update and install","sudo apt-get update","sudo apt-get install mond","```","","**Debian 13 (Trixie):**","","```bash","# Download GPG key",f"sudo curl https://{r}/api/packages/{o}/debian/repository.key -o /etc/apt/keyrings/gitea-{o}.asc","","# Add repository",f"echo \"deb [signed-by=/etc/apt/keyrings/gitea-{o}.asc] https://{r}/api/packages/{o}/debian trixie main\" | sudo tee -a /etc/apt/sources.list.d/{o}.list","","# Update and install","sudo apt-get update","sudo apt-get install mond","```","","### 🔍 Verify Static Linking","","After downloading, verify the binary is statically linked:","","```bash","ldd mond","# Expected output: \"not a dynamic executable\"","```"];print(json.dumps({"tag_name":t,"name":f"Release {t}","body":"\n".join(b),"draft":False,"prerelease":False}))')
# 创建 Release # 创建 Release
echo "" echo ""

View File

@@ -9,7 +9,8 @@
- 🏗️ **多架构支持** - 原生支持 AMD64 和 ARM64 架构 - 🏗️ **多架构支持** - 原生支持 AMD64 和 ARM64 架构
- 📦 **多种安装方式** - 提供 Debian 包和通用二进制包 - 📦 **多种安装方式** - 提供 Debian 包和通用二进制包
- 🐧 **多发行版兼容** - 支持 UbuntuDebian 和 Alpine Linux - 🐧 **多发行版兼容** - 支持 UbuntuDebian
- 🔗 **纯静态链接** - 无需依赖,可在任意 Linux 系统运行
- 🔒 **隐私优先** - 基于 Monero 的隐私保护技术 - 🔒 **隐私优先** - 基于 Monero 的隐私保护技术
- 🔄 **自动更新** - 通过 Debian 仓库轻松安装和更新 - 🔄 **自动更新** - 通过 Debian 仓库轻松安装和更新
@@ -146,35 +147,75 @@ sudo systemctl disable mond.service
## 🏗️ 构建说明 ## 🏗️ 构建说明
### 本地构建 ### Docker 构建(推荐)
本项目使用 Docker 和官方 depends 系统构建,确保纯静态链接。
#### 构建多架构二进制文件
```bash ```bash
# 1. 克隆源代码 # 构建 amd64 和 arm64 架构
git clone .source docker buildx build --platform linux/amd64,linux/arm64 \
-f docker/Dockerfile.ubuntu \
--output type=local,dest=./output .
```
# 2. 运行修改脚本 #### 构建单一架构
```bash
# 仅构建 amd64
docker buildx build --platform linux/amd64 \
-f docker/Dockerfile.ubuntu \
--output type=local,dest=./output .
# 仅构建 arm64
docker buildx build --platform linux/arm64 \
-f docker/Dockerfile.ubuntu \
--output type=local,dest=./output .
```
#### 验证静态链接
```bash
# 检查二进制文件是否为纯静态链接
ldd output/linux_amd64/mond
# 预期输出: "not a dynamic executable"
file output/linux_amd64/mond
# 预期输出: "statically linked"
```
### 本地构建
如果不使用 Docker可以手动构建
```bash
# 1. 克隆并准备源代码
git clone https://github.com/monero-project/monero.git .source
cd .source cd .source
git checkout v0.18.3.4
git submodule update --init --force
# 2. 应用修改
../init.sh ../init.sh
# 3. 构建 # 3. 使用 depends 系统构建(推荐)
make -j$(nproc) depends target=x86_64-linux-gnu
# 二进制文件位于: build/x86_64-linux-gnu/release/bin/mond
# 或者简单构建(需要手动安装依赖)
mkdir -p build/release && cd build/release mkdir -p build/release && cd build/release
cmake ../.. -DCMAKE_BUILD_TYPE=Release -DBUILD_GUI_DEPS=OFF cmake ../.. -DCMAKE_BUILD_TYPE=Release -DBUILD_GUI_DEPS=OFF
make -j$(nproc) daemon make -j$(nproc) daemon
``` ```
### Docker 构建 ### 构建环境要求
```bash - **操作系统**: Ubuntu 20.04(推荐)或更新版本
# Ubuntu 构建 - **CPU**: 多核 CPU构建时间约 30-60 分钟)
docker buildx build --platform linux/amd64 \ - **内存**: 至少 4GB RAM
-f docker/Dockerfile.ubuntu \ - **磁盘**: 至少 10GB 可用空间
--output type=local,dest=./output . - **Docker**: 如使用 Docker 构建,需安装 Docker 和 buildx
# Alpine 构建
docker buildx build --platform linux/amd64 \
-f docker/Dockerfile.alpine \
--output type=local,dest=./output .
```
## 📝 许可证 ## 📝 许可证