From a0a3cc81be4140d1d2f3fefa0d546563fc29bf78 Mon Sep 17 00:00:00 2001 From: Alexande B Date: Thu, 22 Feb 2024 13:01:44 +0100 Subject: [PATCH 1/6] chore: upgrade deployment target to 12.0 according Xcode 15 --- .github/workflows/workflow.yml | 20 ++++++++++---------- Example/HCaptcha.xcodeproj/project.pbxproj | 20 ++++++++++---------- Example/Podfile | 4 ++-- Example/Podfile.lock | 4 ++-- HCaptcha.podspec | 2 +- README.md | 8 ++++---- fastlane/Fastfile | 4 ++-- 7 files changed, 31 insertions(+), 31 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 745f8e5..cad6ca8 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: name: Test SDK - runs-on: macOS-latest + runs-on: macos-13 steps: - uses: actions/checkout@v4 @@ -60,7 +60,7 @@ jobs: size-report: name: Cocoapods size report if: github.event_name == 'pull_request' - runs-on: macos-latest + runs-on: macos-13 steps: - uses: actions/checkout@v4 @@ -123,17 +123,17 @@ jobs: samples: name: Build Samples needs: sdk - runs-on: macos-12 + 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 @@ -155,7 +155,7 @@ jobs: name: Release if: github.event_name == 'release' needs: samples - runs-on: macOS-latest + runs-on: macos-13 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..dfbf019 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -114,7 +114,7 @@ platform :ios do '-sdk', `xcrun --sdk iphonesimulator --show-sdk-path`.strip, '-target', - 'x86_64-apple-ios9.0-simulator' + 'x86_64-apple-ios17.2-simulator' ].map { |o| " -Xswiftc \"#{o}\"" } sh("swift build #{swiftc.join}") end @@ -278,4 +278,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 From eeedf8714bc983f697d81daa7bb47d11505fb0d3 Mon Sep 17 00:00:00 2001 From: Alexande B Date: Mon, 29 Apr 2024 17:06:05 +0200 Subject: [PATCH 2/6] chore: update deployment target for scaffolding project for pod size measurement --- fastlane/Fastfile | 1 + 1 file changed, 1 insertion(+) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index dfbf019..4f4db03 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -158,6 +158,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 From 2b7dac20cd43c7afb720322954000718eb926036 Mon Sep 17 00:00:00 2001 From: Alexande B Date: Tue, 7 May 2024 00:53:46 +0200 Subject: [PATCH 3/6] ci: update image-runner to macos-latest --- .github/workflows/workflow.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index cad6ca8..506a1d3 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -24,7 +24,7 @@ env: jobs: sdk: name: Test SDK - runs-on: macos-13 + runs-on: macos-latest steps: - uses: actions/checkout@v4 @@ -60,7 +60,7 @@ jobs: size-report: name: Cocoapods size report if: github.event_name == 'pull_request' - runs-on: macos-13 + runs-on: macos-latest steps: - uses: actions/checkout@v4 @@ -155,7 +155,7 @@ jobs: name: Release if: github.event_name == 'release' needs: samples - runs-on: macos-13 + runs-on: macos-latest steps: - uses: actions/checkout@v4 From 933a04e9920cc0d544122cd469d313445ef88bd6 Mon Sep 17 00:00:00 2001 From: Alexande B Date: Tue, 7 May 2024 01:38:36 +0200 Subject: [PATCH 4/6] ci: incease fastlane ci timeout to 25 min --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 506a1d3..e5eecdb 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -49,7 +49,7 @@ jobs: - run: | bundle exec fastlane ci cp .lint/cocoapods-size/result.json cocoapods-size-result.json - timeout-minutes: 15 + timeout-minutes: 25 - if: github.event_name == 'push' uses: actions/cache@v4 From 86091d5266f989486da6052c4311db1eb2467714 Mon Sep 17 00:00:00 2001 From: Alexande B Date: Mon, 13 May 2024 23:24:50 +0200 Subject: [PATCH 5/6] fix: fastlane spm_build --- fastlane/Fastfile | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 4f4db03..1535100 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -110,13 +110,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-ios17.2-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" From 063f03c344755e70f61d70cb4b94e7944202ba4c Mon Sep 17 00:00:00 2001 From: Alexande B Date: Tue, 14 May 2024 10:07:52 +0200 Subject: [PATCH 6/6] ci: split fastlane ci step to independent jobs to run in parallel --- .github/workflows/workflow.yml | 97 +++++++++++++++++++++++++++++++--- fastlane/Fastfile | 22 ++++---- 2 files changed, 102 insertions(+), 17 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index e5eecdb..3da9673 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -22,7 +22,7 @@ env: RUBY_VERSION: '3.1' jobs: - sdk: + test: name: Test SDK runs-on: macos-latest steps: @@ -39,17 +39,19 @@ 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 + 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 - timeout-minutes: 25 - if: github.event_name == 'push' uses: actions/cache@v4 @@ -57,6 +59,80 @@ jobs: 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,7 +198,7 @@ jobs: samples: name: Build Samples - needs: sdk + needs: test runs-on: macos-14 continue-on-error: ${{ matrix.experimental }} strategy: @@ -154,7 +230,12 @@ jobs: release: name: Release if: github.event_name == 'release' - needs: samples + needs: + - sources-lint + - pod-lint + - carthage-build + - swift-package-build + - samples runs-on: macos-latest steps: - uses: actions/checkout@v4 diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 1535100..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",