From c02a44e4b71159bed9eb43a654502f52cedc1e26 Mon Sep 17 00:00:00 2001 From: Alex Babrykovich Date: Tue, 2 Jul 2024 11:55:28 +0200 Subject: [PATCH] chore: upgrade deployment target to 12.0 according Xcode 15 (#141) --- .github/workflows/workflow.yml | 115 ++++++++++++++++++--- Example/HCaptcha.xcodeproj/project.pbxproj | 20 ++-- Example/Podfile | 4 +- Example/Podfile.lock | 4 +- HCaptcha.podspec | 2 +- README.md | 8 +- fastlane/Fastfile | 39 ++++--- 7 files changed, 143 insertions(+), 49 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 745f8e5..3da9673 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -18,13 +18,13 @@ concurrency: cancel-in-progress: true env: - XCODE_VERSION: '14.3.1' - RUBY_VERSION: '3.3.1' + XCODE_VERSION: '15.1' + RUBY_VERSION: '3.1' jobs: - sdk: + test: name: Test SDK - runs-on: macOS-latest + runs-on: macos-latest steps: - uses: actions/checkout@v4 @@ -39,24 +39,100 @@ jobs: restore-keys: | ${{ runner.os }}-carthage-v2 - - run: brew upgrade carthage - - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true - run: | - bundle exec fastlane ci - cp .lint/cocoapods-size/result.json cocoapods-size-result.json + bundle exec fastlane test timeout-minutes: 15 + - if: github.event_name == 'push' + run: | + bundle exec fastlane pod_size + cp .lint/cocoapods-size/result.json cocoapods-size-result.json + - if: github.event_name == 'push' uses: actions/cache@v4 with: path: cocoapods-size-result.json key: cocoapods-size-${{ github.sha }} + sources-lint: + name: Lint Source files + needs: test + runs-on: macos-14 + steps: + - uses: actions/checkout@v4 + + - name: Use Xcode ${{ env.XCODE_VERSION }} + run: sudo xcode-select -switch /Applications/Xcode_${XCODE_VERSION}.app + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ env.RUBY_VERSION }} + bundler-cache: true + + - run: bundle exec fastlane swift_lint + + - run: bundle exec fastlane html_lint + + - run: bundle exec fastlane xcprivacy_lint + + pod-lint: + name: Lint Podspec + needs: test + runs-on: macos-14 + steps: + - uses: actions/checkout@v4 + + - name: Use Xcode ${{ env.XCODE_VERSION }} + run: sudo xcode-select -switch /Applications/Xcode_${XCODE_VERSION}.app + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ env.RUBY_VERSION }} + bundler-cache: true + + - run: bundle exec fastlane pod_lint + + carthage-build: + name: Carthage Build + needs: test + runs-on: macos-14 + steps: + - uses: actions/checkout@v4 + + - name: Use Xcode ${{ env.XCODE_VERSION }} + run: sudo xcode-select -switch /Applications/Xcode_${XCODE_VERSION}.app + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ env.RUBY_VERSION }} + bundler-cache: true + + - run: brew upgrade carthage + + - run: bundle exec fastlane carthage_build + + swift-package-build: + name: Swift Package Build + needs: test + runs-on: macos-14 + steps: + - uses: actions/checkout@v4 + + - name: Use Xcode ${{ env.XCODE_VERSION }} + run: sudo xcode-select -switch /Applications/Xcode_${XCODE_VERSION}.app + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ env.RUBY_VERSION }} + bundler-cache: true + + - run: bundle exec fastlane spm_build + size-report: name: Cocoapods size report if: github.event_name == 'pull_request' @@ -105,7 +181,7 @@ jobs: issue-number: ${{ github.event.pull_request.number }} body-includes: Cocoapods size report - - uses: peter-evans/create-or-update-comment@v3 + - uses: peter-evans/create-or-update-comment@v4 with: body: | Cocoapods size report: @@ -122,18 +198,18 @@ jobs: samples: name: Build Samples - needs: sdk - runs-on: macos-12 + needs: test + runs-on: macos-14 continue-on-error: ${{ matrix.experimental }} strategy: fail-fast: false matrix: - xcode: [ '13.1' ] + xcode: [ '15.1' ] experimental: [ false ] include: - - xcode: '13.4.1' - experimental: true - - xcode: '14.2' + - xcode: '15.2' + experimental: false + - xcode: '15.4' experimental: true steps: - uses: actions/checkout@v4 @@ -154,8 +230,13 @@ jobs: release: name: Release if: github.event_name == 'release' - needs: samples - runs-on: macOS-latest + needs: + - sources-lint + - pod-lint + - carthage-build + - swift-package-build + - samples + runs-on: macos-latest steps: - uses: actions/checkout@v4 diff --git a/Example/HCaptcha.xcodeproj/project.pbxproj b/Example/HCaptcha.xcodeproj/project.pbxproj index 6a0e39e..265f3a0 100644 --- a/Example/HCaptcha.xcodeproj/project.pbxproj +++ b/Example/HCaptcha.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -74,7 +74,7 @@ 607FACDA1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 607FACDC1AFB9204008FA782 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; - 62C1DD0E80E9920845E5DA51 /* HCaptcha.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = HCaptcha.podspec; path = ../HCaptcha.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 62C1DD0E80E9920845E5DA51 /* HCaptcha.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = HCaptcha.podspec; path = ../HCaptcha.podspec; sourceTree = ""; }; 7CAE52D12DDE8FC56C961E7D /* Pods-HCaptcha_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HCaptcha_Example.release.xcconfig"; path = "Target Support Files/Pods-HCaptcha_Example/Pods-HCaptcha_Example.release.xcconfig"; sourceTree = ""; }; 8352086EA5EE39AFD3CDA308 /* Pods_HCaptcha_Objc_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_HCaptcha_Objc_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8453AB7DC2F84E620BCFA704 /* Pods-HCaptcha_Objc_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HCaptcha_Objc_Example.release.xcconfig"; path = "Target Support Files/Pods-HCaptcha_Objc_Example/Pods-HCaptcha_Objc_Example.release.xcconfig"; sourceTree = ""; }; @@ -878,7 +878,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -927,7 +927,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; @@ -1082,7 +1082,7 @@ INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1123,7 +1123,7 @@ INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1153,7 +1153,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = HCaptcha_UITests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1181,7 +1181,7 @@ CODE_SIGN_STYLE = Automatic; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = HCaptcha_UITests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1206,7 +1206,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = HCaptcha_Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1230,7 +1230,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = HCaptcha_Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/Example/Podfile b/Example/Podfile index b109dd3..5148574 100644 --- a/Example/Podfile +++ b/Example/Podfile @@ -1,4 +1,4 @@ -platform :ios, 9.0 +platform :ios, 12.0 use_frameworks! inhibit_all_warnings! @@ -37,7 +37,7 @@ post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| - config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0' + config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0' end end end diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 1202898..b27f74a 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -37,13 +37,13 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: AppSwizzle: db36e436f56110d93e5ae0147683435df593cabc - HCaptcha: 0e52ee5303201606c66ce141444ca8c8083013d5 + HCaptcha: 86b9cf68e49e5dd74b1fdb99d7efa8353de7c521 RxBlocking: 0b29f7d2079109a8de49c411381bed7c33ef1eeb RxCocoa: 4baf94bb35f2c0ab31bc0cb9f1900155f646ba42 RxRelay: e72dbfd157807478401ef1982e1c61c945c94b2f RxSwift: d356ab7bee873611322f134c5f9ef379fa183d8f SwiftLint: 99f82d07b837b942dd563c668de129a03fc3fb52 -PODFILE CHECKSUM: 44657674683c7639f916ef6eb6fae5387395d652 +PODFILE CHECKSUM: 3162e929d9aa7ec9db00c1885dad26a9f8fe43de COCOAPODS: 1.15.1 diff --git a/HCaptcha.podspec b/HCaptcha.podspec index 1460be2..9ab24fa 100644 --- a/HCaptcha.podspec +++ b/HCaptcha.podspec @@ -17,7 +17,7 @@ invisibility is not possible. s.social_media_url = 'https://twitter.com/hCaptcha' s.documentation_url = 'https://github.com/hCaptcha/HCaptcha-ios-sdk' - s.ios.deployment_target = '9.0' + s.ios.deployment_target = '12.0' s.default_subspecs = 'Core' s.subspec 'Core' do |core| diff --git a/README.md b/README.md index 9344113..70e1f77 100644 --- a/README.md +++ b/README.md @@ -62,10 +62,10 @@ Standard SPM formula: uses [Package.swift](./Package.swift) ## Requirements -| Platform | Requirements | -|----------|---------------------------| -| iOS | :white_check_mark: >= 9.0 | -| WatchOS | :heavy_multiplication_x: | +| Platform | Requirements | +|----------|----------------------------| +| iOS | :white_check_mark: >= 12.0 | +| WatchOS | :heavy_multiplication_x: | ## Usage diff --git a/fastlane/Fastfile b/fastlane/Fastfile index cc6122f..e476f3c 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -18,7 +18,7 @@ platform :ios do html_lint xcprivacy_lint pod_lint - carthage_lint + carthage_build spm_build pod_size end @@ -30,12 +30,6 @@ platform :ios do try_repo_update_on_error: true, ) - swiftlint( - executable: "Example/Pods/Swiftlint/swiftlint", - strict: true, - reporter: "emoji", - ) - # The problem lies in the fact (or rather: serious bug in xcodebuild) that # the timeout for connecting to the XCTest server starts at the moment you # issue the command xcodebuild. The timeout is 120 seconds, so if your @@ -79,13 +73,23 @@ platform :ios do end end + desc "Swift Lint" + lane :swift_lint do + cocoapods(podfile: "Example/Podfile") + swiftlint( + executable: "Example/Pods/Swiftlint/swiftlint", + strict: true, + reporter: "emoji", + ) + end + desc "Lint Cocoapods Lib" lane :pod_lint do pod_lib_lint(allow_warnings: false) end - desc "Lint Carthage lib" - lane :carthage_lint do + desc "Build Carthage lib" + lane :carthage_build do carthage( executable: "./carthage.sh", platform: "iOS", @@ -110,13 +114,21 @@ platform :ios do lane :spm_build do # swift build doesn't support iOS build out of the box # https://github.com/fastlane/fastlane/discussions/17362 + sdk = `xcrun --sdk iphoneos --show-sdk-path`.strip + target = 'arm64-apple-ios17.0' swiftc = [ '-sdk', - `xcrun --sdk iphonesimulator --show-sdk-path`.strip, + sdk, '-target', - 'x86_64-apple-ios9.0-simulator' + target ].map { |o| " -Xswiftc \"#{o}\"" } - sh("swift build #{swiftc.join}") + cc = [ + '-isysroot', + sdk, + '-target', + target + ].map { |o| " -Xcc \"#{o}\"" } + sh("swift build #{swiftc.join} #{cc.join}") end desc "Validate html template" @@ -158,6 +170,7 @@ platform :ios do unless cocoapods_size_repo.exist? cocoapods_size_repo.parent.mkpath sh("git clone https://github.com/google/cocoapods-size #{cocoapods_size_repo}") + sh("sed -i '' 's/IPHONEOS_DEPLOYMENT_TARGET = 11.4/IPHONEOS_DEPLOYMENT_TARGET = 12.0/g' #{cocoapods_size_repo}/SwiftApp/SwiftApp.xcodeproj/project.pbxproj") end Dir.chdir(cocoapods_size_repo) do @@ -278,4 +291,4 @@ platform :ios do def indent(str, spaces) str.split("\n").map { |l| l.empty? ? "" : "#{' ' * spaces}#{l}" }.join("\n") end -end \ No newline at end of file +end