Check Xcode Cloud/GitHub Action Xcode versions

This commit is contained in:
Max Radermacher
2024-11-06 18:57:45 -06:00
committed by GitHub
parent 918efa003c
commit ca202f73e7
4 changed files with 36 additions and 0 deletions

View File

@@ -37,7 +37,13 @@ jobs:
- name: Set Xcode version
run: |
echo DEVELOPER_DIR=/Applications/${{matrix.xcode}}.app >> "$GITHUB_ENV"
- uses: actions/checkout@v4
- name: Check Xcode version
run: |
Scripts/check_xcode_version.py
- uses: ./.github/actions/clone-everything
with:
access-token: ${{ secrets.ACCESS_TOKEN }}

1
.xcode-version Normal file
View File

@@ -0,0 +1 @@
Xcode 16.1

28
Scripts/check_xcode_version.py Executable file
View File

@@ -0,0 +1,28 @@
#!/usr/bin/env python3
import subprocess
def get_actual_version():
return subprocess.run(
["xcodebuild", "-version"], check=True, capture_output=True, encoding="utf8"
).stdout.split("\n")[0]
def get_expected_version():
with open(".xcode-version", "r") as file:
return file.read().rstrip()
def main():
actual_version = get_actual_version()
expected_version = get_expected_version()
if actual_version != expected_version:
print(
f"Youre using {actual_version} but you should be using {expected_version}."
)
exit(1)
if __name__ == "__main__":
main()

View File

@@ -5,4 +5,5 @@ set -eux
./send_build_notification.py started || :
cd ..
Scripts/check_xcode_version.py
make dependencies