Files
harpia/scripts/package-cli.sh
T
Lucas RayanandClaude Opus 5.5 7146f4f70f
CI / Format and clippy (pull_request) Successful in 33s
CI / Dependency audit (pull_request) Successful in 15s
CI / Tests (Linux) (pull_request) Successful in 1m56s
CI / Docker image (build and smoke test) (pull_request) Successful in 6m10s
chore(release): 1.0.0
Releases attach a standalone CLI for linux-aarch64 and linux-x86_64 built
natively (package-cli.sh/release-upload.sh, as in Sabiá). ROADMAP drops the
reference to the local-only spec and README describes the published image
and binaries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 10:17:22 -03:00

40 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
# Builds the CLI for a target platform and packages it for a release:
# xexeu-<tag>-<platform>.tar.gz alongside a .sha256 checksum file.
#
# scripts/package-cli.sh v1.0.3 linux-x86_64 x86_64-unknown-linux-gnu
#
# Supported platforms: linux-x86_64 and linux-aarch64. When cross-compiling
# from a non-x86_64 host, uses gcc-x86-64-linux-gnu. Writes the archives to the
# repository root and prints their filenames.
set -euo pipefail
cd "$(dirname "$0")/.."
tag=${1:?usage: package-cli.sh <tag> <platform> <rust-target>}
platform=${2:?usage: package-cli.sh <tag> <platform> <rust-target>}
target=${3:?usage: package-cli.sh <tag> <platform> <rust-target>}
case "$target" in
x86_64-unknown-linux-gnu)
if [ "$(uname -m)" != x86_64 ]; then
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-linux-gnu-gcc
export CC_x86_64_unknown_linux_gnu=x86_64-linux-gnu-gcc
fi ;;
esac
rustup target add "$target" >/dev/null 2>&1 || true
cargo build --release --locked -p xexeu-cli --target "$target"
name="xexeu-${tag}-${platform}"
rm -rf "$name"; mkdir "$name"
cp "${CARGO_TARGET_DIR:-target}/${target}/release/xexeu" "$name/"
cp README.md LICENSE-MIT LICENSE-APACHE "$name/"
tar czf "$name.tar.gz" "$name"
asset="$name.tar.gz"
rm -rf "$name"
sha256sum "$asset" > "$asset.sha256"
echo "$asset"
echo "$asset.sha256"