ddd
Some checks failed
Deploy control plane / Build, push, and deploy production (push) Failing after 10s
Release VPS agent / Build and publish Linux agent (push) Failing after 1m8s

This commit is contained in:
2026-09-24 23:39:54 +03:00
parent d912da6310
commit d8f98497b5
6 changed files with 53 additions and 32 deletions

View File

@@ -15,9 +15,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 45
env:
CARGO_TERM_COLOR: always
RUST_TOOLCHAIN: "1.85.1"
CROSS_VERSION: "0.2.5"
BINFMT_IMAGE: "tonistiigi/binfmt:qemu-v10.2.3-68"
steps:
- name: Checkout tag
@@ -40,7 +38,7 @@ jobs:
exit 1
fi
- name: Prepare Rust and cross
- name: Prepare multi-architecture builder
shell: bash
run: |
set -Eeuo pipefail
@@ -50,29 +48,27 @@ jobs:
exit 1
}
done
if ! command -v rustup >/dev/null || ! command -v cargo >/dev/null; then
rustup_installer="$(mktemp "${RUNNER_TEMP:-/tmp}/rustup-init.XXXXXX")"
trap 'rm -f "$rustup_installer"' EXIT
curl --proto '=https' --tlsv1.2 --fail --silent --show-error \
https://sh.rustup.rs \
--output "$rustup_installer"
sh "$rustup_installer" -y --profile minimal --default-toolchain none
export PATH="${CARGO_HOME:-$HOME/.cargo}/bin:$PATH"
printf '%s\n' "${CARGO_HOME:-$HOME/.cargo}/bin" >> "$GITHUB_PATH"
fi
command -v rustup >/dev/null || { printf 'rustup installation failed\n' >&2; exit 1; }
command -v cargo >/dev/null || { printf 'cargo installation failed\n' >&2; exit 1; }
rustup toolchain install "$RUST_TOOLCHAIN" --profile minimal --no-self-update
rustup override set "$RUST_TOOLCHAIN"
cargo install cross --version "$CROSS_VERSION" --locked
docker info >/dev/null
docker buildx version >/dev/null
docker run --privileged --rm "$BINFMT_IMAGE" --install arm64
docker buildx inspect --bootstrap
- name: Build static Linux binaries
shell: bash
run: |
set -Eeuo pipefail
cross build --locked --release --manifest-path agent/Cargo.toml --target x86_64-unknown-linux-musl
cross build --locked --release --manifest-path agent/Cargo.toml --target aarch64-unknown-linux-musl
docker buildx build \
--platform linux/amd64 \
--file agent/Dockerfile.release \
--target artifact \
--output type=local,dest=build/linux-amd64 \
.
docker buildx build \
--platform linux/arm64 \
--file agent/Dockerfile.release \
--target artifact \
--output type=local,dest=build/linux-arm64 \
.
- name: Package and verify assets
shell: bash
@@ -80,8 +76,8 @@ jobs:
set -Eeuo pipefail
./scripts/package-agent-release.sh \
--output dist \
--amd64 agent/target/x86_64-unknown-linux-musl/release/vps-agent \
--arm64 agent/target/aarch64-unknown-linux-musl/release/vps-agent
--amd64 build/linux-amd64/vps-agent \
--arm64 build/linux-arm64/vps-agent
file dist/vps-agent-linux-amd64 dist/vps-agent-linux-arm64
grep -q 'statically linked' < <(file -b dist/vps-agent-linux-amd64)
grep -q 'statically linked' < <(file -b dist/vps-agent-linux-arm64)