Compare commits
2 Commits
8014002dff
...
7f537a420f
| Author | SHA1 | Date | |
|---|---|---|---|
| 7f537a420f | |||
| 66ec4df557 |
@@ -18,7 +18,6 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
arch: [amd64, arm64]
|
||||
distro: [ubuntu, alpine]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -38,8 +37,9 @@ jobs:
|
||||
PLATFORM="linux/${{ matrix.arch }}"
|
||||
|
||||
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 "🔗 Static linking enabled"
|
||||
|
||||
# 设置 BuildKit 优化参数
|
||||
export BUILDKIT_PROGRESS=plain
|
||||
@@ -48,19 +48,35 @@ jobs:
|
||||
--platform ${PLATFORM} \
|
||||
--build-arg MONERO_VERSION=${MONERO_VERSION} \
|
||||
--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
|
||||
run: |
|
||||
DIR="./output/linux_${{ matrix.arch }}"
|
||||
|
||||
if [ ! -d "$DIR" ]; then
|
||||
echo "❌ 构建输出目录不存在: $DIR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
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" .
|
||||
|
||||
echo "📦 Created package: ${TARGZ}"
|
||||
@@ -72,7 +88,6 @@ jobs:
|
||||
rm -rf test
|
||||
|
||||
- name: Build Debian package
|
||||
if: matrix.distro == 'ubuntu'
|
||||
run: |
|
||||
# 安装 dpkg-deb(如果需要)
|
||||
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
|
||||
with:
|
||||
name: binaries-${{ matrix.arch }}-${{ matrix.distro }}
|
||||
name: binaries-${{ matrix.arch }}
|
||||
path: |
|
||||
*.tar.gz
|
||||
*.deb
|
||||
@@ -168,7 +183,7 @@ jobs:
|
||||
echo "📝 生成 Release..."
|
||||
|
||||
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
|
||||
echo ""
|
||||
|
||||
77
README.md
77
README.md
@@ -9,7 +9,8 @@
|
||||
|
||||
- 🏗️ **多架构支持** - 原生支持 AMD64 和 ARM64 架构
|
||||
- 📦 **多种安装方式** - 提供 Debian 包和通用二进制包
|
||||
- 🐧 **多发行版兼容** - 支持 Ubuntu、Debian 和 Alpine Linux
|
||||
- 🐧 **多发行版兼容** - 支持 Ubuntu 和 Debian
|
||||
- 🔗 **纯静态链接** - 无需依赖,可在任意 Linux 系统运行
|
||||
- 🔒 **隐私优先** - 基于 Monero 的隐私保护技术
|
||||
- 🔄 **自动更新** - 通过 Debian 仓库轻松安装和更新
|
||||
|
||||
@@ -146,35 +147,75 @@ sudo systemctl disable mond.service
|
||||
|
||||
## 🏗️ 构建说明
|
||||
|
||||
### 本地构建
|
||||
### Docker 构建(推荐)
|
||||
|
||||
本项目使用 Docker 和官方 depends 系统构建,确保纯静态链接。
|
||||
|
||||
#### 构建多架构二进制文件
|
||||
|
||||
```bash
|
||||
# 1. 克隆源代码
|
||||
git clone .source
|
||||
# 构建 amd64 和 arm64 架构
|
||||
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
|
||||
git checkout v0.18.3.4
|
||||
git submodule update --init --force
|
||||
|
||||
# 2. 应用修改
|
||||
../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
|
||||
cmake ../.. -DCMAKE_BUILD_TYPE=Release -DBUILD_GUI_DEPS=OFF
|
||||
make -j$(nproc) daemon
|
||||
```
|
||||
|
||||
### Docker 构建
|
||||
### 构建环境要求
|
||||
|
||||
```bash
|
||||
# Ubuntu 构建
|
||||
docker buildx build --platform linux/amd64 \
|
||||
-f docker/Dockerfile.ubuntu \
|
||||
--output type=local,dest=./output .
|
||||
|
||||
# Alpine 构建
|
||||
docker buildx build --platform linux/amd64 \
|
||||
-f docker/Dockerfile.alpine \
|
||||
--output type=local,dest=./output .
|
||||
```
|
||||
- **操作系统**: Ubuntu 20.04(推荐)或更新版本
|
||||
- **CPU**: 多核 CPU(构建时间约 30-60 分钟)
|
||||
- **内存**: 至少 4GB RAM
|
||||
- **磁盘**: 至少 10GB 可用空间
|
||||
- **Docker**: 如使用 Docker 构建,需安装 Docker 和 buildx
|
||||
|
||||
## 📝 许可证
|
||||
|
||||
|
||||
Reference in New Issue
Block a user