初始化 XXXig 打包部署脚本与 CI 流水线
Build and Release / build-and-test (amd64, ubuntu) (push) Successful in 1m12s
Build and Release / build-and-test (amd64, alpine) (push) Successful in 1m21s
Build and Release / build-and-test (arm64, ubuntu) (push) Successful in 5m24s
Build and Release / build-and-test (arm64, alpine) (push) Successful in 6m8s
Build and Release / release (push) Has been skipped
Build and Release / build-and-test (amd64, ubuntu) (push) Successful in 1m12s
Build and Release / build-and-test (amd64, alpine) (push) Successful in 1m21s
Build and Release / build-and-test (arm64, ubuntu) (push) Successful in 5m24s
Build and Release / build-and-test (arm64, alpine) (push) Successful in 6m8s
Build and Release / release (push) Has been skipped
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
FROM alpine:latest AS base
|
||||
|
||||
# 根据目标架构设置构建参数
|
||||
ARG TARGETARCH
|
||||
|
||||
RUN apk update && apk add --no-cache \
|
||||
git \
|
||||
make \
|
||||
cmake \
|
||||
libstdc++ \
|
||||
gcc \
|
||||
g++ \
|
||||
automake \
|
||||
libtool \
|
||||
autoconf \
|
||||
linux-headers \
|
||||
libuv-dev \
|
||||
openssl-dev \
|
||||
hwloc-dev
|
||||
|
||||
FROM base AS build
|
||||
|
||||
ARG TARGZ_FILE
|
||||
ARG XXXIG_VERSION
|
||||
ARG TARGETARCH
|
||||
ARG BUILDPLATFORM
|
||||
ARG TARGETPLATFORM
|
||||
|
||||
RUN git clone --recursive https://github.com/wangdefaa/xxxig.git && \
|
||||
cd xxxig && \
|
||||
git checkout ${XXXIG_VERSION}
|
||||
|
||||
WORKDIR /xxxig
|
||||
|
||||
|
||||
# 根据目标架构优化编译
|
||||
RUN mkdir build && cd scripts && chmod +x ./*.sh && \
|
||||
if [ "$BUILDPLATFORM" != "$TARGETPLATFORM" ]; then \
|
||||
MAKE_JOBS="-j2"; \
|
||||
else \
|
||||
MAKE_JOBS="-j$(nproc)"; \
|
||||
fi && \
|
||||
echo "Building with parallel jobs: $MAKE_JOBS (cross-compile: $([ "$BUILDPLATFORM" != "$TARGETPLATFORM" ] && echo yes || echo no))" && \
|
||||
./build_deps.sh $MAKE_JOBS && cd ../build && \
|
||||
if [ "$TARGETARCH" = "arm64" ]; then \
|
||||
cmake .. -DWITH_CC_CLIENT=ON \
|
||||
-DWITH_CC_SERVER=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DXMRIG_DEPS=scripts/deps \
|
||||
-DBUILD_STATIC=ON \
|
||||
-DWITH_ZLIB=ON \
|
||||
-DWITH_OPENCL=OFF \
|
||||
-DWITH_CUDA=OFF \
|
||||
-DARM_TARGET=8; \
|
||||
elif [ "$TARGETARCH" = "arm" ]; then \
|
||||
cmake .. -DWITH_CC_CLIENT=ON \
|
||||
-DWITH_CC_SERVER=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DXMRIG_DEPS=scripts/deps \
|
||||
-DBUILD_STATIC=ON \
|
||||
-DWITH_ZLIB=ON \
|
||||
-DWITH_OPENCL=OFF \
|
||||
-DWITH_CUDA=OFF \
|
||||
-DARM_TARGET=7; \
|
||||
else \
|
||||
cmake .. -DWITH_CC_CLIENT=ON \
|
||||
-DWITH_CC_SERVER=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DXMRIG_DEPS=scripts/deps \
|
||||
-DBUILD_STATIC=ON \
|
||||
-DWITH_ZLIB=ON \
|
||||
-DWITH_OPENCL=OFF \
|
||||
-DWITH_CUDA=OFF; \
|
||||
fi && \
|
||||
make $MAKE_JOBS
|
||||
|
||||
FROM scratch
|
||||
|
||||
ARG TARGETARCH
|
||||
|
||||
COPY --from=build /xxxig/build/xxxigDaemon /linux_${TARGETARCH}/xxxigDaemon
|
||||
COPY --from=build /xxxig/build/xxxig /linux_${TARGETARCH}/xxxig
|
||||
COPY --from=build /xxxig/build/xxxigServer /linux_${TARGETARCH}/xxxigServer
|
||||
COPY --from=build /xxxig/src/config_cc.json /linux_${TARGETARCH}/config_cc.json
|
||||
COPY --from=build /xxxig/src/config.json /linux_${TARGETARCH}/config.json
|
||||
COPY --from=build /xxxig/index.html /linux_${TARGETARCH}/index.html
|
||||
Reference in New Issue
Block a user