Skip to content

Commit

Permalink
build: download visionOS SDK if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
YoloMao committed Sep 30, 2024
1 parent 5ae45bc commit d3cdda6
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 14 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/cocoapods.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ jobs:
runs-on: macos-latest

steps:
# https://github.com/actions/runner-images/issues/10559
- name: Download visionOS SDK
run: |
sudo xcodebuild -runFirstLaunch
sudo xcrun simctl list
sudo xcodebuild -downloadPlatform visionOS
sudo xcodebuild -runFirstLaunch
- uses: actions/checkout@v4

- name: Deploy to Cocoapods
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/cocoapods_beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ jobs:

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# https://github.com/actions/runner-images/issues/10559
- name: Download visionOS SDK
run: |
sudo xcodebuild -runFirstLaunch
sudo xcrun simctl list
sudo xcodebuild -downloadPlatform visionOS
sudo xcodebuild -runFirstLaunch
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/cocoapods_beta_manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ jobs:
if: ${{ github.ref != 'refs/heads/master' }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# https://github.com/actions/runner-images/issues/10559
- name: Download visionOS SDK
run: |
sudo xcodebuild -runFirstLaunch
sudo xcrun simctl list
sudo xcodebuild -downloadPlatform visionOS
sudo xcodebuild -runFirstLaunch
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/draft_release_with_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ jobs:
echo "Not running on master branch"
exit 1
fi
# https://github.com/actions/runner-images/issues/10559
- name: Download visionOS SDK
run: |
sudo xcodebuild -runFirstLaunch
sudo xcrun simctl list
sudo xcodebuild -downloadPlatform visionOS
sudo xcodebuild -runFirstLaunch
- name: Checkout
uses: actions/checkout@v4
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/draft_release_without_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ jobs:
exit 1
fi
# https://github.com/actions/runner-images/issues/10559
- name: Download visionOS SDK
run: |
sudo xcodebuild -runFirstLaunch
sudo xcrun simctl list
sudo xcodebuild -downloadPlatform visionOS
sudo xcodebuild -runFirstLaunch
- name: Checkout
uses: actions/checkout@v4
with:
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/spm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ jobs:
scheme: GrowingTracker
runs-on: ${{ matrix.os }}
steps:
# https://github.com/actions/runner-images/issues/10559
- name: Download visionOS SDK
if: ${{ matrix.os == 'macos-14' }}
run: |
sudo xcodebuild -runFirstLaunch
sudo xcrun simctl list
sudo xcodebuild -downloadPlatform visionOS
sudo xcodebuild -runFirstLaunch
- name: Checkout Repo
uses: actions/checkout@v4
- name: Xcode
Expand Down
30 changes: 16 additions & 14 deletions scripts/generate_xcframework.sh
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ generateProjects() {
prepareGenerateOnlyTrackerProjects
generateProjectByPlatform "macOS"
generateProjectByPlatform "watchOS"
# generateProjectByPlatform "visionOS"
generateProjectByPlatform "visionOS"

logger -v "step: reset podspec"
mv "${MAIN_FRAMEWORK_NAME}-backup.podspec" "${MAIN_FRAMEWORK_NAME}.podspec"
Expand All @@ -228,8 +228,8 @@ generate_xcframework() {
tv_simulator_archive_path="${archive_path}/tvsimulator"
watch_os_archive_path="${archive_path}/watchos"
watch_simulator_archive_path="${archive_path}/watchsimulator"
# vision_os_archive_path="${archive_path}/visionos"
# vision_simulator_archive_path="${archive_path}/visionsimulator"
vision_os_archive_path="${archive_path}/visionos"
vision_simulator_archive_path="${archive_path}/visionsimulator"
output_path="./${FOLDER_NAME}/Release/${framework_name//-/_}.xcframework"
common_args="archive -workspace ./${PROJECT_PATH_PREFIX}/iOS/${MAIN_FRAMEWORK_NAME}/${MAIN_FRAMEWORK_NAME}.xcworkspace \
-scheme ${framework_name} -configuration 'Release' -derivedDataPath ./${FOLDER_NAME}/derivedData"
Expand Down Expand Up @@ -287,23 +287,23 @@ generate_xcframework() {
-destination "generic/platform=watchOS Simulator" \
-archivePath ${watch_simulator_archive_path} || exit 1

# logger -v "step: generate ${framework_name} xros-arm64 framework(Only Tracker)"
# common_args_for_vision_os=$(echo "$common_args" | sed 's/iOS/visionOS/g')
# xcodebuild ${common_args_for_vision_os} \
# -destination "generic/platform=visionOS" \
# -archivePath ${vision_os_archive_path} || exit 1
logger -v "step: generate ${framework_name} xros-arm64 framework(Only Tracker)"
common_args_for_vision_os=$(echo "$common_args" | sed 's/iOS/visionOS/g')
xcodebuild ${common_args_for_vision_os} \
-destination "generic/platform=visionOS" \
-archivePath ${vision_os_archive_path} || exit 1

# logger -v "step: generate ${framework_name} xros-arm64_x86_64-simulator framework(Only Tracker)"
# common_args_for_vision_simulator=$(echo "$common_args" | sed 's/iOS/visionOS/g')
# xcodebuild ${common_args_for_vision_simulator} \
# -destination "generic/platform=visionOS Simulator" \
# -archivePath ${vision_simulator_archive_path} || exit 1
logger -v "step: generate ${framework_name} xros-arm64_x86_64-simulator framework(Only Tracker)"
common_args_for_vision_simulator=$(echo "$common_args" | sed 's/iOS/visionOS/g')
xcodebuild ${common_args_for_vision_simulator} \
-destination "generic/platform=visionOS Simulator" \
-archivePath ${vision_simulator_archive_path} || exit 1

logger -v "step: delete _CodeSignature folder in simulator framework which is unnecessary"
rm -rf ${iphone_simulator_archive_path}${framework_path_suffix}/_CodeSignature
rm -rf ${tv_simulator_archive_path}${framework_path_suffix}/_CodeSignature
rm -rf ${watch_simulator_archive_path}${framework_path_suffix}/_CodeSignature
# rm -rf ${vision_simulator_archive_path}${framework_path_suffix}/_CodeSignature
rm -rf ${vision_simulator_archive_path}${framework_path_suffix}/_CodeSignature

xcodebuild -create-xcframework \
-framework ${iphone_os_archive_path}${framework_path_suffix} \
Expand All @@ -314,6 +314,8 @@ generate_xcframework() {
-framework ${tv_simulator_archive_path}${framework_path_suffix} \
-framework ${watch_os_archive_path}${framework_path_suffix} \
-framework ${watch_simulator_archive_path}${framework_path_suffix} \
-framework ${vision_os_archive_path}${framework_path_suffix} \
-framework ${vision_simulator_archive_path}${framework_path_suffix} \
-output ${output_path} || exit 1
else
logger -v "step: delete _CodeSignature folder in simulator framework which is unnecessary"
Expand Down

0 comments on commit d3cdda6

Please sign in to comment.