oficina / agent-access Public

Clone
git clone https://amadan.net/oficina/agent-access

Plain git — no account needed to clone.

Download this file

1#!/usr/bin/env bash
2# Build committed source only. No upload, promotion or infrastructure changes.
3set -euo pipefail
4test "$#" -ge 1 && test "$#" -le 2
5mkdir -p "$1"
6release_output=$(cd "$1" && pwd)
7cd "$(dirname "$0")/.."
8release_commit=$(git rev-parse --verify "${2:-HEAD}^{commit}")
9release_source=$(mktemp -d)
10trap 'rm -rf -- "$release_source"' EXIT
11git archive "$release_commit" | tar -x -C "$release_source"
12cd "$release_source"
13export GOWORK=off
14export GOTOOLCHAIN=go1.26.5
15export CGO_ENABLED=0
16for release_command in oficina-connect oficina; do
17 GOOS=linux GOARCH=arm64 go build -mod=readonly -trimpath -buildvcs=false \
18 -ldflags "-s -w -X amadan.net/rastrillo/rastrillo.BuildVersion=$release_commit" \
19 -o "$release_output/$release_command-linux-arm64" "./cmd/$release_command"
20 GOOS=$(go env GOHOSTOS) GOARCH=$(go env GOHOSTARCH) go build -mod=readonly -trimpath -buildvcs=false \
21 -ldflags "-s -w -X amadan.net/rastrillo/rastrillo.BuildVersion=$release_commit" \
22 -o "$release_output/$release_command-native" "./cmd/$release_command"
23done
24cp cmd/oficina-connect/testdata/synthetic-config.json "$release_output/synthetic-config.json"
25printf '%s\n' "$release_commit" > "$release_output/VERSION"
26cd "$release_output"
27python3 - <<'HASHES'
28import hashlib
29from pathlib import Path
30names = ("oficina-connect-linux-arm64", "oficina-linux-arm64", "oficina-connect-native", "oficina-native")
31Path("SHA256SUMS").write_text("".join(hashlib.sha256(Path(name).read_bytes()).hexdigest() + " " + name + "\n" for name in names))
32HASHES
33printf 'Built %s; pass that exact value to carlos deploy --version.\n' "$release_commit"
34