diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b9db450eca..1e58947783b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## X.X.X +### All +* Xcode 14 is [no longer supported by Apple](https://developer.apple.com/news/upcoming-requirements/). Please upgrade to Xcode 15 or later. + ## 23.25.0 2024-03-11 ### CustomerSheet * [Added] Added `paymentMethodTypes` in `CustomerAdapter` to control what payment methods are displayed. diff --git a/README.md b/README.md index b4029509532..dc7508da9db 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ If you're reading this on GitHub.com, please make sure you are looking at the [t ## Requirements -The Stripe iOS SDK requires Xcode 14.1 or later and is compatible with apps targeting iOS 13 or above. We support Catalyst on macOS 11 or later. +The Stripe iOS SDK requires Xcode 15 or later and is compatible with apps targeting iOS 13 or above. We support Catalyst on macOS 11 or later. For iOS 12 support, please use [v22.8.4](https://github.com/stripe/stripe-ios/tree/v22.8.4). For iOS 11 support, please use [v21.13.0](https://github.com/stripe/stripe-ios/tree/v21.13.0). For iOS 10, please use [v19.4.0](https://github.com/stripe/stripe-ios/tree/v19.4.0). If you need to support iOS 9, use [v17.0.2](https://github.com/stripe/stripe-ios/tree/v17.0.2). diff --git a/Stripe.podspec b/Stripe.podspec index 413abf010e7..e8d3f9bab3a 100644 --- a/Stripe.podspec +++ b/Stripe.podspec @@ -17,7 +17,7 @@ Pod::Spec.new do |s| s.ios.deployment_target = '13.0' s.weak_framework = 'SwiftUI' s.source_files = 'Stripe/StripeiOS/Source/*.swift' - s.ios.resource_bundle = { 'Stripe' => 'Stripe/StripeiOS/Resources/**/*.{lproj,png,xcassets}' } + s.ios.resource_bundle = { 'StripeBundle' => 'Stripe/StripeiOS/Resources/**/*.{lproj,png,xcassets}' } s.dependency 'StripeCore', s.version.to_s s.dependency 'StripeUICore', s.version.to_s s.dependency 'StripeApplePay', s.version.to_s diff --git a/Stripe/StripeiOS/Source/StripeBundleLocator.swift b/Stripe/StripeiOS/Source/StripeBundleLocator.swift index 2ffd642335e..a6c6694fd37 100644 --- a/Stripe/StripeiOS/Source/StripeBundleLocator.swift +++ b/Stripe/StripeiOS/Source/StripeBundleLocator.swift @@ -12,7 +12,7 @@ import Foundation /// :nodoc: @_spi(STP) public final class StripeBundleLocator: BundleLocatorProtocol { public static let internalClass: AnyClass = StripeBundleLocator.self - public static let bundleName = "Stripe" + public static let bundleName = "StripeBundle" #if SWIFT_PACKAGE public static let spmResourcesBundle = Bundle.module #endif diff --git a/StripeApplePay/StripeApplePay/Source/ApplePayContext/STPApplePayContext.swift b/StripeApplePay/StripeApplePay/Source/ApplePayContext/STPApplePayContext.swift index 7ba4a9c0cd8..c0c72fb7369 100644 --- a/StripeApplePay/StripeApplePay/Source/ApplePayContext/STPApplePayContext.swift +++ b/StripeApplePay/StripeApplePay/Source/ApplePayContext/STPApplePayContext.swift @@ -145,17 +145,7 @@ public class STPApplePayContext: NSObject, PKPaymentAuthorizationControllerDeleg @available(macCatalystApplicationExtension, unavailable) @objc(presentApplePayWithCompletion:) public func presentApplePay(completion: STPVoidBlock? = nil) { - // A note on `canImport(CompositorServices)`, found here and elsewhere - // in the codebase: This is a terrible, terrible hack. - // We should use #if os(visionOS), but that will fail to compile - // on Xcode 14. Because we need to continue supporting both Xcode 14 - // *and* building on visionOS, we instead check `canImport(CompositerServices)`, as CompositerServices currently - // only exists on visionOS. I'm sure it will exist on iOS someday, - // but we only need this in place until we drop Xcode 14. - // - // Future engineers in May 2024: Please delete this! Find every mention - // of canImport(CompositorServices) and replace it with os(visionOS). - #if canImport(CompositorServices) + #if os(visionOS) // This isn't great: We should encourage the use of presentApplePay(from window:) instead. let windows = UIApplication.shared.connectedScenes .compactMap { ($0 as? UIWindowScene)?.windows } @@ -265,26 +255,14 @@ public class STPApplePayContext: NSObject, PKPaymentAuthorizationControllerDeleg // MARK: - Private Helper func _delegateToAppleDelegateMapping() -> [Selector: Selector] { - // We need this type to disambiguate from the other PKACDelegate.didSelect:handler: method - // HACK: This signature changed in Xcode 14, we need to check the compiler version to choose the right signature. - #if compiler(>=5.7) - typealias pkDidSelectShippingMethodSignature = - (any PKPaymentAuthorizationControllerDelegate) -> ( - ( - PKPaymentAuthorizationController, - PKShippingMethod, - @escaping (PKPaymentRequestShippingMethodUpdate) -> Void - ) -> Void - )? - #else - typealias pkDidSelectShippingMethodSignature = ( - (PKPaymentAuthorizationControllerDelegate) -> ( - PKPaymentAuthorizationController, PKShippingMethod, + typealias pkDidSelectShippingMethodSignature = + (any PKPaymentAuthorizationControllerDelegate) -> ( + ( + PKPaymentAuthorizationController, + PKShippingMethod, @escaping (PKPaymentRequestShippingMethodUpdate) -> Void ) -> Void )? - #endif - let pk_didSelectShippingMethod = #selector( (PKPaymentAuthorizationControllerDelegate.paymentAuthorizationController( _: diff --git a/StripeCardScan.podspec b/StripeCardScan.podspec index 90bfd8c8e1e..8726ada6897 100644 --- a/StripeCardScan.podspec +++ b/StripeCardScan.podspec @@ -17,6 +17,6 @@ Pod::Spec.new do |s| s.swift_version = '5.0' s.weak_framework = 'AVKit', 'CoreML', 'VideoToolbox', 'Vision', 'AVFoundation' s.source_files = 'StripeCardScan/StripeCardScan/**/*.swift' - s.ios.resource_bundle = { 'StripeCardScan' => 'StripeCardScan/StripeCardScan/Resources/**/*.{lproj,mlmodelc}' } + s.ios.resource_bundle = { 'StripeCardScanBundle' => 'StripeCardScan/StripeCardScan/Resources/**/*.{lproj,mlmodelc}' } s.dependency 'StripeCore', "#{s.version}" end diff --git a/StripeCardScan/README.md b/StripeCardScan/README.md index f82d8a31216..3f270ff34d5 100644 --- a/StripeCardScan/README.md +++ b/StripeCardScan/README.md @@ -13,7 +13,7 @@ This library can be used entirely outside of a Stripe integration and with other ## Requirements - iOS 13.0 or higher -- XCode 14.1 or higher +- Xcode 15 or higher ## Example diff --git a/StripeCardScan/StripeCardScan/Source/CardVerify/StripeCardScanBundleLocator.swift b/StripeCardScan/StripeCardScan/Source/CardVerify/StripeCardScanBundleLocator.swift index 673bb9441ca..a8bdb54ace3 100644 --- a/StripeCardScan/StripeCardScan/Source/CardVerify/StripeCardScanBundleLocator.swift +++ b/StripeCardScan/StripeCardScan/Source/CardVerify/StripeCardScanBundleLocator.swift @@ -12,7 +12,7 @@ import Foundation /// :nodoc: final class StripeCardScanBundleLocator: BundleLocatorProtocol { static let internalClass: AnyClass = StripeCardScanBundleLocator.self - static let bundleName = "StripeCardScan" + static let bundleName = "StripeCardScanBundle" #if SWIFT_PACKAGE static let spmResourcesBundle = Bundle.module #endif diff --git a/StripeCore.podspec b/StripeCore.podspec index 788cc83e86c..edbe4dda424 100644 --- a/StripeCore.podspec +++ b/StripeCore.podspec @@ -17,5 +17,5 @@ Pod::Spec.new do |s| s.ios.deployment_target = '13.0' s.swift_version = '5.0' s.source_files = 'StripeCore/StripeCore/**/*.swift' - s.ios.resource_bundle = { 'StripeCore' => 'StripeCore/StripeCore/Resources/**/*.lproj' } + s.ios.resource_bundle = { 'StripeCoreBundle' => 'StripeCore/StripeCore/Resources/**/*.lproj' } end diff --git a/StripeCore/StripeCore/Source/Helpers/StripeCoreBundleLocator.swift b/StripeCore/StripeCore/Source/Helpers/StripeCoreBundleLocator.swift index 7ac368798e3..8a94aff7859 100644 --- a/StripeCore/StripeCore/Source/Helpers/StripeCoreBundleLocator.swift +++ b/StripeCore/StripeCore/Source/Helpers/StripeCoreBundleLocator.swift @@ -10,7 +10,7 @@ import Foundation final class StripeCoreBundleLocator: BundleLocatorProtocol { static let internalClass: AnyClass = StripeCoreBundleLocator.self - static let bundleName = "StripeCore" + static let bundleName = "StripeCoreBundle" #if SWIFT_PACKAGE static let spmResourcesBundle = Bundle.module #endif diff --git a/StripeFinancialConnections.podspec b/StripeFinancialConnections.podspec index 9f393a0e7c7..9f6c7eaa5ed 100644 --- a/StripeFinancialConnections.podspec +++ b/StripeFinancialConnections.podspec @@ -19,5 +19,5 @@ Pod::Spec.new do |s| s.dependency 'StripeCore', "#{s.version}" s.dependency 'StripeUICore', "#{s.version}" s.source_files = 'StripeFinancialConnections/StripeFinancialConnections/**/*.swift' - s.ios.resource_bundle = { 'StripeFinancialConnections' => 'StripeFinancialConnections/StripeFinancialConnections/Resources/**/*.{lproj,png}' } + s.ios.resource_bundle = { 'StripeFinancialConnectionsBundle' => 'StripeFinancialConnections/StripeFinancialConnections/Resources/**/*.{lproj,png}' } end \ No newline at end of file diff --git a/StripeFinancialConnections/StripeFinancialConnections/Source/Helpers/StripeFinancialConnectionsBundleLocator.swift b/StripeFinancialConnections/StripeFinancialConnections/Source/Helpers/StripeFinancialConnectionsBundleLocator.swift index 1b275bf1c5d..63eecdb372d 100644 --- a/StripeFinancialConnections/StripeFinancialConnections/Source/Helpers/StripeFinancialConnectionsBundleLocator.swift +++ b/StripeFinancialConnections/StripeFinancialConnections/Source/Helpers/StripeFinancialConnectionsBundleLocator.swift @@ -10,7 +10,7 @@ import Foundation final class StripeFinancialConnectionsBundleLocator: BundleLocatorProtocol { static let internalClass: AnyClass = StripeFinancialConnectionsBundleLocator.self - static let bundleName = "StripeFinancialConnections" + static let bundleName = "StripeFinancialConnectionsBundle" #if SWIFT_PACKAGE static let spmResourcesBundle = Bundle.module #endif diff --git a/StripeIdentity.podspec b/StripeIdentity.podspec index fc6081f0371..b72a4de28e6 100644 --- a/StripeIdentity.podspec +++ b/StripeIdentity.podspec @@ -17,7 +17,7 @@ Pod::Spec.new do |s| s.swift_version = '5.0' s.weak_framework = 'SwiftUI' s.source_files = 'StripeIdentity/StripeIdentity/**/*.swift' - s.ios.resource_bundle = { 'StripeIdentity' => 'StripeIdentity/StripeIdentity/Resources/**/*.{lproj,json,png,xcassets}' } + s.ios.resource_bundle = { 'StripeIdentityBundle' => 'StripeIdentity/StripeIdentity/Resources/**/*.{lproj,json,png,xcassets}' } s.dependency 'StripeCore', "#{s.version}" s.dependency 'StripeUICore', "#{s.version}" s.dependency 'StripeCameraCore', "#{s.version}" diff --git a/StripeIdentity/StripeIdentity/Source/Helpers/StripeIdentityBundleLocator.swift b/StripeIdentity/StripeIdentity/Source/Helpers/StripeIdentityBundleLocator.swift index d56e40d2db9..9773d40d276 100644 --- a/StripeIdentity/StripeIdentity/Source/Helpers/StripeIdentityBundleLocator.swift +++ b/StripeIdentity/StripeIdentity/Source/Helpers/StripeIdentityBundleLocator.swift @@ -11,7 +11,7 @@ import Foundation @_spi(STP) public final class StripeIdentityBundleLocator: BundleLocatorProtocol { @_spi(STP) public static let internalClass: AnyClass = StripeIdentityBundleLocator.self - @_spi(STP) public static let bundleName = "StripeIdentity" + @_spi(STP) public static let bundleName = "StripeIdentityBundle" #if SWIFT_PACKAGE @_spi(STP) public static let spmResourcesBundle = Bundle.module #endif diff --git a/StripePaymentSheet.podspec b/StripePaymentSheet.podspec index dc17ab8fc2f..9a5ef7638a2 100644 --- a/StripePaymentSheet.podspec +++ b/StripePaymentSheet.podspec @@ -17,7 +17,7 @@ Pod::Spec.new do |s| s.swift_version = '5.0' s.weak_framework = 'SwiftUI' s.source_files = 'StripePaymentSheet/StripePaymentSheet/Source/**/*.swift' - s.ios.resource_bundle = { 'StripePaymentSheet' => 'StripePaymentSheet/StripePaymentSheet/Resources/**/*.{lproj,png,xcassets,json}' } + s.ios.resource_bundle = { 'StripePaymentSheetBundle' => 'StripePaymentSheet/StripePaymentSheet/Resources/**/*.{lproj,png,xcassets,json}' } s.dependency 'StripeCore', s.version.to_s s.dependency 'StripePayments', s.version.to_s s.dependency 'StripePaymentsUI', s.version.to_s diff --git a/StripePaymentSheet/StripePaymentSheet/Source/Helpers/StripePaymentSheetBundleLocator.swift b/StripePaymentSheet/StripePaymentSheet/Source/Helpers/StripePaymentSheetBundleLocator.swift index 8ca24e1f58a..424b9c59963 100644 --- a/StripePaymentSheet/StripePaymentSheet/Source/Helpers/StripePaymentSheetBundleLocator.swift +++ b/StripePaymentSheet/StripePaymentSheet/Source/Helpers/StripePaymentSheetBundleLocator.swift @@ -11,7 +11,7 @@ import Foundation /// :nodoc: @_spi(STP) public final class StripePaymentSheetBundleLocator: BundleLocatorProtocol { public static let internalClass: AnyClass = StripePaymentSheetBundleLocator.self - public static let bundleName = "StripePaymentSheet" + public static let bundleName = "StripePaymentSheetBundle" #if SWIFT_PACKAGE public static let spmResourcesBundle = Bundle.module #endif diff --git a/StripePayments.podspec b/StripePayments.podspec index 29915c5fea0..be2769dff32 100644 --- a/StripePayments.podspec +++ b/StripePayments.podspec @@ -17,7 +17,7 @@ Pod::Spec.new do |s| s.swift_version = '5.0' s.weak_framework = 'SwiftUI' s.source_files = 'StripePayments/StripePayments/Source/**/*.swift' - s.ios.resource_bundle = { 'StripePayments' => 'StripePayments/StripePayments/Resources/**/*.{lproj}' } + s.ios.resource_bundle = { 'StripePaymentsBundle' => 'StripePayments/StripePayments/Resources/**/*.{lproj}' } s.dependency 'StripeCore', s.version.to_s s.subspec 'Stripe3DS2' do |sp| sp.source_files = 'Stripe3DS2/Stripe3DS2/**/*.{h,m}' diff --git a/StripePayments/StripePayments/Source/Helpers/StripePaymentsBundleLocator.swift b/StripePayments/StripePayments/Source/Helpers/StripePaymentsBundleLocator.swift index 10a9d9c5779..d02bf278e1d 100644 --- a/StripePayments/StripePayments/Source/Helpers/StripePaymentsBundleLocator.swift +++ b/StripePayments/StripePayments/Source/Helpers/StripePaymentsBundleLocator.swift @@ -11,7 +11,7 @@ import Foundation /// :nodoc: @_spi(STP) public final class StripePaymentsBundleLocator: BundleLocatorProtocol { public static let internalClass: AnyClass = StripePaymentsBundleLocator.self - public static let bundleName = "StripePayments" + public static let bundleName = "StripePaymentsBundle" #if SWIFT_PACKAGE public static let spmResourcesBundle = Bundle.module #endif diff --git a/StripePaymentsUI.podspec b/StripePaymentsUI.podspec index 0e4dd426d49..8a522fd2152 100644 --- a/StripePaymentsUI.podspec +++ b/StripePaymentsUI.podspec @@ -17,7 +17,7 @@ Pod::Spec.new do |s| s.swift_version = '5.0' s.weak_framework = 'SwiftUI' s.source_files = 'StripePaymentsUI/StripePaymentsUI/Source/**/*.swift' - s.ios.resource_bundle = { 'StripePaymentsUI' => 'StripePaymentsUI/StripePaymentsUI/Resources/**/*.{lproj,png,json,xcassets}' } + s.ios.resource_bundle = { 'StripePaymentsUIBundle' => 'StripePaymentsUI/StripePaymentsUI/Resources/**/*.{lproj,png,json,xcassets}' } s.dependency 'StripeCore', s.version.to_s s.dependency 'StripeUICore', s.version.to_s s.dependency 'StripePayments', s.version.to_s diff --git a/StripePaymentsUI/StripePaymentsUI/Source/Helpers/StripePaymentsBundleLocator.swift b/StripePaymentsUI/StripePaymentsUI/Source/Helpers/StripePaymentsBundleLocator.swift index e024896f894..ec1b8c05bd5 100644 --- a/StripePaymentsUI/StripePaymentsUI/Source/Helpers/StripePaymentsBundleLocator.swift +++ b/StripePaymentsUI/StripePaymentsUI/Source/Helpers/StripePaymentsBundleLocator.swift @@ -11,7 +11,7 @@ import Foundation /// :nodoc: @_spi(STP) public final class StripePaymentsUIBundleLocator: BundleLocatorProtocol { public static let internalClass: AnyClass = StripePaymentsUIBundleLocator.self - public static let bundleName = "StripePaymentsUI" + public static let bundleName = "StripePaymentsUIBundle" #if SWIFT_PACKAGE public static let spmResourcesBundle = Bundle.module #endif diff --git a/StripeUICore.podspec b/StripeUICore.podspec index 27c40974a90..4f78a6cae70 100644 --- a/StripeUICore.podspec +++ b/StripeUICore.podspec @@ -18,6 +18,6 @@ Pod::Spec.new do |s| s.swift_version = '5.0' s.weak_framework = 'SwiftUI' s.source_files = 'StripeUICore/StripeUICore/**/*.swift' - s.ios.resource_bundle = { 'StripeUICore' => 'StripeUICore/StripeUICore/Resources/**/*.{lproj,png,json,xcassets}' } + s.ios.resource_bundle = { 'StripeUICoreBundle' => 'StripeUICore/StripeUICore/Resources/**/*.{lproj,png,json,xcassets}' } s.dependency 'StripeCore', "#{s.version}" end diff --git a/StripeUICore/StripeUICore/Source/Helpers/StripeUICoreBundleLocator.swift b/StripeUICore/StripeUICore/Source/Helpers/StripeUICoreBundleLocator.swift index 1414b41e90f..80e2fcc897a 100644 --- a/StripeUICore/StripeUICore/Source/Helpers/StripeUICoreBundleLocator.swift +++ b/StripeUICore/StripeUICore/Source/Helpers/StripeUICoreBundleLocator.swift @@ -11,7 +11,7 @@ import Foundation @_spi(STP) public final class StripeUICoreBundleLocator: BundleLocatorProtocol { public static let internalClass: AnyClass = StripeUICoreBundleLocator.self - public static let bundleName = "StripeUICore" + public static let bundleName = "StripeUICoreBundle" #if SWIFT_PACKAGE public static let spmResourcesBundle = Bundle.module #endif diff --git a/bitrise.yml b/bitrise.yml index f5fc3b3c88b..7cfee26325b 100644 --- a/bitrise.yml +++ b/bitrise.yml @@ -37,9 +37,8 @@ stages: stage-trigger-run-all: workflows: - framework-tests: {} - - test-builds-xcode-143: {} - test-builds-xcode-15: {} - - test-builds-xcode-143-release: {} + - test-builds-xcode-15-release: {} - test-builds-vision: {} - install-tests-non-carthage: {} - lint-tests: {} @@ -52,7 +51,6 @@ stages: stage-releases-run-all: workflows: - framework-tests: {} - - test-builds-xcode-143: {} - test-builds-xcode-15: {} - test-builds-vision: {} - deploy-docs: {} @@ -62,7 +60,6 @@ stages: - basic-integration-tests: {} - ui-tests-1: {} - ui-tests-2: {} - - legacy-tests-14: {} - legacy-tests-15: {} - legacy-tests-16: {} - carthage-install-test: {} @@ -72,7 +69,6 @@ stages: workflows: - basic-integration-tests: {} - check-docs: {} - - legacy-tests-14: {} - legacy-tests-15: {} - legacy-tests-16: {} - carthage-install-test: {} @@ -94,7 +90,7 @@ workflows: after_run: - notify_ci envs: - - DEFAULT_TEST_DEVICE: platform=iOS Simulator,name=iPhone 12 mini,OS=16.1 + - DEFAULT_TEST_DEVICE: platform=iOS Simulator,name=iPhone 12 mini,OS=16.4 carthage-install-test: steps: - fastlane@3: @@ -106,7 +102,7 @@ workflows: after_run: - notify_ci envs: - - DEFAULT_TEST_DEVICE: platform=iOS Simulator,name=iPhone 12 mini,OS=16.1 + - DEFAULT_TEST_DEVICE: platform=iOS Simulator,name=iPhone 12 mini,OS=16.4 check-docs: steps: - script@1: @@ -194,10 +190,10 @@ workflows: - notify_ci meta: bitrise.io: - stack: osx-xcode-14.1.x-ventura + stack: osx-xcode-15.0.x machine_type_id: g2-m1.8core envs: - - DEFAULT_TEST_DEVICE: platform=iOS Simulator,name=iPhone 12 mini,OS=16.1 + - DEFAULT_TEST_DEVICE: platform=iOS Simulator,name=iPhone 12 mini,OS=16.4 deploy-example-apps: steps: - set-xcode-build-number@1: @@ -247,7 +243,7 @@ workflows: - webhook_url_on_error: $SLACK_KGAIDIS_TESTING_WEBHOOK_URL - deploy-to-bitrise-io@2: {} envs: - - DEFAULT_TEST_DEVICE: platform=iOS Simulator,name=iPhone 12 mini,OS=16.1 + - DEFAULT_TEST_DEVICE: platform=iOS Simulator,name=iPhone 12 mini,OS=16.4 financial-connections-stability-tests-for-edge: before_run: - prep_all @@ -260,7 +256,7 @@ workflows: - scheme: FinancialConnections Example - deploy-to-bitrise-io@2: {} envs: - - DEFAULT_TEST_DEVICE: platform=iOS Simulator,name=iPhone 12 mini,OS=16.1 + - DEFAULT_TEST_DEVICE: platform=iOS Simulator,name=iPhone 12 mini,OS=16.4 framework-tests: steps: - fastlane@3: @@ -344,21 +340,24 @@ workflows: after_run: [] meta: bitrise.io: - stack: osx-xcode-14.3.x-ventura + stack: osx-xcode-15.0.x machine_type_id: g2-m1.8core - test-builds-xcode-143: + test-builds-xcode-15: steps: - xcode-build-for-test@2: inputs: - scheme: AllStripeFrameworks - - destination: $DEFAULT_TEST_DEVICE + - destination: generic/platform=iOS Simulator + - deploy-to-bitrise-io@2: {} + envs: + - DEFAULT_TEST_DEVICE: platform=iOS Simulator,name=iPhone 15,OS=17.0 before_run: - prep_all meta: bitrise.io: - stack: osx-xcode-14.3.x-ventura + stack: osx-xcode-15.0.x machine_type_id: g2-m1.8core - test-builds-xcode-143-release: + test-builds-xcode-15-release: steps: - script@1: inputs: @@ -366,21 +365,6 @@ workflows: title: Build release builds before_run: - prep_all - meta: - bitrise.io: - stack: osx-xcode-14.3.x-ventura - machine_type_id: g2-m1.8core - test-builds-xcode-15: - steps: - - xcode-build-for-test@2: - inputs: - - scheme: AllStripeFrameworks - - destination: generic/platform=iOS Simulator - - deploy-to-bitrise-io@2: {} - envs: - - DEFAULT_TEST_DEVICE: platform=iOS Simulator,name=iPhone 15,OS=17.0 - before_run: - - prep_all meta: bitrise.io: stack: osx-xcode-15.0.x @@ -423,7 +407,7 @@ workflows: before_run: - prep_all envs: - - DEFAULT_TEST_DEVICE: platform=iOS Simulator,name=iPhone 12 mini,OS=16.1 + - DEFAULT_TEST_DEVICE: platform=iOS Simulator,name=iPhone 12 mini,OS=16.4 integration-all: steps: - xcode-test@4: @@ -438,27 +422,10 @@ workflows: - prep_all meta: bitrise.io: - stack: osx-xcode-14.1.x-ventura + stack: osx-xcode-15.0.x machine_type_id: g2-m1-max.10core envs: - - DEFAULT_TEST_DEVICE: platform=iOS Simulator,name=iPhone 12 mini,OS=16.1 - legacy-tests-14: - steps: - - fastlane@3: - inputs: - - lane: legacy_tests_14 - title: fastlane legacy_tests_14 - envs: - - DEFAULT_TEST_DEVICE: platform=iOS Simulator,name=iPhone 8,OS=14.5 - meta: - bitrise.io: - stack: osx-xcode-14.3.x-ventura - machine_type_id: g2-m1.8core - before_run: - - prep_all - after_run: - - upload_logs - - notify_ci + - DEFAULT_TEST_DEVICE: platform=iOS Simulator,name=iPhone 12 mini,OS=16.4 legacy-tests-15: steps: - fastlane@3: @@ -469,7 +436,7 @@ workflows: - DEFAULT_TEST_DEVICE: platform=iOS Simulator,name=iPhone 12 mini,OS=15.4 meta: bitrise.io: - stack: osx-xcode-14.3.x-ventura + stack: osx-xcode-15.0.x machine_type_id: g2-m1.8core before_run: - prep_all @@ -491,7 +458,7 @@ workflows: - notify_ci meta: bitrise.io: - stack: osx-xcode-14.3.x-ventura + stack: osx-xcode-15.0.x machine_type_id: g2-m1.8core lint-tests: steps: @@ -519,7 +486,7 @@ workflows: - prep_all meta: bitrise.io: - stack: osx-xcode-14.3.x-ventura + stack: osx-xcode-15.0.x machine_type_id: g2-m1.8core notify_ci: steps: @@ -541,7 +508,7 @@ workflows: - LOKALISE_API_KEY: $LOKALISE_API_KEY meta: bitrise.io: - stack: osx-xcode-14.3.x-ventura + stack: osx-xcode-15.0.x machine_type_id: g2-m1.8core pod-lint-tests: steps: @@ -552,7 +519,7 @@ workflows: before_run: - prep_all envs: - - DEFAULT_TEST_DEVICE: platform=iOS Simulator,name=iPhone 12 mini,OS=16.1 + - DEFAULT_TEST_DEVICE: platform=iOS Simulator,name=iPhone 12 mini,OS=16.4 prep_all: steps: - xcode-start-simulator@0: @@ -627,7 +594,7 @@ workflows: - prep_all meta: bitrise.io: - stack: osx-xcode-14.3.x-ventura + stack: osx-xcode-15.0.x machine_type_id: g2-m1.8core ui-tests-2: steps: @@ -645,7 +612,7 @@ workflows: - prep_all meta: bitrise.io: - stack: osx-xcode-14.3.x-ventura + stack: osx-xcode-15.0.x machine_type_id: g2-m1.8core upload_logs: steps: @@ -658,5 +625,5 @@ workflows: title: Deploy test log artifacts meta: bitrise.io: - stack: osx-xcode-14.1.x-ventura + stack: osx-xcode-15.0.x machine_type_id: g2-m1.8core diff --git a/ci_scripts/build_vm.rb b/ci_scripts/build_vm.rb index d12f5e09fc9..227c24a1390 100755 --- a/ci_scripts/build_vm.rb +++ b/ci_scripts/build_vm.rb @@ -5,5 +5,5 @@ if need_to_build_vm? build_vm else - print "VM already built! If you want to rebuild it, run `tart delete #{VM_NAME}` (and ventura-base and ventura-vanilla if you'd like) and try again." -end \ No newline at end of file + print "VM already built! If you want to rebuild it, run `tart delete #{VM_NAME}` (and sonoma-base and sonoma-vanilla if you'd like) and try again." +end diff --git a/ci_scripts/common.rb b/ci_scripts/common.rb index 0bae48b0bda..e15c5c2a32c 100644 --- a/ci_scripts/common.rb +++ b/ci_scripts/common.rb @@ -7,7 +7,7 @@ # This should generally be the minimum Xcode version supported by the App Store, as the # compiled XCFrameworks won't be usable on older versions. # We sometimes bump this if an Xcode bug or deprecation forces us to upgrade early. -VM_NAME = 'ventura-xcode:14.1'.freeze +VM_NAME = 'sonoma-xcode:15.0'.freeze def rputs(string) puts string.red diff --git a/ci_scripts/create_release.rb b/ci_scripts/create_release.rb index 9f0824f60f6..c1d58d5c31e 100755 --- a/ci_scripts/create_release.rb +++ b/ci_scripts/create_release.rb @@ -49,9 +49,8 @@ def push_changes end def run_download_localized_strings - unless @is_dry_run - `sh ci_scripts/download_localized_strings_from_lokalise.sh` - end + return if @is_dry_run + `sh ci_scripts/download_localized_strings_from_lokalise.sh` end def create_pr @@ -67,15 +66,15 @@ def create_pr - [ ] If new directories were added, verify they have been added to the appropriate `*.podspec` "files" section. } - unless @is_dry_run - pr = @github_client.create_pull_request( - 'stripe/stripe-ios', - 'master', - @branchname, - "Release version #{@version}", - pr_body - ) - end + return if @is_dry_run + + pr = @github_client.create_pull_request( + 'stripe/stripe-ios', + 'master', + @branchname, + "Release version #{@version}", + pr_body + ) end def check_for_missing_localizations @@ -92,23 +91,23 @@ def check_for_missing_localizations end def propose_release - unless @is_dry_run - # Lookup PR - all_prs = @github_client.pull_requests('stripe/stripe-ios', state: 'open') - pr = all_prs.find { |pr| pr.head.ref == @branchname } - - # Get list of new directories and save to a temp file - prev_release_tag = @github_client.latest_release('stripe/stripe-ios').tag_name - `git fetch origin --tags` - new_dirs = `ci_scripts/check_for_new_directories.sh HEAD #{prev_release_tag}` - temp_dir = `mktemp -d`.chomp("\n") - new_dir_file = File.join_if_safe(temp_dir, "new_directories_#{@version}.txt") - File.open(new_dir_file, 'w') { |file| file.puts new_dirs } - - rputs "Complete the pull request checklist at #{pr.html_url}" - rputs "For a list of new directories since tag #{prev_release_tag}, `cat #{new_dir_file}`" - notify_user - end + return if @is_dry_run + + # Lookup PR + all_prs = @github_client.pull_requests('stripe/stripe-ios', state: 'open') + pr = all_prs.find { |pr| pr.head.ref == @branchname } + + # Get list of new directories and save to a temp file + prev_release_tag = @github_client.latest_release('stripe/stripe-ios').tag_name + `git fetch origin --tags` + new_dirs = `ci_scripts/check_for_new_directories.sh HEAD #{prev_release_tag}` + temp_dir = `mktemp -d`.chomp("\n") + new_dir_file = File.join_if_safe(temp_dir, "new_directories_#{@version}.txt") + File.open(new_dir_file, 'w') { |file| file.puts new_dirs } + + rputs "Complete the pull request checklist at #{pr.html_url}" + rputs "For a list of new directories since tag #{prev_release_tag}, `cat #{new_dir_file}`" + notify_user end steps = [ @@ -122,4 +121,4 @@ def propose_release method(:check_for_missing_localizations), method(:propose_release) ] -execute_steps(steps, @step_index) \ No newline at end of file +execute_steps(steps, @step_index) diff --git a/ci_scripts/deploy_release.rb b/ci_scripts/deploy_release.rb index 23772b9338c..bad63d80a4e 100755 --- a/ci_scripts/deploy_release.rb +++ b/ci_scripts/deploy_release.rb @@ -3,6 +3,23 @@ require_relative 'release_common' require_relative 'vm_tools' +# This should generally be the minimum Xcode version supported by the App Store, as the +# compiled XCFrameworks won't be usable on older versions. +# We sometimes bump this if an Xcode bug or deprecation forces us to upgrade early. +MIN_SUPPORTED_XCODE_VERSION = '15.0'.freeze + +def verify_xcode_version + # Verify that xcode-select -p returns the correct version for building Stripe.xcframework. + return if `xcodebuild -version`.include?("Xcode #{MIN_SUPPORTED_XCODE_VERSION}") + + rputs "Xcode #{MIN_SUPPORTED_XCODE_VERSION} is required to build Stripe.xcframework." + rputs 'Use `xcode-select -s` to select the correct version, or download it from https://developer.apple.com/download/more/.' + rputs "If you believe this is no longer the correct version, update `MIN_SUPPORTED_XCODE_VERSION` in `#{__FILE__}`." + abort +end + +verify_xcode_version + @version = version_from_file @changelog = changelog(@version) @@ -13,18 +30,8 @@ def export_builds # Delete Stripe.xcframework.zip if one exists run_command('rm -f build/Stripe.xcframework.zip') - if @is_dry_run - # Run locally - run_command('ci_scripts/export_builds.rb') - else - # Run in VM - if need_to_build_vm? - build_vm - end - bring_up_vm_and_wait_for_boot - run_command_vm('source ~/.zprofile && sudo gem install bundler:2.1.2 && bundle install && bundle exec ./ci_scripts/export_builds.rb') - finish_vm - end + run_command('ci_scripts/export_builds.rb') + raise 'build/Stripe.xcframework.zip not found. Did the build fail?' unless File.exist?('build/Stripe.xcframework.zip') end @@ -36,66 +43,66 @@ def approve_pr end def create_docs_pr - unless @is_dry_run - pr = @github_client.create_pull_request( - 'stripe/stripe-ios', - 'docs', - "docs-publish/#{@version}", - "Publish docs for v#{@version}" - ) - - rputs "Docs PR created at #{pr.html_url}" - rputs 'Request review on the PR and merge it.' - notify_user - end + return if @is_dry_run + + pr = @github_client.create_pull_request( + 'stripe/stripe-ios', + 'docs', + "docs-publish/#{@version}", + "Publish docs for v#{@version}" + ) + + rputs "Docs PR created at #{pr.html_url}" + rputs 'Request review on the PR and merge it.' + notify_user end def push_tag - unless @is_dry_run - # Create a signed git tag and push to GitHub: git tag -s X.Y.Z -m "Version X.Y.Z" && git push origin X.Y.Z - run_command("git tag -s #{@version} -m \"Version #{@version}\"") - run_command("git push origin #{@version}") - end + return if @is_dry_run + + # Create a signed git tag and push to GitHub: git tag -s X.Y.Z -m "Version X.Y.Z" && git push origin X.Y.Z + run_command("git tag -s #{@version} -m \"Version #{@version}\"") + run_command("git push origin #{@version}") end def create_release - unless @is_dry_run - @release = @github_client.create_release( - 'stripe/stripe-ios', - @version, - { - body: @changelog - } - ) - end + return if @is_dry_run + + @release = @github_client.create_release( + 'stripe/stripe-ios', + @version, + { + body: @changelog + } + ) end def upload_framework - unless @is_dry_run - # Use the reference to the release object from `create_release` if it exists, - # otherwise fetch it. - release = @release - release ||= @github_client.latest_release('stripe/stripe-ios') - @github_client.upload_asset( - release.url, - File.open('./build/Stripe.xcframework.zip') - ) - end + return if @is_dry_run + + # Use the reference to the release object from `create_release` if it exists, + # otherwise fetch it. + release = @release + release ||= @github_client.latest_release('stripe/stripe-ios') + @github_client.upload_asset( + release.url, + File.open('./build/Stripe.xcframework.zip') + ) end def push_cocoapods - unless @is_dry_run - # Push the release to the CocoaPods trunk: ./ci_scripts/pod_tools.rb push - rputs 'Pushing the release to Cocoapods.' - run_command('ci_scripts/pod_tools.rb push') - end + return if @is_dry_run + + # Push the release to the CocoaPods trunk: ./ci_scripts/pod_tools.rb push + rputs 'Pushing the release to Cocoapods.' + run_command('ci_scripts/pod_tools.rb push') end def push_spm_mirror - unless @is_dry_run - rputs 'Pushing the release to our SPM mirror.' - run_command("ci_scripts/push_spm_mirror.rb --version #{@version}") - end + return if @is_dry_run + + rputs 'Pushing the release to our SPM mirror.' + run_command("ci_scripts/push_spm_mirror.rb --version #{@version}") end def sync_owner_list diff --git a/ci_scripts/export_builds.rb b/ci_scripts/export_builds.rb index ff14b9f854c..7d2100da387 100755 --- a/ci_scripts/export_builds.rb +++ b/ci_scripts/export_builds.rb @@ -50,19 +50,17 @@ def File.join_if_safe(arg1, *otherArgs) # Build for iOS puts `xcodebuild clean archive \ - -quiet \ - -workspace "Stripe.xcworkspace" \ - -scheme "AllStripeFrameworks" \ - -configuration "Release" \ - -archivePath "#{build_dir}/StripeFrameworks-iOS.xcarchive" \ - -sdk iphoneos \ - -destination 'generic/platform=iOS' \ - SYMROOT="#{build_dir}/StripeFrameworks-framework-ios" \ - OBJROOT="#{build_dir}/StripeFrameworks-framework-ios" \ - SUPPORTS_MACCATALYST=NO \ - BUILD_LIBRARIES_FOR_DISTRIBUTION=YES \ - SWIFT_ACTIVE_COMPILATION_CONDITIONS=STRIPE_BUILD_PACKAGE \ - SKIP_INSTALL=NO` + -quiet \ + -workspace "Stripe.xcworkspace" \ + -scheme "AllStripeFrameworks" \ + -configuration "Release" \ + -archivePath "#{build_dir}/StripeFrameworks-iOS.xcarchive" \ + -sdk iphoneos \ + -destination 'generic/platform=iOS' \ + SUPPORTS_MACCATALYST=NO \ + BUILD_LIBRARIES_FOR_DISTRIBUTION=YES \ + SWIFT_ACTIVE_COMPILATION_CONDITIONS=STRIPE_BUILD_PACKAGE \ + SKIP_INSTALL=NO` exit_code = $?.exitstatus die "xcodebuild exited with non-zero status code: #{exit_code}" if exit_code != 0 @@ -78,8 +76,6 @@ def File.join_if_safe(arg1, *otherArgs) -configuration "Release" \ -archivePath "#{build_dir}/StripeFrameworks-sim.xcarchive" \ -sdk iphonesimulator \ - SYMROOT="#{build_dir}/StripeFrameworks-framework-sim" \ - OBJROOT="#{build_dir}/StripeFrameworks-framework-sim" \ SUPPORTS_MACCATALYST=NO \ BUILD_LIBRARIES_FOR_DISTRIBUTION=YES \ SWIFT_ACTIVE_COMPILATION_CONDITIONS=STRIPE_BUILD_PACKAGE \ @@ -99,8 +95,6 @@ def File.join_if_safe(arg1, *otherArgs) -archivePath "#{build_dir}/StripeFrameworks-mac.xcarchive" \ -sdk macosx \ -destination 'generic/platform=macOS,variant=Mac Catalyst' \ - SYMROOT="#{build_dir}/StripeFrameworks-framework-mac" \ - OBJROOT="#{build_dir}/StripeFrameworks-framework-mac" \ SUPPORTS_MACCATALYST=YES \ BUILD_LIBRARIES_FOR_DISTRIBUTION=YES \ SWIFT_ACTIVE_COMPILATION_CONDITIONS=STRIPE_BUILD_PACKAGE \ diff --git a/ci_scripts/vm_tools.rb b/ci_scripts/vm_tools.rb index 6d215d56c9e..713a6f0404f 100644 --- a/ci_scripts/vm_tools.rb +++ b/ci_scripts/vm_tools.rb @@ -59,11 +59,11 @@ def build_vm rputs 'Building VM images! This will take a while, grab some coffee and keep your Mac awake...' setup_vm_requirements Dir.chdir("#{Dir.home}/stripe/ios-deploy-vm") do - run_command('packer init -var-file="variables.pkrvars.hcl" templates/vanilla-ventura.pkr.hcl') - unless `tart list`.include? 'ventura-vanilla' - run_command('packer build -var-file="variables.pkrvars.hcl" templates/vanilla-ventura.pkr.hcl') + run_command('packer init -var-file="variables.pkrvars.hcl" templates/vanilla-sonoma.pkr.hcl') + unless `tart list`.include? 'sonoma-vanilla' + run_command('packer build -var-file="variables.pkrvars.hcl" templates/vanilla-sonoma.pkr.hcl') end - unless `tart list`.include? 'ventura-base' + unless `tart list`.include? 'sonoma-base' run_command('packer build -var-file="variables.pkrvars.hcl" templates/base.pkr.hcl') end run_command('packer build -var-file="variables.pkrvars.hcl" templates/xcode.pkr.hcl') diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 0c07074ea27..2441bcdcb58 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -16,7 +16,7 @@ default_platform(:ios) DEFAULT_TEST_DEVICE = 'iPhone 12 mini'.freeze -DEFAULT_TEST_VERSION = '16.1'.freeze +DEFAULT_TEST_VERSION = '16.4'.freeze # SPM-using .xcodeproj files can take a while to respond to `showBuildSettings`, # set Fastlane's timeout to a more reasonable value. ENV['FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT'] = '60'