-
-
Notifications
You must be signed in to change notification settings - Fork 836
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·34 lines (27 loc) · 853 Bytes
/
release.sh
File metadata and controls
executable file
·34 lines (27 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
SETUP=1
if [[ "${1:-}" == "--no-setup" ]]; then
SETUP=0
shift
elif [[ "${1:-}" == "--setup" ]]; then
SETUP=1
shift
fi
if ! command -v infra >/dev/null 2>&1; then
echo "release: infra CLI not found. Build it with:" >&2
echo " (cd /path/to/infra/cli && cargo build --release && cp target/release/infra ~/.local/bin/infra)" >&2
exit 1
fi
bash "${ROOT_DIR}/scripts/package-release.sh"
tarball="$(ls -t "${ROOT_DIR}"/dist/flow_*_darwin_arm64.tar.gz 2>/dev/null | head -n1 || true)"
if [[ -z "${tarball}" ]]; then
echo "release: no darwin/arm64 tarball found in dist/" >&2
exit 1
fi
cmd=(infra release publish "${tarball}" --path "${ROOT_DIR}")
if [[ "${SETUP}" -eq 1 ]]; then
cmd+=(--setup)
fi
"${cmd[@]}"