2 Commits
main ... v0.1.5

Author SHA1 Message Date
61e7800b51 安装发布构建所需 Rust 目标
Some checks failed
发布 Linux 二进制 / release-linux-x86_64 (push) Failing after 3m8s
2026-05-25 17:59:17 +08:00
a97ec39a1c 兼容更多 Runner 基础镜像
Some checks failed
发布 Linux 二进制 / release-linux-x86_64 (push) Failing after 1h58m58s
2026-05-25 15:06:13 +08:00
2 changed files with 27 additions and 1 deletions

View File

@@ -40,23 +40,46 @@ jobs:
if command -v apt-get >/dev/null 2>&1; then if command -v apt-get >/dev/null 2>&1; then
apt-get update apt-get update
apt-get install -y build-essential pkg-config sqlite3 curl tar ca-certificates nodejs npm apt-get install -y build-essential pkg-config sqlite3 curl tar ca-certificates nodejs npm
elif command -v apk >/dev/null 2>&1; then
apk add --no-cache build-base pkgconf sqlite curl wget tar ca-certificates nodejs npm bash git
elif command -v dnf >/dev/null 2>&1; then elif command -v dnf >/dev/null 2>&1; then
dnf install -y gcc gcc-c++ make pkgconf-pkg-config sqlite curl tar ca-certificates nodejs npm dnf install -y gcc gcc-c++ make pkgconf-pkg-config sqlite curl tar ca-certificates nodejs npm
elif command -v yum >/dev/null 2>&1; then elif command -v yum >/dev/null 2>&1; then
yum install -y gcc gcc-c++ make pkgconfig sqlite curl tar ca-certificates nodejs npm yum install -y gcc gcc-c++ make pkgconfig sqlite curl tar ca-certificates nodejs npm
elif command -v pacman >/dev/null 2>&1; then elif command -v pacman >/dev/null 2>&1; then
pacman -Sy --noconfirm base-devel pkgconf sqlite curl tar ca-certificates nodejs npm pacman -Sy --noconfirm base-devel pkgconf sqlite curl tar ca-certificates nodejs npm
else
echo "未找到支持的包管理器,当前系统信息:"
uname -a || true
cat /etc/os-release || true
echo "PATH=$PATH"
exit 1
fi fi
command -v git
command -v tar
command -v node
command -v npm
command -v curl || command -v wget
- name: 安装 Rust - name: 安装 Rust
run: | run: |
set -eux set -eux
if ! command -v cargo >/dev/null 2>&1; then if ! command -v cargo >/dev/null 2>&1; then
if command -v curl >/dev/null 2>&1; then
curl --proto '=https' --tlsv1.2 -fsSL https://sh.rustup.rs | sh -s -- -y --profile minimal curl --proto '=https' --tlsv1.2 -fsSL https://sh.rustup.rs | sh -s -- -y --profile minimal
elif command -v wget >/dev/null 2>&1; then
wget -qO- https://sh.rustup.rs | sh -s -- -y --profile minimal
else
echo "缺少 curl/wget无法安装 Rust"
exit 1
fi
. "$HOME/.cargo/env" . "$HOME/.cargo/env"
fi fi
rustc -V rustc -V
cargo -V cargo -V
if command -v rustup >/dev/null 2>&1; then
rustup target add x86_64-unknown-linux-gnu
fi
- name: 构建发布包 - name: 构建发布包
run: | run: |

View File

@@ -125,6 +125,9 @@ if [[ "$SKIP_BUILD" != "true" ]]; then
log "构建 Rust 二进制" log "构建 Rust 二进制"
cd "$ROOT" cd "$ROOT"
if [[ -n "$TARGET" ]]; then if [[ -n "$TARGET" ]]; then
if command -v rustup >/dev/null 2>&1; then
rustup target add "$TARGET"
fi
cargo build --release --target "$TARGET" -p lightops-server -p lightops-agent cargo build --release --target "$TARGET" -p lightops-server -p lightops-agent
BIN_DIR="target/${TARGET}/release" BIN_DIR="target/${TARGET}/release"
else else