优化 CI 构建流程
Some checks failed
Build and Release / build-and-test (arm64, ubuntu) (push) Successful in 29s
Build and Release / build-and-test (amd64, ubuntu) (push) Failing after 16m22s
Build and Release / build-and-test (amd64, alpine) (push) Failing after 16m24s
Build and Release / build-and-test (arm64, alpine) (push) Successful in 28m28s
Build and Release / release (push) Has been skipped
Some checks failed
Build and Release / build-and-test (arm64, ubuntu) (push) Successful in 29s
Build and Release / build-and-test (amd64, ubuntu) (push) Failing after 16m22s
Build and Release / build-and-test (amd64, alpine) (push) Failing after 16m24s
Build and Release / build-and-test (arm64, alpine) (push) Successful in 28m28s
Build and Release / release (push) Has been skipped
This commit is contained in:
@@ -15,6 +15,9 @@ env:
|
||||
jobs:
|
||||
build-and-test:
|
||||
runs-on: ${{ matrix.arch == 'amd64' && 'ubuntu-latest-amd64' || 'ubuntu-latest-arm64' }}
|
||||
concurrency:
|
||||
group: build-${{ matrix.arch }}
|
||||
cancel-in-progress: false
|
||||
strategy:
|
||||
matrix:
|
||||
arch: [amd64, arm64]
|
||||
|
||||
17
debian/build-deb.sh
vendored
17
debian/build-deb.sh
vendored
@@ -12,7 +12,10 @@ ARCH=$1
|
||||
VERSION=$2
|
||||
TARGZ_FILE=$3
|
||||
PKG_NAME="p2pool"
|
||||
DEB_FILE="${PKG_NAME}_${VERSION}_${ARCH}.deb"
|
||||
|
||||
# Strip 'v' prefix from version if present (Debian versions must start with digit)
|
||||
DEB_VERSION="${VERSION#v}"
|
||||
DEB_FILE="${PKG_NAME}_${DEB_VERSION}_${ARCH}.deb"
|
||||
|
||||
# 转换架构名称(Docker 使用的架构名到 Debian 架构名)
|
||||
case "$ARCH" in
|
||||
@@ -30,7 +33,7 @@ esac
|
||||
|
||||
echo "📦 Building Debian package: ${DEB_FILE}"
|
||||
echo " Architecture: ${DEB_ARCH}"
|
||||
echo " Version: ${VERSION}"
|
||||
echo " Version: ${DEB_VERSION} (from ${VERSION})"
|
||||
echo " Source: ${TARGZ_FILE}"
|
||||
|
||||
# 创建临时目录
|
||||
@@ -38,19 +41,19 @@ BUILD_DIR=$(mktemp -d)
|
||||
trap "rm -rf $BUILD_DIR" EXIT
|
||||
|
||||
# 创建包目录结构
|
||||
PKG_DIR="${BUILD_DIR}/${PKG_NAME}_${VERSION}_${DEB_ARCH}"
|
||||
PKG_DIR="${BUILD_DIR}/${PKG_NAME}_${DEB_VERSION}_${DEB_ARCH}"
|
||||
mkdir -p "${PKG_DIR}/DEBIAN"
|
||||
mkdir -p "${PKG_DIR}/usr/local/bin"
|
||||
mkdir -p "${PKG_DIR}/opt/p2pool"
|
||||
mkdir -p "${PKG_DIR}/lib/systemd/system"
|
||||
mkdir -p "${PKG_DIR}/etc/p2pool"
|
||||
|
||||
# 解压二进制文件
|
||||
echo "📂 Extracting binaries..."
|
||||
tar -xzf "${TARGZ_FILE}" -C "${PKG_DIR}/usr/local/bin"
|
||||
tar -xzf "${TARGZ_FILE}" -C "${PKG_DIR}/opt/p2pool"
|
||||
|
||||
# 生成 control 文件
|
||||
echo "📝 Generating control file..."
|
||||
sed -e "s/{{VERSION}}/${VERSION}/" \
|
||||
sed -e "s/{{VERSION}}/${DEB_VERSION}/" \
|
||||
-e "s/{{ARCH}}/${DEB_ARCH}/" \
|
||||
debian/control.template > "${PKG_DIR}/DEBIAN/control"
|
||||
|
||||
@@ -68,7 +71,7 @@ echo "🔧 Installing systemd service..."
|
||||
cp debian/p2pool.service "${PKG_DIR}/lib/systemd/system/"
|
||||
|
||||
# 设置权限
|
||||
chmod 755 "${PKG_DIR}/usr/local/bin/p2pool"
|
||||
chmod 755 "${PKG_DIR}/opt/p2pool/p2pool"
|
||||
chmod 644 "${PKG_DIR}/lib/systemd/system/p2pool.service"
|
||||
|
||||
# 构建 deb 包
|
||||
|
||||
11
debian/p2pool.service
vendored
11
debian/p2pool.service
vendored
@@ -8,7 +8,16 @@ Type=simple
|
||||
User=p2pool
|
||||
Group=p2pool
|
||||
WorkingDirectory=/var/lib/p2pool
|
||||
ExecStart=/usr/local/bin/p2pool --host 127.0.0.1 --rpc-port 18081 --wallet YOUR_MONERO_WALLET_ADDRESS
|
||||
ExecStart=/opt/p2pool/p2pool \
|
||||
--host 127.0.0.1 \
|
||||
--rpc-port 18081 \
|
||||
--zmq-port 18083 \
|
||||
--wallet YOUR_MONERO_WALLET_ADDRESS \
|
||||
--merge-mine tari://TARI_NODE_IP:18102 TARI_WALLET_ADDRESS \
|
||||
--p2p 0.0.0.0:37889 \
|
||||
--data-api /var/lib/p2pool/data-api \
|
||||
--local-api \
|
||||
--loglevel 3
|
||||
Restart=on-failure
|
||||
RestartSec=10s
|
||||
StandardOutput=journal
|
||||
|
||||
8
debian/postinst
vendored
8
debian/postinst
vendored
@@ -23,8 +23,8 @@ chown p2pool:p2pool /var/log/p2pool
|
||||
chmod 750 /var/log/p2pool
|
||||
|
||||
# Set binary permissions
|
||||
chown root:root /usr/local/bin/p2pool
|
||||
chmod 755 /usr/local/bin/p2pool
|
||||
chown root:root /opt/p2pool/p2pool
|
||||
chmod 755 /opt/p2pool/p2pool
|
||||
|
||||
# Reload systemd
|
||||
if [ -d /run/systemd/system ]; then
|
||||
@@ -52,10 +52,10 @@ echo " sudo journalctl -u p2pool -f"
|
||||
echo ""
|
||||
echo "Data directory: /var/lib/p2pool"
|
||||
echo "Log directory: /var/log/p2pool"
|
||||
echo "Binary: /usr/local/bin/p2pool"
|
||||
echo "Binary: /opt/p2pool/p2pool"
|
||||
echo ""
|
||||
echo "For help:"
|
||||
echo " p2pool --help"
|
||||
echo " /opt/p2pool/p2pool --help"
|
||||
echo ""
|
||||
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user