From 8ba1b433496d6c9eff4289332d47b855a8afdce1 Mon Sep 17 00:00:00 2001 From: Igor Mandrigin Date: Wed, 24 Oct 2018 10:18:56 +0200 Subject: [PATCH] Auto-update provisioning profiles when building PRs and nightlies on Jenkins. Signed-off-by: Igor Mandrigin --- Gemfile.lock | 31 +++++++++++++++++++++---------- fastlane/Fastfile | 16 ++++++++++------ 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 84261ec2eb..de2819dd31 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -13,20 +13,21 @@ GEM highline (~> 1.7.2) declarative (0.0.10) declarative-option (0.1.0) + digest-crc (0.4.1) domain_name (0.5.20180417) unf (>= 0.0.5, < 1.0.0) dotenv (2.5.0) emoji_regex (0.1.1) excon (0.62.0) - faraday (0.15.3) + faraday (0.15.4) multipart-post (>= 1.2, < 3) faraday-cookie_jar (0.0.6) faraday (>= 0.7.4) http-cookie (~> 1.0.0) faraday_middleware (0.12.2) faraday (>= 0.7.4, < 1.0) - fastimage (2.1.4) - fastlane (2.107.0) + fastimage (2.1.5) + fastlane (2.112.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.3, < 3.0.0) babosa (>= 1.0.2, < 2.0.0) @@ -42,6 +43,7 @@ GEM fastimage (>= 2.1.0, < 3.0.0) gh_inspector (>= 1.1.2, < 2.0.0) google-api-client (>= 0.21.2, < 0.24.0) + google-cloud-storage (>= 1.15.0, < 2.0.0) highline (>= 1.7.2, < 2.0.0) json (< 3.0.0) mini_magick (~> 4.5.1) @@ -63,7 +65,7 @@ GEM xcpretty (~> 0.3.0) xcpretty-travis-formatter (>= 0.0.3) fastlane-plugin-clean_testflight_testers (0.2.0) - fastlane-plugin-diawi (1.2.0) + fastlane-plugin-diawi (1.3.0) rest-client (>= 2.0.0) gh_inspector (1.1.3) google-api-client (0.23.9) @@ -74,10 +76,19 @@ GEM representable (~> 3.0) retriable (>= 2.0, < 4.0) signet (~> 0.9) - googleauth (0.6.6) + google-cloud-core (1.2.7) + google-cloud-env (~> 1.0) + google-cloud-env (1.0.5) + faraday (~> 0.11) + google-cloud-storage (1.15.0) + digest-crc (~> 0.4) + google-api-client (~> 0.23) + google-cloud-core (~> 1.2) + googleauth (~> 0.6.2) + googleauth (0.6.7) faraday (~> 0.12) jwt (>= 1.4, < 3.0) - memoist (~> 0.12) + memoist (~> 0.16) multi_json (~> 1.11) os (>= 0.9, < 2.0) signet (~> 0.7) @@ -127,15 +138,15 @@ GEM unicode-display_width (~> 1.1, >= 1.1.1) tty-cursor (0.6.0) tty-screen (0.6.5) - tty-spinner (0.8.0) - tty-cursor (>= 0.5.0) + tty-spinner (0.9.0) + tty-cursor (~> 0.6.0) uber (0.1.0) unf (0.1.4) unf_ext unf_ext (0.0.7.5) unicode-display_width (1.4.0) word_wrap (1.0.0) - xcodeproj (1.6.0) + xcodeproj (1.7.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) @@ -155,4 +166,4 @@ DEPENDENCIES fastlane-plugin-diawi BUNDLED WITH - 1.16.6 + 1.17.2 diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 8cc1a0afd1..925ff3d5d5 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -53,11 +53,14 @@ end # builds an ios app with ad-hoc configuration and put it # to "status-adhoc" output folder -def build_ios_adhoc +# `readonly`: +# if true - only fetch existing certificates and profiles, don't upgrade from AppStoreConnect +# if false - read list of devices from AppStoreConnect, and upgrade the provisioning profiles from it +def build_ios_adhoc(readonly) match( type: "adhoc", force_for_new_devices: true, - readonly: true, + readonly: readonly, keychain_name: "login.keychain" ) @@ -133,7 +136,7 @@ platform :ios do desc "This .ipa is ready to be distibuted through diawi.com" lane :adhoc do unlock_keychain_if_needed - build_ios_adhoc + build_ios_adhoc(true) end desc "`fastlane ios e2e` - e2e lane for iOS." @@ -147,20 +150,21 @@ platform :ios do desc "`fastlane ios pr` - makes a new pr build" desc "This lane builds a new adhoc build and leaves an .ipa that is ad-hoc signed (can be uploaded to diawi)" lane :pr do - adhoc + unlock_keychain_if_needed + build_ios_adhoc(false) end desc "`fastlane ios nightly` - makes a new nightly" desc "This lane builds a new nightly and leaves an .ipa that is ad-hoc signed (can be uploaded to diawi)" lane :nightly do - adhoc + unlock_keychain_if_needed + build_ios_adhoc(false) end desc "`fastlane ios release` builds a release & uploads it to TestFlight" lane :release do match( type: "appstore", - force_for_new_devices: true, readonly: true, keychain_name: "login.keychain" )