chore: sync from fn-registry agent

This commit is contained in:
fn-registry agent
2026-05-30 17:28:38 +02:00
commit 4b0fb61f02
28 changed files with 3271 additions and 0 deletions
Executable
+30
View File
@@ -0,0 +1,30 @@
#!/usr/bin/env bash
# Cross-compile device_agent para 4 targets. CGO-free (modernc.org/sqlite).
# Output: build/<goos>-<goarch>/device_agent[.exe]
set -euo pipefail
cd "$(dirname "$0")"
mkdir -p build
TARGETS=(
"linux/amd64"
"linux/arm64"
"windows/amd64"
"darwin/arm64"
)
for tgt in "${TARGETS[@]}"; do
GOOS=${tgt%/*}
GOARCH=${tgt#*/}
EXT=""
[ "$GOOS" = "windows" ] && EXT=".exe"
OUT="build/$GOOS-$GOARCH/device_agent$EXT"
mkdir -p "build/$GOOS-$GOARCH"
echo "==> Building $tgt -> $OUT"
CGO_ENABLED=0 GOOS="$GOOS" GOARCH="$GOARCH" \
go build -ldflags="-s -w" -o "$OUT" .
ls -la "$OUT"
done
echo ""
echo "All targets built OK."