统一 musl 全静态构建,规范 Dockerfile 与产物命名
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -18,7 +18,6 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
arch: [amd64, arm64]
|
||||
distro: [ubuntu, alpine]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -39,7 +38,7 @@ jobs:
|
||||
PLATFORM="linux/${{ matrix.arch }}"
|
||||
|
||||
echo "🏗️ Building ${PLATFORM} on native ${{ matrix.arch }} runner"
|
||||
echo "📦 Distribution: ${{ matrix.distro }}"
|
||||
echo "📦 Build: musl 全静态 (docker/Dockerfile, 基于 alpine)"
|
||||
|
||||
# 设置 BuildKit 优化参数
|
||||
export BUILDKIT_PROGRESS=plain
|
||||
@@ -48,7 +47,7 @@ jobs:
|
||||
--platform ${PLATFORM} \
|
||||
--build-arg XXXIG_VERSION=${XXXIG_VERSION} \
|
||||
--output type=local,dest=./output \
|
||||
-f docker/Dockerfile.${{ matrix.distro }} .
|
||||
-f docker/Dockerfile .
|
||||
|
||||
- name: Package and test
|
||||
run: |
|
||||
@@ -59,7 +58,7 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TARGZ="${PRODUCT_NAME}-${{ matrix.arch }}-${{ matrix.distro }}-${PACKAGE_VERSION}.tar.gz"
|
||||
TARGZ="${PRODUCT_NAME}-${{ matrix.arch }}-linux-static-${PACKAGE_VERSION}.tar.gz"
|
||||
tar -czf "${TARGZ}" -C "$DIR" .
|
||||
|
||||
echo "📦 Created package: ${TARGZ}"
|
||||
@@ -71,12 +70,11 @@ 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
|
||||
|
||||
TARGZ="${PRODUCT_NAME}-${{ matrix.arch }}-${{ matrix.distro }}-${PACKAGE_VERSION}.tar.gz"
|
||||
TARGZ="${PRODUCT_NAME}-${{ matrix.arch }}-linux-static-${PACKAGE_VERSION}.tar.gz"
|
||||
|
||||
echo "📦 Building Debian package for ${{ matrix.arch }}..."
|
||||
chmod +x debian/build-deb.sh
|
||||
@@ -86,7 +84,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
|
||||
|
||||
Reference in New Issue
Block a user