Skip to content

Commit aafdf82

Browse files
committed
ci: prepare xcode 26 no matter the name, refactor
1 parent 223c88b commit aafdf82

File tree

4 files changed

+34
-18
lines changed

4 files changed

+34
-18
lines changed

.github/actions/prepare-environment/action.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,18 @@ name: Prepare build environment
22
runs:
33
using: composite
44
steps:
5-
- name: Cleanup Xcode installations
6-
run: sudo mv /Applications/Xcode_26.0.app /Applications/tmp_Xcode_26.0.app ; sudo rm -rf /Applications/Xcode* ; sudo mv /Applications/tmp_Xcode_26.0.app /Applications/Xcode_26.0.app
7-
shell: bash
8-
- name: Select Xcode version
9-
run: sudo xcode-select --switch /Applications/Xcode_26.0.app
5+
- name: Copy GitHub specific scripts to git-root folder
6+
run: cp -va ./.github/scripts/ ./ ; date +%s > ./epoch_job_start.txt
107
shell: bash
11-
- name: Cleanup Xcode Simulators
12-
run: sudo xcrun simctl delete all
8+
- name: Prepare Xcode
9+
run: ./github_prepare_xcode.sh
1310
shell: bash
1411
- name: Cleanup Android Related Stuff
1512
run: sudo rm -rf $ANDROID_HOME
1613
shell: bash
17-
- name: Copy GitHub specific scripts to git-root folder
18-
run: cp -va ./.github/scripts/ ./ ; date +%s > ./epoch_job_start.txt
19-
shell: bash
2014
- name: Disable Spotlight
2115
run: sudo mdutil -a -i off
2216
shell: bash
23-
- name: Run xcode-select
24-
run: sudo xcode-select --switch /Applications/Xcode_26.0.app
25-
shell: bash
2617
- name: Setup Environment and Toolchain
2718
run: ./github_setup_env_toolchain.sh ${{ inputs.arch }} | tee -a github_actions_setup_env_toolchain.log
2819
shell: bash
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash -eux
2+
3+
set -o pipefail
4+
5+
# Sometimes Xcode is 26.0, sometimes 26. We make sure it's usable no matter its name.
6+
BASE_XCODE_PATH=/Applications/Xcode_26.0.app
7+
TARGET_XCODE_PATH=/Applications/Xcode_26.app
8+
9+
if [ ! -e "$BASE_XCODE_PATH" ] && [ ! -e "$TARGET_XCODE_PATH" ]; then
10+
echo "Failed to find a suitable version of Xcode"
11+
exit 1
12+
fi
13+
14+
if [ -e "$BASE_XCODE_PATH" ] && [ ! -e "$TARGET_XCODE_PATH" ]; then
15+
sudo mv "$BASE_XCODE_PATH" "$TARGET_XCODE_PATH"
16+
fi
17+
18+
# Cleanup any other Xcode versions
19+
sudo mv "$TARGET_XCODE_PATH" /Applications/tmp_Xcode_26.app
20+
sudo rm -rf /Applications/Xcode*
21+
sudo mv /Applications/tmp_Xcode_26.app "$TARGET_XCODE_PATH"
22+
23+
ls -la /Applications/
24+
25+
# Switch to target Xcode and clean simulators
26+
sudo xcode-select --switch "$TARGET_XCODE_PATH"
27+
sudo xcode-select --install || true
28+
sudo xcrun simctl delete all

.github/scripts/sanity-check.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
set -exo pipefail
33

44
sudo mdutil -a -i off
5-
sudo xcode-select --switch /Applications/Xcode_26.0.app
65

76
brew install ninja coreutils [email protected] quilt llvm@20 --overwrite
87
brew unlink python || true

.github/workflows/sanity.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ jobs:
1212
- uses: actions/checkout@v4
1313
with:
1414
submodules: true
15-
- name: Copy GitHub specific scripts to git-root folder
16-
run: cp -va ./.github/scripts/ ./
15+
- uses: ./.github/actions/prepare-environment
1716
- name: Run sanity check
1817
run: ./sanity-check.sh
1918
substitution:
@@ -22,7 +21,6 @@ jobs:
2221
- uses: actions/checkout@v4
2322
with:
2423
submodules: true
25-
- name: Copy GitHub specific scripts to git-root folder
26-
run: cp -va ./.github/scripts/ ./
24+
- uses: ./.github/actions/prepare-environment
2725
- name: Run substitution check
2826
run: ./sanity-check.sh sub

0 commit comments

Comments
 (0)