From 94b5766da45bc15789b5744d477020be5172ff46 Mon Sep 17 00:00:00 2001 From: Matthew Lorentz Date: Fri, 15 Dec 2023 11:00:47 -0500 Subject: [PATCH] Switch to match for certificate management --- .github/workflows/deploy-to-testflight.yml | 5 ++++ Nos.xcodeproj/project.pbxproj | 23 ++++++++------- fastlane/Fastfile | 33 +++++++++++++++++++--- fastlane/README.md | 16 +++++++++++ 4 files changed, 63 insertions(+), 14 deletions(-) diff --git a/.github/workflows/deploy-to-testflight.yml b/.github/workflows/deploy-to-testflight.yml index 876410d8a..56061d9e0 100644 --- a/.github/workflows/deploy-to-testflight.yml +++ b/.github/workflows/deploy-to-testflight.yml @@ -15,6 +15,10 @@ jobs: - name: Checkout uses: actions/checkout@main - uses: nomasystems/action-xcode-select@v0.1 + - name: Install SSH key + uses: shimataro/ssh-key-action@v2 + with: + key: ${{ Secrets.SSH_KEY }} - name: Deploy with fastlane run: | bundle install @@ -23,3 +27,4 @@ jobs: APP_STORE_CONNECT_API_KEY_CONTENT: ${{Secrets. APP_STORE_CONNECT_API_KEY_CONTENT}} APP_STORE_CONNECT_ISSUER_ID: ${{Secrets. APP_STORE_CONNECT_ISSUER_ID}} APP_STORE_CONNECT_API_KEY_ID: ${{Secrets. APP_STORE_CONNECT_API_KEY_ID}} + MATCH_PASSWORD: ${{ Secrets.MATCH_PASSWORD }} diff --git a/Nos.xcodeproj/project.pbxproj b/Nos.xcodeproj/project.pbxproj index 85d152dd1..6855cdd14 100644 --- a/Nos.xcodeproj/project.pbxproj +++ b/Nos.xcodeproj/project.pbxproj @@ -1963,7 +1963,7 @@ isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 101; + CURRENT_PROJECT_VERSION = 111; DEVELOPMENT_TEAM = GZCZBKH7MY; GCC_OPTIMIZATION_LEVEL = s; GENERATE_INFOPLIST_FILE = YES; @@ -1984,7 +1984,7 @@ isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 101; + CURRENT_PROJECT_VERSION = 111; DEVELOPMENT_TEAM = GZCZBKH7MY; GENERATE_INFOPLIST_FILE = YES; IPHONEOS_DEPLOYMENT_TARGET = 16.2; @@ -2131,7 +2131,7 @@ CODE_SIGN_IDENTITY = "-"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 101; + CURRENT_PROJECT_VERSION = 111; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = "\"Nos/Views/Preview Content\""; DEVELOPMENT_TEAM = GZCZBKH7MY; @@ -2181,11 +2181,12 @@ CODE_SIGN_ENTITLEMENTS = Nos/Nos.entitlements; CODE_SIGN_IDENTITY = "-"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 101; + CODE_SIGN_STYLE = Manual; + CURRENT_PROJECT_VERSION = 111; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = "\"Nos/Views/Preview Content\""; - DEVELOPMENT_TEAM = GZCZBKH7MY; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = GZCZBKH7MY; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; ENABLE_USER_SCRIPT_SANDBOXING = NO; @@ -2210,6 +2211,8 @@ MARKETING_VERSION = 0.1; PRODUCT_BUNDLE_IDENTIFIER = com.verse.Nos; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AppStore com.verse.Nos"; SDKROOT = auto; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; @@ -2225,7 +2228,7 @@ buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 101; + CURRENT_PROJECT_VERSION = 111; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = GZCZBKH7MY; GCC_OPTIMIZATION_LEVEL = 0; @@ -2251,7 +2254,7 @@ buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 101; + CURRENT_PROJECT_VERSION = 111; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = GZCZBKH7MY; GENERATE_INFOPLIST_FILE = YES; @@ -2275,7 +2278,7 @@ buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 101; + CURRENT_PROJECT_VERSION = 111; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = GZCZBKH7MY; GCC_OPTIMIZATION_LEVEL = 0; @@ -2300,7 +2303,7 @@ buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 101; + CURRENT_PROJECT_VERSION = 111; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = GZCZBKH7MY; GENERATE_INFOPLIST_FILE = YES; diff --git a/fastlane/Fastfile b/fastlane/Fastfile index e2704f445..86adf212c 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -16,17 +16,22 @@ default_platform(:ios) platform :ios do + asc_key_content = ENV["APP_STORE_CONNECT_API_KEY_CONTENT"] + asc_issuer_id = ENV["APP_STORE_CONNECT_ISSUER_ID"] + asc_key_id = ENV["APP_STORE_CONNECT_API_KEY_ID"] + GIT_AUTHORIZATION = ENV["GIT_AUTHORIZATION"] + TEMP_KEYCHAIN_USER = ENV["TEMP_KEYCHAIN_USER"] + TEMP_KEYCHAIN_PASSWORD = ENV["TEMP_KEYCHAIN_PASSWORD"] + desc "Push a new beta build to TestFlight" lane :beta do #xcodes # ensure correct version of xcode is installed and selected - asc_key_content = ENV["APP_STORE_CONNECT_API_KEY_CONTENT"] - asc_issuer_id = ENV["APP_STORE_CONNECT_ISSUER_ID"] - asc_key_id = ENV["APP_STORE_CONNECT_API_KEY_ID"] app_store_connect_api_key( key_id: asc_key_id, issuer_id: asc_issuer_id, key_content: asc_key_content ) + match(type: "appstore") increment_build_number(xcodeproj: "Nos.xcodeproj") version_number = get_version_number( xcodeproj: "Nos.xcodeproj", @@ -36,7 +41,7 @@ platform :ios do gym( scheme: "Nos", clean: true, - xcargs: "-skipPackagePluginValidation -allowProvisioningUpdates" + xcargs: "-skipPackagePluginValidation" ) changelog = read_changelog upload_to_testflight(changelog: changelog) @@ -57,6 +62,26 @@ platform :ios do open: "https://appstoreconnect.apple.com/apps/1670125746/testflight/ios" ) end + + desc "Refresh certificates in the match repo" + lane :certs do + app_store_connect_api_key( + key_id: asc_key_id, + issuer_id: asc_issuer_id, + key_content: asc_key_content + ) + match(type: "appstore") + end + + desc "Clean App Store Connect of certificates" + lane :nuke_certs do + app_store_connect_api_key( + key_id: asc_key_id, + issuer_id: asc_issuer_id, + key_content: asc_key_content + ) + match_nuke(type: "appstore") + end end # Dynamically define 3 lanes: diff --git a/fastlane/README.md b/fastlane/README.md index 2b4d5c6d3..32bfdb3f5 100644 --- a/fastlane/README.md +++ b/fastlane/README.md @@ -50,6 +50,22 @@ For _fastlane_ installation instructions, see [Installing _fastlane_](https://do Push a new beta build to TestFlight +### ios certs + +```sh +[bundle exec] fastlane ios certs +``` + +Refresh certificates in the match repo + +### ios nuke_certs + +```sh +[bundle exec] fastlane ios nuke_certs +``` + +Clean App Store Connect of certificates + ---- This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run.