Skip to content

Instantly share code, notes, and snippets.

@micimize
Last active May 5, 2020 19:36
Show Gist options
  • Save micimize/624519c113525f84ea3e9f6de7a3077f to your computer and use it in GitHub Desktop.
Save micimize/624519c113525f84ea3e9f6de7a3077f to your computer and use it in GitHub Desktop.
Notes from troubleshooting fastlane CI/CD with github actions (iOS only atm)

My #1 piece of advice here is that if you're an independent app developer using a personal apple id, put CI/CD off for a while and just release from local. Just because something can be automated doesn't mean it should

In hindsight, implementing CI before feeling the crunch to scale was not worth the time and was a premature optimization. Being enrolled as an Organization also allows for easier and more idiomatic setups.

  • Read the fastlane CI best practices and these tips before getting started, not just for troubleshooting

  • You're in a very slow troubleshooting loop where you need to push-to-test.
    act --no-container probably won't even change that because your local keychain will be different

  • (I think) you'll need to use match, and (I think) an appstore cert even for testflight

  • set manual signing iOS after match appstore (will need to restart xcode)

    should see something like 2_code_signing.patch in the resulting git diff

  • (I think) this keychain password prompt issue was one of the things preventing code signing capabilities.

  • Check your logs carefully every failure and avoid hair-pulling mode

  • If you get prompts from match like "Did you create the bucket?" for google cloud, you likely aren't passing the bucket name (or other credentials) all the way down

  • Omitted from the general 2fa docs is that you need skip_waiting_for_build_processing and apple_id to only use FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD for upload_to_testflight

  • upload_to_test_flight's apple_id is different from that supplied elsewhere -
    it is the "Apple ID property in the App Information section in App Store Connect", not your top-level apple_id.

diff --git a/app/ios/Runner.xcodeproj/project.pbxproj b/app/ios/Runner.xcodeproj/project.pbxproj
index d021f95..3e0d0b6 100644
--- a/app/ios/Runner.xcodeproj/project.pbxproj
+++ b/app/ios/Runner.xcodeproj/project.pbxproj
@@ -174,6 +174,7 @@
CreatedOnToolsVersion = 7.3.1;
DevelopmentTeam = TEAMID;
LastSwiftMigration = 1100;
+ ProvisioningStyle = Manual;
};
};
};
@@ -354,8 +355,8 @@
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- CODE_SIGN_IDENTITY = "Apple Development";
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ CODE_SIGN_IDENTITY = "iPhone Distribution";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
@@ -383,6 +384,8 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "iPhone Distribution";
+ CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = TEAMID;
ENABLE_BITCODE = NO;
@@ -398,6 +401,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = app.bundle.identifier;
PRODUCT_NAME = "$(TARGET_NAME)";
+ PROVISIONING_PROFILE_SPECIFIER = "match AppStore app.bundle.identifier";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
@@ -490,8 +494,8 @@
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- CODE_SIGN_IDENTITY = "Apple Development";
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ CODE_SIGN_IDENTITY = "iPhone Distribution";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
@@ -520,6 +524,8 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "iPhone Distribution";
+ CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = DL9M47DUL7;
ENABLE_BITCODE = NO;
@@ -535,6 +541,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = app.bundle.identifier;
PRODUCT_NAME = "$(TARGET_NAME)";
+ PROVISIONING_PROFILE_SPECIFIER = "match AppStore app.bundle.identifier";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
@@ -548,6 +555,8 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "iPhone Distribution";
+ CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = DL9M47DUL7;
ENABLE_BITCODE = NO;
@@ -563,6 +572,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = app.bundle.identifier;
PRODUCT_NAME = "$(TARGET_NAME)";
+ PROVISIONING_PROFILE_SPECIFIER = "match AppStore app.bundle.identifier";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
@micimize
Copy link
Author

micimize commented May 5, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment