oficina / equipo Public

Clone
git clone https://amadan.net/oficina/equipo

Plain git — no account needed to clone.

Download

Download this file

1#!/bin/sh
2set -eu
3source=$1
4output=$2
5target_os=$3
6target_arch=$4
7version=$5
8bundle=internal/release/bundled
9# An existing directory belongs to another build. Never remove or reuse it.
10mkdir "$bundle"
11trap 'rm -rf "$bundle"' EXIT
12trap 'exit 1' HUP INT TERM
13# The page renderer (renderer.tar.gz) is not bundled: the Linux runner
14# fetches it from its forge release (internal/release RendererForge). The
15# platform caps one ship at 256 MiB, and the renderer alone is ~230 MB.
16for name in install-manifest.json equipo-runner equipo-tool-proxy gitleaks install-v1.sh; do
17 cp "$source/$name" "$bundle/$name"
18done
19# The Mac worker's runner, served under darwin-arm64/ (it has no tool proxy).
20mkdir "$bundle/darwin-arm64"
21for name in equipo-runner gitleaks; do
22 cp "$source/darwin-arm64/$name" "$bundle/darwin-arm64/$name"
23done
24# Everything embedded stays well under the ship cap (a bound, not the cap).
25bundled=$(du -sb "$bundle" | cut -f 1)
26if [ "$bundled" -gt $((160 << 20)) ]; then
27 echo "build-instance-release: the bundle is $bundled bytes, over 160 MiB" >&2
28 exit 1
29fi
30# The instance serves only the tool proxy of its own build: its digest is
31# linked in, as it is into the runners (Makefile, RELEASE_LDFLAGS).
32proxy=$(sha256sum "$source/equipo-tool-proxy" | cut -d ' ' -f 1)
33ldflags="-s -w -X amadan.net/rastrillo/rastrillo.BuildVersion=$version -X amadan.net/oficina/equipo/internal/release.toolProxySHA256=$proxy"
34# Exercise the same manifest and digest checks as the download handler.
35EQUIPO_BUNDLE_VERSION="$version" CGO_ENABLED=0 go test -tags runnerassets -ldflags "$ldflags" ./internal/release -run '^TestBundledInstallAssets$' -count=1
36CGO_ENABLED=0 GOOS="$target_os" GOARCH="$target_arch" go build -tags runnerassets -trimpath \
37 -ldflags "$ldflags" \
38 -o "$output" ./cmd/equipo
39