ci: 更新 CI 流程移除 Alpine 构建
主要改动: - 移除 Alpine 构建,只保留 Ubuntu 构建 - 简化构建矩阵(移除 distro 维度) - 添加静态链接验证步骤 - 更新 Release 说明,突出纯静态链接特性 - 优化构建输出和日志信息 - 更新 artifact 命名(移除 distro 后缀)
This commit is contained in:
@@ -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 ""
|
||||||
|
|||||||
Reference in New Issue
Block a user