Skip to content

Commit 4d7578f

Browse files
authored
Add CI and Fastlane automation for one-off and nightly TestFlight builds (#24443)
* Explicitly set .ipa output name when building for ASC We'll use it to derive the path when uploading the ipa to TestFlight in a dedicated lane. * Add lane to upload Reader build to TestFlight * Hack a version long and short to use for TestFlight upload testing * Add dedicated pipeline to upload Reader to TestFlight * Add trigger button to send Reader build to TestFlight * Address RuboCop violations * Only install gems in Reader upload script No need to set up Swift packages or XCFrameworks. * Set `VERSION_LONG` as `BUILDKITE_BUILD_NUMBER` default * Specify supported device orientation for iPhone and iPad Aims to address: [Application Loader Error Output]: [ContentDelivery.Uploader.6000033F8180] Validation failed (409) Invalid bundle. No orientations were specified in the com.automattic.reader bundle. To support iPad multitasking, specify the “UIInterfaceOrientationPortrait,UIInterfaceOrientationPortraitUpsideDown,UIInterfaceOrientationLandscapeLeft,UIInterfaceOrientationLandscapeRight” orientations for the UISupportedInterfaceOrientations Info.plist key. For details, visit: https://developer.apple.com/documentation/bundleresources/information_property_list/uisupportedinterfaceorientations. (ID: b7c3b053-0ea8-4267-83dc-1dee7ea62885) See https://buildkite.com/automattic/wordpress-ios/builds/27266/steps?sid=0196236d-400e-4be1-9cf8-399f2ca6b45c * Make Reader upload depend on both build and block step I was expecting the implicit dependency in the block to force the upload to wait till the build finished, but that was not the case in https://buildkite.com/automattic/wordpress-ios/builds/27273/steps?sid=019624d9-64df-4b64-89da-927be7ecb550 * Add required value for `NSMicrophoneUsageDescription` to Reader Aims to address the App Store Connect upload issues: > ITMS-90683: Missing purpose string in Info.plist - Your app’s code references one or more APIs that access sensitive user data, or the app has one or more entitlements that permit such access. > The Info.plist file for the “Reader.app” bundle should contain a NSMicrophoneUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. > If you’re using external libraries or SDKs, they may reference APIs that require a purpose string. > While your app might not use these APIs, a purpose string is still required. > For details, visit: https://developer.apple.com/documentation/uikit/protecting_the_user_s_privacy/requesting_access_to_protected_resources. * Add required value for `NSCameraUsageDescription` to Reader Aims to address the App Store Connect upload issues: > ITMS-90683: Missing purpose string in Info.plist - Your app’s code references one or more APIs that access sensitive user data, or the app has one or more entitlements that permit such access. > The Info.plist file for the “Reader.app” bundle should contain a NSCameraUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. > If you’re using external libraries or SDKs, they may reference APIs that require a purpose string. > While your app might not use these APIs, a purpose string is still required. > For details, visit: https://developer.apple.com/documentation/uikit/protecting_the_user_s_privacy/requesting_access_to_protected_resources. * Point Reachability to Automattic's fork This addresses the App Store Connect upload issue: > ITMS-90338: Non-public API usage - The app references non-public symbols in Frameworks/Keystone.framework/Keystone: _kReachabilityChangedNotification. > If method names in your source code match the private Apple APIs listed above, altering your method names will help prevent this app from being flagged in future submissions. > In addition, note that one or more of the above APIs may be located in a static library that was included with your app. > If so, they must be removed. > For further information, visit the Technical Support Information at http://developer.apple.com/support/technical/ * Prefix `bodyTextColor` and `titleTextColor` (unsed) with `wp` This is to avoid a clash with Apple's private APIs in the dependency setup with Keystone. > ITMS-90338: Non-public API usage - The app references non-public selectors in Frameworks/Keystone.framework/Keystone: setBodyTextColor:, setTitleTextColor:. > If method names in your source code match the private Apple APIs listed above, altering your method names will help prevent this app from being flagged in future submissions. > In addition, note that one or more of the above APIs may be located in a static library that was included with your app. > If so, they must be removed. > For further information, visit the Technical Support Information at http://developer.apple.com/support/technical/ * Update Fastlane to latest version * Add `ITSAppUsesNonExemptEncryption = NO` to Reader * Disable distribution groups to attempt fixing TestFlight issue See how this build fails https://buildkite.com/automattic/wordpress-ios/builds/27323/steps?sid=01963655-580b-44c3-846f-ef84df40eb86 "Builds cannot be assigned to this internal group. - Cannot add internal group to a build." However, on TestFlight itself the build is successfully part of the group and distributed.
1 parent dbb0750 commit 4d7578f

File tree

14 files changed

+149
-28
lines changed

14 files changed

+149
-28
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash -eu
2+
3+
echo "--- :arrow_down: Downloading Artifacts"
4+
ARTIFACTS_DIR='Artifacts' # See fastlane/Fastfile BUILD_PRODUCTS_PATH
5+
STEP=build_asc_reader
6+
buildkite-agent artifact download "$ARTIFACTS_DIR/*.ipa" . --step $STEP
7+
buildkite-agent artifact download "$ARTIFACTS_DIR/*.zip" . --step $STEP
8+
9+
echo "--- :rubygems: Setting up Gems"
10+
install_gems
11+
12+
echo "--- :closed_lock_with_key: Installing Secrets"
13+
bundle exec fastlane run configure_apply
14+
15+
echo "--- :testflight: Uploading to App Store Connect"
16+
bundle exec fastlane upload_to_app_store_connect_reader

.buildkite/pipeline.yml

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,35 @@ env:
66

77
# This is the default pipeline – it will build and test the app
88
steps:
9+
- group: ":eyeglasses: Reader Builds"
10+
steps:
11+
- label: ":eyeglasses: Reader ASC Demo Build"
12+
key: build_asc_reader
13+
command: .buildkite/commands/release-build-reader.sh
14+
plugins: [$CI_TOOLKIT_PLUGIN]
15+
artifact_paths:
16+
- Artifacts/*.zip
17+
- Artifacts/*.ipa
18+
notify:
19+
- github_commit_status:
20+
context: "Reader ASC Demo Build"
921

10-
- label: ":eyeglasses: Reader ASC Demo Build"
11-
key: build_reader
12-
command: ".buildkite/commands/release-build-reader.sh"
13-
plugins: [$CI_TOOLKIT_PLUGIN]
14-
artifact_paths:
15-
- "Artifacts/*.zip"
16-
- "Artifacts/*.ipa"
17-
notify:
18-
- github_commit_status:
19-
context: "Reader ASC Demo Build"
22+
- block: Distribute Reader via TestFlight
23+
prompt: Distribute the Reader build via TestFlight?
24+
key: testflight_triggered_reader
25+
# Block steps have implicit dependency on the steps that come before them.
26+
# See https://buildkite.com/docs/pipelines/trigger-step
27+
#
28+
# Make it depend on nothing so we don't have to wait for previous steps to finish before the deployment can start.
29+
depends_on: ~
30+
31+
- label: ":eyeglasses: Reader one-off TestFlight Upload"
32+
depends_on: [build_asc_reader, testflight_triggered_reader]
33+
command: .buildkite/commands/release-upload-reader.sh
34+
plugins: [$CI_TOOLKIT_PLUGIN]
35+
notify:
36+
- github_commit_status:
37+
context: "Reader one-off TestFlight Upload"
2038

2139
#################
2240
# Create Prototype Builds for WP and JP

.buildkite/reader-testflight.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json
2+
---
3+
4+
steps:
5+
- label: ":eyeglasses: :xcode: Reader App Store Connect Build"
6+
command: .buildkite/commands/release-build-reader.sh
7+
key: reader_asc_build
8+
plugins: [$CI_TOOLKIT_PLUGIN]
9+
agents:
10+
queue: mac
11+
env:
12+
IMAGE_ID: $IMAGE_ID
13+
artifact_paths:
14+
- Artifacts/*.zip
15+
- Artifacts/*.ipa
16+
notify:
17+
- slack: "#build-and-ship"
18+
19+
- label: ":eyeglasses: :testflight: Reader App Store Connect Upload"
20+
depends_on: reader_asc_build
21+
command: .buildkite/commands/release-upload-reader.sh
22+
plugins: [$CI_TOOLKIT_PLUGIN]
23+
agents:
24+
queue: mac
25+
env:
26+
IMAGE_ID: $IMAGE_ID
27+
notify:
28+
- slack: "#build-and-ship"

Gemfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ GEM
2424
ast (2.4.3)
2525
atomos (0.1.3)
2626
aws-eventstream (1.3.2)
27-
aws-partitions (1.1078.0)
27+
aws-partitions (1.1086.0)
2828
aws-sdk-core (3.222.1)
2929
aws-eventstream (~> 1, >= 1.3.0)
3030
aws-partitions (~> 1, >= 1.992.0)
@@ -125,7 +125,7 @@ GEM
125125
faraday_middleware (1.2.1)
126126
faraday (~> 1.0)
127127
fastimage (2.4.0)
128-
fastlane (2.227.0)
128+
fastlane (2.227.1)
129129
CFPropertyList (>= 2.3, < 4.0.0)
130130
addressable (>= 2.8, < 3.0.0)
131131
artifactory (~> 3.0)
@@ -165,7 +165,7 @@ GEM
165165
tty-spinner (>= 0.8.0, < 1.0.0)
166166
word_wrap (~> 1.0.0)
167167
xcodeproj (>= 1.13.0, < 2.0.0)
168-
xcpretty (~> 0.4.0)
168+
xcpretty (~> 0.4.1)
169169
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
170170
fastlane-plugin-firebase_app_distribution (0.10.0)
171171
google-apis-firebaseappdistribution_v1 (~> 0.3.0)

Modules/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ let package = Package(
4242
.package(url: "https://github.com/scinfu/SwiftSoup", exact: "2.7.5"),
4343
.package(url: "https://github.com/squarefrog/UIDeviceIdentifier", from: "2.3.0"),
4444
.package(url: "https://github.com/SVProgressHUD/SVProgressHUD", from: "2.3.1"),
45-
.package(url: "https://github.com/tonymillion/Reachability", from: "3.7.5"),
45+
.package(url: "https://github.com/Automattic/Reachability", branch: "framework-support-via-spm"),
4646
.package(url: "https://github.com/weichsel/ZIPFoundation", from: "0.9.19"),
4747
.package(url: "https://github.com/wordpress-mobile/FSInteractiveMap", from: "0.3.0"),
4848
.package(url: "https://github.com/wordpress-mobile/MediaEditor-iOS", branch: "task/spm-support"),

Modules/Sources/WordPressShared/Reachability/Notification+Reachability.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ public extension Notification {
55
}
66

77
public extension Notification.Name {
8-
/// - warning: Using a different name that auto-imported `kReachabilityChangedNotification`.
8+
/// - warning: Using a different name that auto-imported `kTMReachabilityChangedNotification` from the Reachability package.
99
static var reachabilityUpdated: Notification.Name {
1010
return Notification.Name("\(Notification.reachabilityKey).updated")
1111
}

Modules/Sources/WordPressUI/FancyAlert/FancyAlertView.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ open class FancyAlertView: UIView {
6262

6363
/// TitleLabel: textColor
6464
///
65-
@objc public dynamic var titleTextColor: UIColor? {
65+
/// Notice the "wp" prefix to avoid clashing with Apple's private API.
66+
@objc public dynamic var wpTitleTextColor: UIColor? {
6667
get {
6768
return titleLabel.textColor
6869
}
@@ -73,7 +74,8 @@ open class FancyAlertView: UIView {
7374

7475
/// BodyLabel: textColor
7576
///
76-
@objc public dynamic var bodyTextColor: UIColor? {
77+
/// Notice the "wp" prefix to avoid clashing with Apple's private API.
78+
@objc public dynamic var wpBodyTextColor: UIColor? {
7779
get {
7880
return bodyLabel.textColor
7981
}

WordPress.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

WordPress/Classes/Extensions/Colors and Styles/WPStyleGuide+ApplicationStyles.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ extension WPStyleGuide {
7272
private static func setupFancyAlertAppearance() {
7373
let appearance = FancyAlertView.appearance()
7474

75-
appearance.titleTextColor = UIAppColor.neutral(.shade70)
75+
appearance.wpTitleTextColor = UIAppColor.neutral(.shade70)
7676
appearance.titleFont = WPStyleGuide.fontForTextStyle(.title2, fontWeight: .semibold)
7777

78-
appearance.bodyTextColor = UIAppColor.neutral(.shade70)
78+
appearance.wpBodyTextColor = UIAppColor.neutral(.shade70)
7979
appearance.bodyFont = WPStyleGuide.fontForTextStyle(.body)
8080
appearance.bodyBackgroundColor = UIAppColor.neutral(.shade0)
8181

WordPress/Classes/ViewRelated/Stats/StatsViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ - (void)viewDidLoad
6767
self.title = self.blog.settings.name;
6868
}
6969

70-
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reachabilityChanged:) name:kReachabilityChangedNotification object:ReachabilityUtils.internetReachability];
70+
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reachabilityChanged:) name:kTMReachabilityChangedNotification object:ReachabilityUtils.internetReachability];
7171

7272
[self initStats];
7373
}

0 commit comments

Comments
 (0)