Ensure Bazel is available in self-hosted workflows (#6785)

* Ensure Bazel is available in self-hosted workflows

* Allow Bazel CI to use Command Line Tools

* Set macOS C++ deployment target for Bazel

* Use Bazel macOS minimum OS flags

* Raise macOS Bazel deployment target for filesystem

* Ensure git-lfs is available for CI fetches

* Authenticate CI LFS fetches with workflow token

* Disable stale LFS hooks during CI checkout

* Disable LFS filters during CI checkout

* Prepare Git LFS before persistent checkout

* Harden generated Bazel rc and LFS auth

* Let Xcode sync skip without full Xcode

* Harden Unity build cache markers

* Require full Xcode for mactools sync
This commit is contained in:
2026-05-29 07:52:17 -07:00
committed by GitHub
parent 899162bbc5
commit 758ae6d44f
18 changed files with 343 additions and 9 deletions
+18 -6
View File
@@ -17,14 +17,21 @@
set -euo pipefail
XCODE_BUILD_VERSION=$(xcodebuild -version 2>/dev/null | awk '/Build version/ {print $3}')
if [ -z "$XCODE_BUILD_VERSION" ]; then
echo "Warning: Could not detect Xcode build version, skipping"
exit 0
DEVELOPER_DIR=""
if [ -d "/Applications/Xcode.app/Contents/Developer" ]; then
DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer"
else
DEVELOPER_DIR=$(xcode-select -p 2>/dev/null || true)
fi
DEVELOPER_DIR=$(xcode-select -p 2>/dev/null)
XCODE_BUILD_VERSION=$(DEVELOPER_DIR="$DEVELOPER_DIR" xcodebuild -version 2>/dev/null | awk '/Build version/ {print $3}' || true)
if [ -z "$XCODE_BUILD_VERSION" ]; then
echo "ERROR: Could not detect full Xcode build version."
echo "mactools/Sparkle builds require full Xcode, not just Command Line Tools."
echo "Install Xcode at /Applications/Xcode.app or select it with xcode-select."
exit 1
fi
BAZELRC_XCODE=".bazelrc.xcode"
EXPECTED_LINE="common:mactools --action_env=XCODE_BUILD_VERSION=${XCODE_BUILD_VERSION}"
@@ -51,4 +58,9 @@ cat > "$BAZELRC_XCODE" << EOF
${EXPECTED_LINE}
common:mactools --repo_env=DEVELOPER_DIR=${DEVELOPER_DIR}
EOF
if [ -n "${GITHUB_ENV:-}" ]; then
echo "DEVELOPER_DIR=${DEVELOPER_DIR}" >> "$GITHUB_ENV"
fi
echo "Updated ${BAZELRC_XCODE} — next mactools build will rebuild with Xcode ${XCODE_BUILD_VERSION}"