ci: fix mac runner config YAML and simplify setup to copy static config instead of generate+patch
Some checks failed
CI / Scraper / Test (pull_request) Successful in 9s
CI / Scraper / Lint (pull_request) Successful in 17s
CI / Scraper / Docker Push (pull_request) Has been skipped
CI / UI / Build (pull_request) Successful in 21s
CI / UI / Docker Push (pull_request) Has been skipped
iOS CI / Build (pull_request) Failing after 11s
iOS CI / Test (pull_request) Has been skipped
iOS Release / Release to TestFlight (push) Has been cancelled
Some checks failed
CI / Scraper / Test (pull_request) Successful in 9s
CI / Scraper / Lint (pull_request) Successful in 17s
CI / Scraper / Docker Push (pull_request) Has been skipped
CI / UI / Build (pull_request) Successful in 21s
CI / UI / Docker Push (pull_request) Has been skipped
iOS CI / Build (pull_request) Failing after 11s
iOS CI / Test (pull_request) Has been skipped
iOS Release / Release to TestFlight (push) Has been cancelled
This commit is contained in:
@@ -52,29 +52,11 @@ echo "Installed: $("$INSTALL_DIR/act_runner" --version)"
|
||||
mkdir -p "$WORK_DIR"
|
||||
mkdir -p "$(dirname "$CONFIG_PATH")"
|
||||
|
||||
# ── generate and patch config ─────────────────────────────────────────────────
|
||||
"$INSTALL_DIR/act_runner" generate-config > "$CONFIG_PATH"
|
||||
|
||||
# Patch labels, cache host/port, and capacity
|
||||
awk -v host="$HOST_IP" -v port="$CACHE_PORT" '
|
||||
/^runner:/ { in_runner=1; in_cache=0 }
|
||||
/^cache:/ { in_cache=1; in_runner=0 }
|
||||
/^[a-z]/ && !/^runner:/ && !/^cache:/ { in_runner=0; in_cache=0 }
|
||||
|
||||
in_runner && /capacity:/ { $0 = " capacity: 1" }
|
||||
in_runner && /labels:/ { print; skip_labels=1; next }
|
||||
skip_labels && /^ - / { next }
|
||||
skip_labels && !/^ - / { skip_labels=0
|
||||
print " - \"macos-latest:host\""
|
||||
print " - \"macos-14:host\"" }
|
||||
|
||||
in_cache && /enabled:/ { $0 = " enabled: true" }
|
||||
in_cache && /host:/ { $0 = " host: \"" host "\"" }
|
||||
in_cache && /port:/ { $0 = " port: " port; in_cache=0 }
|
||||
|
||||
{ print }
|
||||
' "$CONFIG_PATH" > "${CONFIG_PATH}.tmp" && mv "${CONFIG_PATH}.tmp" "$CONFIG_PATH"
|
||||
echo "Config patched: labels=macos-latest:host, cache=$HOST_IP:$CACHE_PORT"
|
||||
# ── install config ────────────────────────────────────────────────────────────
|
||||
# Use the checked-in static config and substitute the LAN IP placeholder.
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
sed "s/__HOST_IP__/$HOST_IP/" "$SCRIPT_DIR/runner-config-mac.yaml" > "$CONFIG_PATH"
|
||||
echo "Config written: labels=macos-latest:host, cache=$HOST_IP:$CACHE_PORT"
|
||||
|
||||
# ── register runner ───────────────────────────────────────────────────────────
|
||||
echo "Registering runner '$RUNNER_NAME'..."
|
||||
|
||||
Reference in New Issue
Block a user