diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index 0d37793fd3..b8d048d805 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -46,7 +46,7 @@ jobs: - run: sh -x build.sh verify-osx osx-16: - runs-on: macos-14 + runs-on: macos-15 name: Test osx on Xcode 16 env: DEVELOPER_DIR: '/Applications/Xcode_16.app/Contents/Developer' @@ -55,7 +55,7 @@ jobs: - run: sh -x build.sh verify-osx osx-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test osx on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -64,7 +64,7 @@ jobs: - run: sh -x build.sh verify-osx osx-encryption-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test osx-encryption on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -82,7 +82,7 @@ jobs: - run: sh -x build.sh verify-swiftpm swiftpm-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test swiftpm on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -109,7 +109,7 @@ jobs: - run: sh -x build.sh verify-swiftpm-debug swiftpm-debug-16: - runs-on: macos-14 + runs-on: macos-15 name: Test swiftpm-debug on Xcode 16 env: DEVELOPER_DIR: '/Applications/Xcode_16.app/Contents/Developer' @@ -118,7 +118,7 @@ jobs: - run: sh -x build.sh verify-swiftpm-debug swiftpm-debug-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test swiftpm-debug on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -127,7 +127,7 @@ jobs: - run: sh -x build.sh verify-swiftpm-debug swiftpm-address-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test swiftpm-address on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -136,7 +136,7 @@ jobs: - run: sh -x build.sh verify-swiftpm-address swiftpm-thread-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test swiftpm-thread on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -154,7 +154,7 @@ jobs: - run: sh -x build.sh verify-ios-static ios-static-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test ios-static on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -172,7 +172,7 @@ jobs: - run: sh -x build.sh verify-ios ios-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test ios on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -190,7 +190,7 @@ jobs: - run: sh -x build.sh verify-watchos watchos-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test watchos on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -208,7 +208,7 @@ jobs: - run: sh -x build.sh verify-tvos tvos-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test tvos on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -226,7 +226,7 @@ jobs: - run: sh -x build.sh verify-visionos visionos-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test visionos on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -253,7 +253,7 @@ jobs: - run: sh -x build.sh verify-osx-swift osx-swift-16: - runs-on: macos-14 + runs-on: macos-15 name: Test osx-swift on Xcode 16 env: DEVELOPER_DIR: '/Applications/Xcode_16.app/Contents/Developer' @@ -262,7 +262,7 @@ jobs: - run: sh -x build.sh verify-osx-swift osx-swift-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test osx-swift on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -280,7 +280,7 @@ jobs: - run: sh -x build.sh verify-ios-swift ios-swift-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test ios-swift on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -298,7 +298,7 @@ jobs: - run: sh -x build.sh verify-tvos-swift tvos-swift-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test tvos-swift on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -307,7 +307,7 @@ jobs: - run: sh -x build.sh verify-tvos-swift osx-swift-evolution-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test osx-swift-evolution on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -316,7 +316,7 @@ jobs: - run: sh -x build.sh verify-osx-swift-evolution ios-swift-evolution-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test ios-swift-evolution on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -325,7 +325,7 @@ jobs: - run: sh -x build.sh verify-ios-swift-evolution tvos-swift-evolution-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test tvos-swift-evolution on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -343,7 +343,7 @@ jobs: - run: sh -x build.sh verify-catalyst catalyst-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test catalyst on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -361,7 +361,7 @@ jobs: - run: sh -x build.sh verify-catalyst-swift catalyst-swift-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test catalyst-swift on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -370,7 +370,7 @@ jobs: - run: sh -x build.sh verify-catalyst-swift xcframework-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test xcframework on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -397,7 +397,7 @@ jobs: - run: sh -x build.sh verify-cocoapods-osx cocoapods-osx-16: - runs-on: macos-14 + runs-on: macos-15 name: Test cocoapods-osx on Xcode 16 env: DEVELOPER_DIR: '/Applications/Xcode_16.app/Contents/Developer' @@ -406,7 +406,7 @@ jobs: - run: sh -x build.sh verify-cocoapods-osx cocoapods-osx-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test cocoapods-osx on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -415,7 +415,7 @@ jobs: - run: sh -x build.sh verify-cocoapods-osx cocoapods-ios-static-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test cocoapods-ios-static on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -424,7 +424,7 @@ jobs: - run: sh -x build.sh verify-cocoapods-ios-static cocoapods-ios-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test cocoapods-ios on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -433,7 +433,7 @@ jobs: - run: sh -x build.sh verify-cocoapods-ios cocoapods-watchos-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test cocoapods-watchos on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -442,7 +442,7 @@ jobs: - run: sh -x build.sh verify-cocoapods-watchos cocoapods-tvos-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test cocoapods-tvos on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -451,7 +451,7 @@ jobs: - run: sh -x build.sh verify-cocoapods-tvos cocoapods-catalyst-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test cocoapods-catalyst on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -460,7 +460,7 @@ jobs: - run: sh -x build.sh verify-cocoapods-catalyst ios-swiftui-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test ios-swiftui on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' diff --git a/.github/workflows/master-push.yml b/.github/workflows/master-push.yml index 1f4a666c78..fdbcd61797 100644 --- a/.github/workflows/master-push.yml +++ b/.github/workflows/master-push.yml @@ -8,8 +8,8 @@ on: env: XCODE_VERSION: "['15.3', '15.4', '16', '16.1_beta_2']" PLATFORM: "['ios', 'osx', 'watchos', 'tvos', 'catalyst', 'visionos']" - DOC_VERSION: '15.4' RELEASE_VERSION: '15.4' + DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer jobs: prepare: runs-on: ubuntu-latest @@ -38,8 +38,6 @@ jobs: - uses: ruby/setup-ruby@v1 with: bundler-cache: true - - name: Select Xcode Version - run: sudo xcode-select -switch /Applications/Xcode_${{ env.DOC_VERSION }}.app - name: Prepare docs for packaging run: bundle exec sh -x build.sh release-package-docs - name: Upload docs to artifacts library @@ -61,15 +59,23 @@ jobs: name: realm-examples path: realm-examples.zip build-product: # Creates framework for each platform, xcode version, target and configuration - runs-on: macos-14 name: Package framework needs: prepare strategy: - max-parallel: 20 # Blocks of 20, therefore if any of the build fails, we don't get a lot of XCode Clouds builds hanging, which are expensive. + max-parallel: 20 matrix: platform: ${{ fromJSON(needs.prepare.outputs.PLATFORM_MATRIX) }} xcode-version: ${{ fromJSON(needs.prepare.outputs.XCODE_VERSIONS_MATRIX) }} configuration: [swift, static] + include: + - xcode-version: 15.3 + os: macos-14 + - xcode-version: 15.4 + os: macos-14 + - xcode-version: 16 + os: macos-15 + - xcode-version: 16.1_beta_2 + os: macos-15 exclude: - platform: osx configuration: static @@ -81,79 +87,38 @@ jobs: configuration: static - platform: catalyst configuration: static - - platform: visionos - xcode-version: 15.1 + runs-on: ${{ matrix.os }} + env: + DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode-version }}.app/Contents/Developer steps: - uses: actions/checkout@v4 + - name: Download visionOS + if: matrix.platform == 'visionos' && matrix.os == 'macos-14' + run: xcodebuild -downloadPlatform visionOS - name: Build ${{ matrix.platform }} with Xcode ${{ matrix.xcode-version }} - run: DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode-version }}.app/Contents/Developer sh build.sh ${{ matrix.platform }}-${{matrix.configuration}} + run: sh build.sh ${{ matrix.platform }}-${{matrix.configuration}} - run: rm -r build/DerivedData - name: Upload framework - uses: actions/upload-artifact@v4 + uses: eXhumer/upload-artifact@0b7d5f5684d3f642f978d2faad9ade64f5b4dd57 with: name: build-${{ matrix.platform }}-${{ matrix.xcode-version }}-${{ matrix.configuration }} path: build compression-level: 1 - package-xcframework-platform: # Creates xcframework for each platform and xcode version - runs-on: macos-14 - name: Package xcframework for platform - needs: [build-product, prepare] - strategy: - matrix: - platform: ${{ fromJSON(needs.prepare.outputs.PLATFORM_MATRIX) }} - xcode-version: ${{ fromJSON(needs.prepare.outputs.XCODE_VERSIONS_MATRIX) }} - exclude: - - platform: visionos - xcode-version: 15.1 - steps: - - uses: actions/checkout@v4 - - name: Select Xcode Version - run: sudo xcode-select -switch /Applications/Xcode_${{ env.RELEASE_VERSION }}.app - - name: Install the Apple certificate and provisioning profile - env: - DEVELOPMENT_CERTIFICATE_BASE64: ${{ secrets.DEVELOPMENT_CERTIFICATE_BASE64 }} - P12_PASSWORD: ${{ secrets.P12_PASSWORD }} - KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} - run: | - sh -x build.sh install-apple-certificates - - name: Restore frameworks - uses: actions/download-artifact@v4 - with: - pattern: build-${{ matrix.platform }}*-${{ matrix.xcode-version }}-* - - name: Create xcframework - env: - SIGNING_IDENTITY: ${{ secrets.SIGNING_IDENTITY }} - run: | - sh -x build.sh release-create-xcframework-${{ matrix.xcode-version }} ${{ matrix.platform }} - - name: Upload xcframework - uses: actions/upload-artifact@v4 - with: - name: realm-${{ matrix.platform }}-${{ matrix.xcode-version }} - path: realm-${{ matrix.platform }}-${{ matrix.xcode-version }}.zip - package-release: # Creates xcframework for each platform and xcode version + follow-symlinks: false + package-release: runs-on: macos-14 name: Package release file - needs: [package-xcframework-platform, prepare] + needs: [build-product, prepare] steps: - uses: actions/checkout@v4 - - name: Select Xcode Version - run: sudo xcode-select -switch /Applications/Xcode_${{ env.RELEASE_VERSION }}.app - - name: Install the Apple certificate and provisioning profile - env: - DEVELOPMENT_CERTIFICATE_BASE64: ${{ secrets.DEVELOPMENT_CERTIFICATE_BASE64 }} - P12_PASSWORD: ${{ secrets.P12_PASSWORD }} - KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} - run: | - sh -x build.sh install-apple-certificates - name: Restore packages xcframeworks uses: actions/download-artifact@v4 with: - pattern: realm-* + pattern: build-* - name: Create release env: SIGNING_IDENTITY: ${{ secrets.SIGNING_IDENTITY }} - run: | - sh -x build.sh release-package + run: sh -x build.sh release-package - name: Upload release artifactss uses: actions/upload-artifact@v4 with: @@ -170,8 +135,6 @@ jobs: needs: [package-release, prepare] steps: - uses: actions/checkout@v4 - - name: Select Xcode Version - run: sudo xcode-select -switch /Applications/Xcode_${{ env.RELEASE_VERSION }}.app - name: Restore release uses: actions/download-artifact@v4 with: @@ -184,8 +147,6 @@ jobs: needs: package-release steps: - uses: actions/checkout@v4 - - name: Select Xcode Version - run: sudo xcode-select -switch /Applications/Xcode_${{ env.RELEASE_VERSION }}.app - name: Test ios static run: sh -x build.sh test-ios-static test-osx-static: @@ -194,8 +155,6 @@ jobs: needs: package-release steps: - uses: actions/checkout@v4 - - name: Select Xcode Version - run: sudo xcode-select -switch /Applications/Xcode_${{ env.RELEASE_VERSION }}.app - name: Test osx static run: | export REALM_DISABLE_METADATA_ENCRYPTION=1 @@ -226,8 +185,9 @@ jobs: - uses: ruby/setup-ruby@v1 with: bundler-cache: true - - name: Select Xcode Version - run: sudo xcode-select -switch /Applications/Xcode_${{ env.RELEASE_VERSION }}.app + - name: Download visionOS + if: matrix.platform == 'visionos' && matrix.os == 'macos-14' + run: xcodebuild -downloadPlatform visionOS - name: Restore release uses: actions/download-artifact@v4 if: ${{ matrix.installation == 'xcframework' }} @@ -244,21 +204,29 @@ jobs: cd examples/installation bundle exec ./build.rb ${{ matrix.platform }} ${{ matrix.installation }} ${{ matrix.linkage }} test-installation-xcframework: - runs-on: macos-14 name: Run installation test for xcframework needs: [package-release, prepare] - env: - PLATFORM: 'osx' strategy: matrix: xcode-version: ${{ fromJSON(needs.prepare.outputs.XCODE_VERSIONS_MATRIX) }} + include: + - xcode-version: 15.3 + os: macos-14 + - xcode-version: 15.4 + os: macos-14 + - xcode-version: 16 + os: macos-15 + - xcode-version: 16.1_beta_2 + os: macos-15 + env: + PLATFORM: 'osx' + DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode-version }}.app/Contents/Developer + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: bundler-cache: true - - name: Select Xcode Version - run: sudo xcode-select -switch /Applications/Xcode_${{ matrix.xcode-version }}.app - name: Restore release uses: actions/download-artifact@v4 with: diff --git a/build.sh b/build.sh index d4e32654d1..bbf18c124f 100755 --- a/build.sh +++ b/build.sh @@ -200,89 +200,12 @@ build_combined() { -framework "$os_path" "${simulator_framework[@]}" } -# To be used with Github actions runner -build_platform() { - local product="$1" - local platform="$2" - local config="$CONFIGURATION" - - local destination build_args config_suffix - case "$platform" in - osx) - config_suffix= - destination='generic/platform=macOS' - ;; - ios) - config_suffix=-iphoneos - destination='generic/platform=iOS' - ;; - watchos) - config_suffix=-watchos - destination='generic/platform=watchOS' - ;; - tvos) - config_suffix=-appletvos - destination='generic/platform=tvOS' - ;; - visionos) - config_suffix=-xros - destination='generic/platform=visionOS' - ;; - catalyst) - config_suffix=-maccatalyst - destination='generic/platform=macOS,variant=Mac Catalyst' - ;; - osx) - destination='generic/platform=macOS' - ;; - iossimulator) - config_suffix=-iphonesimulator - destination='generic/platform=iOS' - ;; - watchossimulator) - config_suffix=-watchsimulator - destination='generic/platform=watchOS' - ;; - tvossimulator) - config_suffix=-appletvsimulator - destination='generic/platform=tvOS' - ;; - visionossimulator) - config_suffix=-xrsimulator - destination='generic/platform=visionOS' - ;; - esac - - build_products_path="$DERIVED_DATA/Realm/Build/Products" - build_path="$build_products_path/$config${config_suffix}" - - build_args=(-scheme "$product" -configuration "$config" build REALM_HIDE_SYMBOLS=YES) - - if [[ "$platform" = *"simulator" ]]; then - xc -destination "$destination Simulator" "${build_args[@]}" - else - xc -destination "$destination" "${build_args[@]}" - fi - - # This is only for test, and simulates how it is packaged by XCode Cloud - number="$((10000 + $RANDOM % 99999))" - folder_name="RealmSwift Build $number Build Products for $product on iOS" - dir="$folder_name/$config${config_suffix}" - mkdir -p "$dir" - cp -a "$build_path/." "$dir" - - config_name="$(tr [A-Z] [a-z] <<< "$config")" - zip -r product.zip "$dir" - rm -rf "$folder_name" -} - create_xcframework() { local product="$1" local config="$2" - local platform="$3" - local out_path="$ROOT_WORKSPACE/$config/$platform/$product.xcframework" - find "$ROOT_WORKSPACE" -path "*/$config*/$product.framework" \ + local out_path="$ROOT_WORKSPACE/$config/$product.xcframework" + find "$ROOT_WORKSPACE"/build-*/"$config" -name "$product.framework" \ | sed 's/.*/-framework &/' \ | xargs xcodebuild -create-xcframework -allow-internal-distribution -output "$out_path" codesign --timestamp -s "$SIGNING_IDENTITY" "$out_path" @@ -310,6 +233,14 @@ plist_get() { /usr/libexec/PlistBuddy -c "Print :$2" "$1" 2> /dev/null } +iphone_name() { + if (( $(xcode_version_major) < 16 )); then + echo 'iPhone 14' + else + echo 'iPhone 16' + fi +} + ###################################### # Device Test Helper ###################################### @@ -519,11 +450,7 @@ case "$COMMAND" in "xcframework") # Build all of the requested frameworks shift - if (( $(xcode_version_major) < 15 )); then - PLATFORMS="${*:-osx ios watchos tvos catalyst}" - else - PLATFORMS="${*:-osx ios watchos tvos catalyst visionos}" - fi + PLATFORMS="${*:-osx ios watchos tvos catalyst visionos}" for platform in $PLATFORMS; do sh build.sh "$platform-swift" done @@ -591,12 +518,12 @@ case "$COMMAND" in ;; "test-ios") - xctest Realm -configuration "$CONFIGURATION" -sdk iphonesimulator -destination 'name=iPhone 14' + xctest Realm -configuration "$CONFIGURATION" -sdk iphonesimulator -destination "name=$(iphone_name)" exit 0 ;; "test-ios-swift") - xctest RealmSwift -configuration "$CONFIGURATION" -sdk iphonesimulator -destination 'name=iPhone 14' + xctest RealmSwift -configuration "$CONFIGURATION" -sdk iphonesimulator -destination "name=$(iphone_name)" exit 0 ;; @@ -665,7 +592,7 @@ case "$COMMAND" in ;; "test-ios-swiftui") - xctest 'SwiftUITestHost' -configuration "$CONFIGURATION" -sdk iphonesimulator -destination 'name=iPhone 14' + xctest 'SwiftUITestHost' -configuration "$CONFIGURATION" -sdk iphonesimulator -destination "name=$(iphone_name)" exit 0 ;; @@ -1062,6 +989,10 @@ case "$COMMAND" in export sha="$BRANCH" export REALM_EXTRA_BUILD_ARGUMENTS='GCC_GENERATE_DEBUGGING_SYMBOLS=NO -allowProvisioningUpdates' target=$(echo "$CI_WORKFLOW" | cut -f1 -d_) + if [[ "$target" == visionos ]] && (( $(xcode_version_major) < 16 )); then + echo 'Installing visionOS' + xcodebuild -downloadPlatform visionOS + fi sh build.sh "verify-$target" ;; @@ -1079,25 +1010,6 @@ case "$COMMAND" in zip -r docs/realm-docs.zip docs/objc_output docs/swift_output ;; - release-create-xcframework-*) - platform="$2" - xcode_version=$(echo "$COMMAND" | cut -d- -f4) - - find . -name 'build-*.zip' -exec unzip {} \; - - create_xcframework Realm Release "$platform" - create_xcframework RealmSwift Release "$platform" - - if [ "$platform" = "ios" ]; then - create_xcframework Realm Static "$platform" - else - mkdir -p "Static/$platform" - fi - - zip --symlinks -r "realm-$platform-$xcode_version.zip" "Release/$platform" "Static/$platform" - exit 0 - ;; - "release-package") version="$(sed -n 's/^VERSION=\(.*\)$/\1/p' "${source_root}/dependencies.list")" find . -name 'realm-*-1*' -maxdepth 1 \ @@ -1152,90 +1064,6 @@ case "$COMMAND" in # Release tests ###################################### - # Should select xcode version `xcode-select` first. - # Pass xcode version as argument - # This simulates what is done in XCode Cloud - "test-create-frameworks") - xcode_version="$2" - targets="Realm RealmSwift" - - platforms=("ios" "iossimulator" "osx" "tvos" "tvossimulator" "watchos" "watchossimulator" "catalyst") - if [ "$xcode_version" == "15.2" ]; then - platforms+=("visionos" "visionossimulator") - fi - - for platform in "${platforms[@]}"; do - for target in $targets; do - echo "Building $platform and $target release" - ./build.sh "release-package-$platform-$xcode_version-$target-release" - ./build.sh "release-build_$platform-$xcode_version-$target-release" - - # Only generates Realm framework for Static configuration and ios platform - if [[ "$platform" == "ios" || "$platform" == "iossimulator" ]] && [[ "$target" == "Realm" ]]; then - echo "Building $platform and $target static" - ./build.sh "release-package-$platform-$xcode_version-$target-static" - ./build.sh "release-package-build_$platform-$xcode_version-$target-static" - fi - done - done - ;; - - "test-build-product-workflow-xcode-cloud") - issuer_id="" - key_id="" - pk_path="" - - token=$(ruby ./scripts/xcode_cloud_helper.rb --issuer-id $issuer_id --key-id $key_id --pk-path $pk_path get-token) - echo "Authentication token -> $token" - - # Test parameters - platform="ios" - target="RealmSwift" - xcode_version="15.2" - configuration="release" - - workflow_id=$(ruby ./scripts/xcode_cloud_helper.rb create-workflow release-package-build $platform $xcode_version $target $configuration -t $token) - echo "Created workflow -> $workflow_id" - build_run_id=$(ruby ./scripts/xcode_cloud_helper.rb build-workflow $workflow_id dp/new_migration_branch -t $token) - echo "Build Run -> $build_run_id" - while [ "$status" != 'COMPLETE' ] - do - token=$(ruby ./scripts/xcode_cloud_helper.rb --issuer-id $issuer_id --key-id $key_id --pk-path $pk_path get-token) - status=$(ruby ./scripts/xcode_cloud_helper.rb get-build-status $build_run_id -t $token) - echo "Status $status" | ts - sleep 20 - done - completion_status=$(ruby ./scripts/xcode_cloud_helper.rb get-build-result $build_run_id -t $token) - echo "Completion Status $completion_status" | ts - if [ "$completion_status" != 'SUCCEEDED' ]; then - echo "XCode build failed" - ruby ./scripts/xcode_cloud_helper.rb print-build-logs $build_run_id -t $token - exit 1 - fi - - ruby ./scripts/xcode_cloud_helper.rb print-build-logs $build_run_id -t $token - ruby ./scripts/xcode_cloud_helper.rb download-artifact $build_run_id -t $token - ruby ./scripts/xcode_cloud_helper.rb delete-workflow $workflow_id -t $token - ;; - - # Pass xcode version as argument - # For this to work, product builds should be located in the root of the project - "test-create-platform-xcframeworks") - xcode_version="$2" - - platforms=("ios" "osx" "tvos" "watchos" "catalyst") - if [ "$xcode_version" == "15.1" ]; then - platforms+=("visionos") - fi - - for platform in "${platforms[@]}"; do - ./build.sh release-create-xcframework_$xcode_version $platform - - rm -rf "$ROOT_WORKSPACE/Release" - rm -rf "$ROOT_WORKSPACE/Static" - done - ;; - "test-package-examples") VERSION="$(sed -n 's/^VERSION=\(.*\)$/\1/p' "${source_root}/dependencies.list")" dir="realm-swift-${VERSION}" @@ -1261,22 +1089,6 @@ case "$COMMAND" in sh build.sh examples-tvos-swift ;; - # This is used for test or if we want to use Github Actions to build each framework - release-package-build_*) - filename="Configuration/Release.xcconfig" - sed -i '' "s/REALM_HIDE_SYMBOLS = NO;/REALM_HIDE_SYMBOLS = YES;/" "$filename" - - # Remove the identifier of the command, so we can obtain the parameters from the command - build_command=${COMMAND#"release-package-build_"} - parameters=(${build_command//-/ }) - - platform=${parameters[0]} - target=${parameters[1]} - - build_platform "$target" "$platform" - exit 0 - ;; - ###################################### # Publish ###################################### diff --git a/scripts/create-release-package.rb b/scripts/create-release-package.rb index 57307c2a70..72a6b3db85 100755 --- a/scripts/create-release-package.rb +++ b/scripts/create-release-package.rb @@ -58,7 +58,7 @@ def zip(name, *files) FileUtils.mkdir_p "#{tmp}/#{version}" Dir.chdir("#{tmp}/#{version}") do for platform in platforms(version) - sh 'unzip', "#{ROOT}/realm-#{platform}-#{version}/realm-#{platform}-#{version}.zip" + sh 'unzip', "#{ROOT}/build-#{platform}-#{version}.zip" end end end diff --git a/scripts/pr-ci-matrix.rb b/scripts/pr-ci-matrix.rb index 491c4360dc..c3c42c5bbb 100755 --- a/scripts/pr-ci-matrix.rb +++ b/scripts/pr-ci-matrix.rb @@ -82,9 +82,10 @@ def minimum_version(major) if not filter.call(version) next end - output_file << """ + image = version.start_with?('16') ? 'macos-15' : 'macos-14' + output_file << """ #{name}-#{version.gsub(' ', '_').gsub('.', '_')}: - runs-on: macos-14 + runs-on: #{image} name: Test #{name} on Xcode #{version} env: DEVELOPER_DIR: '/Applications/Xcode_#{version}.app/Contents/Developer'