From 52cfe079e84e02b315e791d78d24eb8abb173df2 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Tue, 13 Oct 2020 17:44:59 -0300 Subject: [PATCH] [CHORE] Use App Store Connect API Key (#2549) * [CHORE] Use App Store Connect API Key * Update bundle * rollback keychain * Remove keychain * Keychain is actually needed * Update gitignore --- .circleci/config.yml | 6 +-- .gitignore | 4 +- ios/Gemfile.lock | 93 ++++++++++++++++++++--------------------- ios/fastlane/Fastfile | 62 +++++++++++---------------- ios/fastlane/report.xml | 57 ------------------------- 5 files changed, 76 insertions(+), 146 deletions(-) delete mode 100644 ios/fastlane/report.xml diff --git a/.circleci/config.yml b/.circleci/config.yml index 7667897cc..5f8110d9a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -343,11 +343,10 @@ jobs: agvtool new-version -all $CIRCLE_BUILD_NUM /usr/libexec/PlistBuddy -c "Set BugsnagAPIKey $BUGSNAG_KEY" ./RocketChatRN/Info.plist - if [[ $MATCH_KEYCHAIN_NAME ]]; then + if [[ $APP_STORE_CONNECT_API_KEY ]]; then + echo $APP_STORE_CONNECT_API_KEY | base64 --decode > ./fastlane/app_store_connect_api_key.p8 bundle exec fastlane ios release else - export MATCH_KEYCHAIN_NAME="temp" - export MATCH_KEYCHAIN_PASSWORD="temp" bundle exec fastlane ios build fi working_directory: ios @@ -381,6 +380,7 @@ jobs: - run: name: Fastlane Tesflight Upload command: | + echo $APP_STORE_CONNECT_API_KEY | base64 --decode > ./fastlane/app_store_connect_api_key.p8 bundle exec fastlane ios beta working_directory: ios diff --git a/.gitignore b/.gitignore index 18624dd0b..3d1baa215 100644 --- a/.gitignore +++ b/.gitignore @@ -61,4 +61,6 @@ coverage artifacts .vscode/ e2e/docker/rc_test_env/docker-compose.yml -e2e/docker/data/db \ No newline at end of file +e2e/docker/data/db + +*.p8 \ No newline at end of file diff --git a/ios/Gemfile.lock b/ios/Gemfile.lock index 058d663b4..904e489a5 100644 --- a/ios/Gemfile.lock +++ b/ios/Gemfile.lock @@ -6,70 +6,69 @@ GEM public_suffix (>= 2.0.2, < 5.0) atomos (0.1.3) aws-eventstream (1.1.0) - aws-partitions (1.310.0) - aws-sdk-core (3.94.1) + aws-partitions (1.381.0) + aws-sdk-core (3.109.1) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) aws-sigv4 (~> 1.1) jmespath (~> 1.0) - aws-sdk-kms (1.30.0) - aws-sdk-core (~> 3, >= 3.71.0) + aws-sdk-kms (1.39.0) + aws-sdk-core (~> 3, >= 3.109.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.63.1) - aws-sdk-core (~> 3, >= 3.83.0) + aws-sdk-s3 (1.83.0) + aws-sdk-core (~> 3, >= 3.109.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.1) - aws-sigv4 (1.1.3) - aws-eventstream (~> 1.0, >= 1.0.2) - babosa (1.0.3) + aws-sigv4 (1.2.2) + aws-eventstream (~> 1, >= 1.0.2) + babosa (1.0.4) claide (1.0.3) colored (1.2) colored2 (3.1.2) commander-fastlane (4.4.6) highline (~> 1.7.2) - declarative (0.0.10) + declarative (0.0.20) declarative-option (0.1.0) - digest-crc (0.5.1) + digest-crc (0.6.1) + rake (~> 13.0) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) - dotenv (2.7.5) - emoji_regex (1.0.1) - excon (0.73.0) - faraday (0.17.3) + dotenv (2.7.6) + emoji_regex (3.0.0) + excon (0.76.0) + faraday (1.0.1) multipart-post (>= 1.2, < 3) - faraday-cookie_jar (0.0.6) - faraday (>= 0.7.4) + faraday-cookie_jar (0.0.7) + faraday (>= 0.8.0) http-cookie (~> 1.0.0) - faraday_middleware (0.13.1) - faraday (>= 0.7.4, < 1.0) - fastimage (2.1.7) - fastlane (2.146.1) + faraday_middleware (1.0.0) + faraday (~> 1.0) + fastimage (2.2.0) + fastlane (2.163.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.3, < 3.0.0) aws-sdk-s3 (~> 1.0) - babosa (>= 1.0.2, < 2.0.0) + babosa (>= 1.0.3, < 2.0.0) bundler (>= 1.12.0, < 3.0.0) colored commander-fastlane (>= 4.4.6, < 5.0.0) dotenv (>= 2.1.1, < 3.0.0) - emoji_regex (>= 0.1, < 2.0) + emoji_regex (>= 0.1, < 4.0) excon (>= 0.71.0, < 1.0.0) - faraday (~> 0.17) + faraday (~> 1.0) faraday-cookie_jar (~> 0.0.6) - faraday_middleware (~> 0.13.1) + faraday_middleware (~> 1.0) fastimage (>= 2.1.0, < 3.0.0) gh_inspector (>= 1.1.2, < 2.0.0) - google-api-client (>= 0.29.2, < 0.37.0) + google-api-client (>= 0.37.0, < 0.39.0) google-cloud-storage (>= 1.15.0, < 2.0.0) highline (>= 1.7.2, < 2.0.0) json (< 3.0.0) - jwt (~> 2.1.0) + jwt (>= 2.1.0, < 3) mini_magick (>= 4.9.4, < 5.0.0) - multi_xml (~> 0.5) multipart-post (~> 2.0.0) plist (>= 3.1.0, < 4.0.0) - public_suffix (~> 2.0.0) - rubyzip (>= 1.3.0, < 2.0.0) + rubyzip (>= 2.0.0, < 3.0.0) security (= 0.1.3) simctl (~> 1.6.3) slack-notifier (>= 2.0.0, < 3.0.0) @@ -82,7 +81,7 @@ GEM xcpretty (~> 0.3.0) xcpretty-travis-formatter (>= 0.0.3) gh_inspector (1.1.3) - google-api-client (0.36.4) + google-api-client (0.38.0) addressable (~> 2.5, >= 2.5.1) googleauth (~> 0.9) httpclient (>= 2.8.1, < 3.0) @@ -93,17 +92,17 @@ GEM google-cloud-core (1.5.0) google-cloud-env (~> 1.0) google-cloud-errors (~> 1.0) - google-cloud-env (1.3.1) + google-cloud-env (1.4.0) faraday (>= 0.17.3, < 2.0) - google-cloud-errors (1.0.0) - google-cloud-storage (1.26.1) + google-cloud-errors (1.0.1) + google-cloud-storage (1.29.1) addressable (~> 2.5) digest-crc (~> 0.4) google-api-client (~> 0.33) google-cloud-core (~> 1.2) googleauth (~> 0.9) mini_mime (~> 1.0) - googleauth (0.12.0) + googleauth (0.14.0) faraday (>= 0.17.3, < 2.0) jwt (>= 1.4, < 3.0) memoist (~> 0.16) @@ -115,26 +114,26 @@ GEM domain_name (~> 0.5) httpclient (2.8.3) jmespath (1.4.0) - json (2.3.0) - jwt (2.1.0) + json (2.3.1) + jwt (2.2.2) memoist (0.16.2) mini_magick (4.10.1) mini_mime (1.0.2) - multi_json (1.14.1) - multi_xml (0.6.0) + multi_json (1.15.0) multipart-post (2.0.0) - nanaimo (0.2.6) + nanaimo (0.3.0) naturally (2.2.0) - os (1.1.0) + os (1.1.1) plist (3.5.0) - public_suffix (2.0.5) + public_suffix (4.0.6) + rake (13.0.1) representable (3.0.4) declarative (< 0.1.0) declarative-option (< 0.2.0) uber (< 0.2.0) retriable (3.1.2) rouge (2.0.7) - rubyzip (1.3.0) + rubyzip (2.3.0) security (0.1.3) signet (0.14.0) addressable (~> 2.3) @@ -149,7 +148,7 @@ GEM terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) tty-cursor (0.7.1) - tty-screen (0.7.1) + tty-screen (0.8.1) tty-spinner (0.9.3) tty-cursor (~> 0.7) uber (0.1.0) @@ -158,12 +157,12 @@ GEM unf_ext (0.0.7.7) unicode-display_width (1.7.0) word_wrap (1.0.0) - xcodeproj (1.16.0) + xcodeproj (1.19.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) colored2 (~> 3.1) - nanaimo (~> 0.2.6) + nanaimo (~> 0.3.0) xcpretty (0.3.0) rouge (~> 2.0.7) xcpretty-travis-formatter (1.0.0) @@ -176,4 +175,4 @@ DEPENDENCIES fastlane BUNDLED WITH - 2.0.2 + 2.1.4 diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile index 46de9f08b..0b014fce6 100644 --- a/ios/fastlane/Fastfile +++ b/ios/fastlane/Fastfile @@ -17,15 +17,12 @@ default_platform :ios platform :ios do before_all do - # ENV["SLACK_URL"] = "https://hooks.slack.com/services/..." - # cocoapods - # carthage - setup_circle_ci - create_keychain( - name: ENV["MATCH_KEYCHAIN_NAME"], - password: ENV["MATCH_KEYCHAIN_PASSWORD"], - timeout: 1200 - ) + setup_circle_ci + create_keychain( + name: ENV["MATCH_KEYCHAIN_NAME"], + password: ENV["MATCH_KEYCHAIN_PASSWORD"], + timeout: 1200 + ) end desc "Runs all the tests" @@ -35,6 +32,12 @@ platform :ios do desc "Submit a new Beta Build to Apple TestFlight" lane :beta do + api_key = app_store_connect_api_key( + key_id: "F296L2294Y", + issuer_id: "69a6de8e-75cf-47e3-e053-5b8c7c11a4d1", + key_filepath: 'fastlane/app_store_connect_api_key.p8', + in_house: false + ) pilot( ipa: 'ios/RocketChatRN.ipa', skip_waiting_for_build_processing: true @@ -43,16 +46,17 @@ platform :ios do desc "Build App for release" lane :release do - # match(type: "appstore") - # snapshot - match( - type: "appstore" - ) # more information: https://codesigning.guide + api_key = app_store_connect_api_key( + key_id: "F296L2294Y", + issuer_id: "69a6de8e-75cf-47e3-e053-5b8c7c11a4d1", + key_filepath: 'fastlane/app_store_connect_api_key.p8', + in_house: false + ) + match(type: "appstore") get_provisioning_profile(app_identifier: "chat.rocket.reactnative.ShareExtension") get_provisioning_profile(app_identifier: "chat.rocket.reactnative.NotificationService") - pem() - gym(scheme: "RocketChatRN", workspace: "RocketChatRN.xcworkspace") # Build your app - more options available - # frameit + # pem(api_key: api_key) # still uses Spaceship http://docs.fastlane.tools/actions/pem/#how-does-it-work + gym(scheme: "RocketChatRN", workspace: "RocketChatRN.xcworkspace") end desc "Build App for development" @@ -71,29 +75,11 @@ platform :ios do ) end - # You can define as many lanes as you want - after_all do |lane| - # This block is called, only if the executed lane was successful - - # slack( - # message: "Successfully deployed new App Update." - # ) - delete_keychain(name: ENV["MATCH_KEYCHAIN_NAME"]) - end + delete_keychain(name: ENV["MATCH_KEYCHAIN_NAME"]) + end error do |lane, exception| - # slack( - # message: exception.message, - # success: false - # ) - delete_keychain(name: ENV["MATCH_KEYCHAIN_NAME"]) + delete_keychain(name: ENV["MATCH_KEYCHAIN_NAME"]) end end - - -# More information about multiple platforms in fastlane: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md -# All available actions: https://docs.fastlane.tools/actions - -# fastlane reports which actions are used. No personal data is recorded. -# Learn more at https://docs.fastlane.tools/#metrics diff --git a/ios/fastlane/report.xml b/ios/fastlane/report.xml deleted file mode 100644 index 6c645d47d..000000000 --- a/ios/fastlane/report.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -