From a7b4694e60b9849e1db85a02640e02f8925f6ef6 Mon Sep 17 00:00:00 2001 From: Admin Date: Mon, 9 Mar 2026 12:33:00 +0500 Subject: [PATCH] ci: fix mac runner config YAML and simplify setup to copy static config instead of generate+patch --- scripts/runner-config-mac.yaml | 19 +++++-------------- scripts/setup_runner_mac.sh | 28 +++++----------------------- 2 files changed, 10 insertions(+), 37 deletions(-) diff --git a/scripts/runner-config-mac.yaml b/scripts/runner-config-mac.yaml index 0c3232b..11cf0aa 100644 --- a/scripts/runner-config-mac.yaml +++ b/scripts/runner-config-mac.yaml @@ -3,9 +3,8 @@ log: runner: file: .runner - # Keep capacity at 1 — iOS builds are heavy, no benefit running in parallel on one machine capacity: 1 - envs: + envs: {} env_file: .env timeout: 3h shutdown_timeout: 0s @@ -19,22 +18,16 @@ runner: cache: enabled: true - # Cache data stored in act_runner working directory dir: "" - # Must be the LAN IP of this Mac — job processes connect back to this address. - # Run: ipconfig getifaddr en0 - # Replace with your actual LAN IP before starting the runner. - host: "192.168.1.100" + host: "__HOST_IP__" port: 8088 external_server: "" container: - # Not used — all jobs run on host (macos-latest:host label). - # These settings are inert but kept for completeness. network: "" privileged: false - options: - workdir_parent: + options: "" + workdir_parent: "" valid_volumes: [] docker_host: "" force_pull: false @@ -43,6 +36,4 @@ container: docker_timeout: 0s host: - # Working directory for host-mode jobs. - # If empty, $HOME/.cache/act/ is used. - workdir_parent: + workdir_parent: "" diff --git a/scripts/setup_runner_mac.sh b/scripts/setup_runner_mac.sh index 2946670..d73b720 100755 --- a/scripts/setup_runner_mac.sh +++ b/scripts/setup_runner_mac.sh @@ -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'..."