|
| 1 | +#!/usr/bin/env zsh |
| 2 | +# usage: configure-base.sh |
| 3 | +script_dir=${0:a:h}/.. |
| 4 | +. "$script_dir/common.sh" |
| 5 | +cache_dir=$script_dir/cache |
| 6 | +. "$script_dir/download.sh" |
| 7 | +. "$script_dir/inject.sh" |
| 8 | + |
| 9 | +>&2 echo '[*] Caching downloads' |
| 10 | +mkdir -p -- "$cache_dir" |
| 11 | +download "$cache_dir" https://static.rust-lang.org/rustup/rustup-init.sh 32a680a84cf76014915b3f8aa44e3e40731f3af92cd45eb0fcc6264fd257c428 |
| 12 | +download "$cache_dir" https://github.com/actions/runner/releases/download/v2.321.0/actions-runner-osx-x64-2.321.0.tar.gz b2c91416b3e4d579ae69fc2c381fc50dbda13f1b3fcc283187e2c75d1b173072 |
| 13 | +download "$cache_dir" https://astral.sh/uv/install.sh 47ead06f79eba7461fd113fc92dc0f191af7455418462fbbed21affa2a6c22e2 |
| 14 | +download "$cache_dir/homebrew" https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh 9ad0c8048f3f1a01d5f6610e0df347ceeae5879cf0aa51c1d987aa8aee740dca |
| 15 | + |
| 16 | +>&2 echo '[*] Injecting init script' |
| 17 | +mkdir -p init |
| 18 | +inject_exfat init "$script_dir/macos13/init.sh" |
| 19 | +inject_exfat init "$cache_dir/rustup-init.sh" |
| 20 | +inject_exfat init/install-uv.sh "$cache_dir/install.sh" |
| 21 | +inject_exfat init/install-homebrew.sh "$cache_dir/homebrew/install.sh" |
| 22 | +chmod +x init/rustup-init.sh init/install-uv.sh |
| 23 | + |
| 24 | +>&2 echo '[*] Injecting GitHub Actions runner' |
| 25 | +# See also: <https://github.com/servo/servo/settings/actions/runners/new?arch=x64&os=linux> |
| 26 | +# Runner tarball includes symlinks, which are not supported by exFAT (on macOS at least) |
| 27 | +inject_exfat init/actions-runner-osx-x64.tar.gz "$cache_dir/actions-runner-osx-x64-2.321.0.tar.gz" |
| 28 | + |
| 29 | +>&2 echo '[*] Creating working directory for builds (/Volumes/a/a)' |
| 30 | +mkdir -p a |
| 31 | + |
| 32 | +>&2 echo '[*] Injecting servo repo' |
| 33 | +mkdir -p a/servo |
| 34 | +inject_exfat a/servo "$SERVO_CI_MAIN_REPO_PATH" |
| 35 | +git -C a/servo/servo remote remove origin || : |
| 36 | +git -C a/servo/servo remote add origin https://github.com/servo/servo.git |
| 37 | + |
| 38 | +>&2 echo '[*] Injecting cargo cache' |
| 39 | +inject_exfat . "$SERVO_CI_DOT_CARGO_PATH" |
| 40 | + |
| 41 | +>&2 echo '[*] Injecting cargo config' |
| 42 | +inject_exfat .cargo/config.toml "$script_dir/shared/cargo-config.toml" |
0 commit comments