brew install xcodegen resolves to a formula requiring Xcode 15.3, which cannot be installed on the macOS 12 runner (Xcode 14.2), failing run 31390 before project generation. Install a pinned prebuilt XcodeGen 2.38.0 release via scripts/ensure-host-tools.sh, shared by the build-and-test and package jobs (package-release.sh also runs xcodegen). Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
41 lines
1.4 KiB
Bash
Executable File
41 lines
1.4 KiB
Bash
Executable File
#!/bin/sh
|
|
# scripts/ensure-host-tools.sh
|
|
#
|
|
# Bootstrap host tools needed by CI on the macOS 12 runner:
|
|
# - xcodegen: pinned prebuilt release from GitHub (Homebrew's current
|
|
# formula requires Xcode 15.3, which cannot be installed on macOS 12).
|
|
# - dmgbuild: via pip3 (used by scripts/package-release.sh).
|
|
#
|
|
# Safe to run repeatedly: existing tools are left alone.
|
|
|
|
set -eu
|
|
|
|
XCODEGEN_VERSION="2.38.0"
|
|
INSTALL_ROOT="${XCODEGEN_HOME:-$HOME/.local/xcodegen/$XCODEGEN_VERSION}"
|
|
|
|
echo "==> Ensuring dmgbuild"
|
|
python3 -c "import dmgbuild" 2>/dev/null || pip3 install dmgbuild
|
|
|
|
if command -v xcodegen >/dev/null 2>&1; then
|
|
echo "==> xcodegen already on PATH: $(xcodegen --version)"
|
|
else
|
|
echo "==> Installing xcodegen $XCODEGEN_VERSION (prebuilt)"
|
|
TMP="${RUNNER_TEMP:-${TMPDIR:-/tmp}}"
|
|
ZIP="$TMP/xcodegen-$XCODEGEN_VERSION.zip"
|
|
curl -fL --retry 3 \
|
|
"https://github.com/yonaskolb/XcodeGen/releases/download/$XCODEGEN_VERSION/xcodegen.zip" \
|
|
-o "$ZIP"
|
|
rm -rf "$INSTALL_ROOT"
|
|
mkdir -p "$INSTALL_ROOT"
|
|
# Zip contains xcodegen/{bin/xcodegen,share/xcodegen/SettingPresets};
|
|
# XcodeGen resolves its presets relative to the binary, so keep the tree.
|
|
unzip -q "$ZIP" -d "$INSTALL_ROOT"
|
|
BIN_DIR="$INSTALL_ROOT/xcodegen/bin"
|
|
chmod +x "$BIN_DIR/xcodegen"
|
|
if [ -n "${GITHUB_PATH:-}" ]; then
|
|
echo "$BIN_DIR" >> "$GITHUB_PATH"
|
|
fi
|
|
PATH="$BIN_DIR:$PATH"
|
|
echo "==> Installed: $("$BIN_DIR/xcodegen" --version)"
|
|
fi
|