From fbb90c708ad201cafe203381091a8c1ff57f62de Mon Sep 17 00:00:00 2001 From: IlarionHalushka Date: Tue, 2 Jul 2019 09:42:20 +0300 Subject: [PATCH 01/23] feat: add fastlane save\restore cache config; comment not needed jobs; --- .circleci/config.yml | 122 ++++++++++++++++++++++-------------------- ios/Gemfile | 2 + ios/fastlane/Fastfile | 1 + 3 files changed, 68 insertions(+), 57 deletions(-) create mode 100644 ios/Gemfile diff --git a/.circleci/config.yml b/.circleci/config.yml index 3caf381e33e..1eb98ec3e64 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -174,6 +174,9 @@ jobs: steps: - checkout + - restore_cache: + key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }} + - run: name: Install Node 8 command: | @@ -190,40 +193,45 @@ jobs: brew install ruby sudo gem install fastlane - - run: - name: Install NPM modules - command: | - yarn - - - run: - name: Set Google Services - command: | - cd ios - cp GoogleService-Info.prod.plist GoogleService-Info.plist - - - run: - name: Fastlane Build - no_output_timeout: 1200 - command: | - cd ios - agvtool new-version -all $CIRCLE_BUILD_NUM - - if [[ $MATCH_KEYCHAIN_NAME ]]; then - fastlane ios release - else - export MATCH_KEYCHAIN_NAME="temp" - export MATCH_KEYCHAIN_PASSWORD="temp" - fastlane ios build - fi - - - store_artifacts: - path: ios/RocketChatRN.ipa - - - persist_to_workspace: - root: . + - save_cache: + key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }} paths: - - ios/*.ipa - - ios/fastlane/report.xml + - vendor/bundle + +# - run: +# name: Install NPM modules +# command: | +# yarn +# +# - run: +# name: Set Google Services +# command: | +# cd ios +# cp GoogleService-Info.prod.plist GoogleService-Info.plist + +# - run: +# name: Fastlane Build +# no_output_timeout: 1200 +# command: | +# cd ios +# agvtool new-version -all $CIRCLE_BUILD_NUM +# +# if [[ $MATCH_KEYCHAIN_NAME ]]; then +# fastlane ios release +# else +# export MATCH_KEYCHAIN_NAME="temp" +# export MATCH_KEYCHAIN_PASSWORD="temp" +# fastlane ios build +# fi +# +# - store_artifacts: +# path: ios/RocketChatRN.ipa +# +# - persist_to_workspace: +# root: . +# paths: +# - ios/*.ipa +# - ios/fastlane/report.xml ios-testflight: macos: @@ -252,27 +260,27 @@ workflows: version: 2 build-and-test: jobs: - - lint-testunit - - - e2e-hold: - type: approval - requires: - - lint-testunit - - e2e-test: - requires: - - e2e-hold - - - ios-build: - requires: - - lint-testunit - - ios-hold-testflight: - type: approval - requires: - - ios-build - - ios-testflight: - requires: - - ios-hold-testflight - - - android-build: - requires: - - lint-testunit +# - lint-testunit +# +# - e2e-hold: +# type: approval +# requires: +# - lint-testunit +# - e2e-test: +# requires: +# - e2e-hold + + - ios-build +# requires: +# - lint-testunit +# - ios-hold-testflight: +# type: approval +# requires: +# - ios-build +# - ios-testflight: +# requires: +# - ios-hold-testflight +# +# - android-build: +# requires: +# - lint-testunit diff --git a/ios/Gemfile b/ios/Gemfile new file mode 100644 index 00000000000..806dc3170d1 --- /dev/null +++ b/ios/Gemfile @@ -0,0 +1,2 @@ +source "https://rubygems.org" +gem 'fastlane' diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile index a4e06992de2..e7c66e6a66e 100644 --- a/ios/fastlane/Fastfile +++ b/ios/fastlane/Fastfile @@ -20,6 +20,7 @@ platform :ios 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"], From 39d0f184b71c98ebf6e907a129e20a9c2b06c3f0 Mon Sep 17 00:00:00 2001 From: IlarionHalushka Date: Tue, 2 Jul 2019 09:51:52 +0300 Subject: [PATCH 02/23] install fastlane using 'bundle install' --- .circleci/config.yml | 24 +++---- ios/Gemfile.lock | 159 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 170 insertions(+), 13 deletions(-) create mode 100644 ios/Gemfile.lock diff --git a/.circleci/config.yml b/.circleci/config.yml index 1eb98ec3e64..284236074e3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -186,18 +186,6 @@ jobs: set +e nvm install 8 - - run: - name: Update Fastlane - command: | - brew update - brew install ruby - sudo gem install fastlane - - - save_cache: - key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }} - paths: - - vendor/bundle - # - run: # name: Install NPM modules # command: | @@ -206,9 +194,19 @@ jobs: # - run: # name: Set Google Services # command: | -# cd ios # cp GoogleService-Info.prod.plist GoogleService-Info.plist + - run: + name: Update Fastlane + command: | + cd ios + bundle install + + - save_cache: + key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }} + paths: + - vendor/bundle + # - run: # name: Fastlane Build # no_output_timeout: 1200 diff --git a/ios/Gemfile.lock b/ios/Gemfile.lock new file mode 100644 index 00000000000..17676999719 --- /dev/null +++ b/ios/Gemfile.lock @@ -0,0 +1,159 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (3.0.0) + addressable (2.6.0) + public_suffix (>= 2.0.2, < 4.0) + atomos (0.1.3) + babosa (1.0.2) + claide (1.0.2) + colored (1.2) + colored2 (3.1.2) + commander-fastlane (4.4.6) + 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.7.4) + emoji_regex (1.0.1) + excon (0.64.0) + 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.13.1) + faraday (>= 0.7.4, < 1.0) + fastimage (2.1.5) + fastlane (2.126.0) + CFPropertyList (>= 2.3, < 4.0.0) + addressable (>= 2.3, < 3.0.0) + babosa (>= 1.0.2, < 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) + excon (>= 0.45.0, < 1.0.0) + faraday (~> 0.9) + faraday-cookie_jar (~> 0.0.6) + faraday_middleware (~> 0.9) + 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) + jwt (~> 2.1.0) + mini_magick (~> 4.5.1) + multi_xml (~> 0.5) + multipart-post (~> 2.0.0) + plist (>= 3.1.0, < 4.0.0) + public_suffix (~> 2.0.0) + rubyzip (>= 1.2.2, < 2.0.0) + security (= 0.1.3) + simctl (~> 1.6.3) + slack-notifier (>= 2.0.0, < 3.0.0) + terminal-notifier (>= 2.0.0, < 3.0.0) + terminal-table (>= 1.4.5, < 2.0.0) + tty-screen (>= 0.6.3, < 1.0.0) + tty-spinner (>= 0.8.0, < 1.0.0) + word_wrap (~> 1.0.0) + xcodeproj (>= 1.8.1, < 2.0.0) + xcpretty (~> 0.3.0) + xcpretty-travis-formatter (>= 0.0.3) + gh_inspector (1.1.3) + google-api-client (0.23.9) + addressable (~> 2.5, >= 2.5.1) + googleauth (>= 0.5, < 0.7.0) + httpclient (>= 2.8.1, < 3.0) + mime-types (~> 3.0) + representable (~> 3.0) + retriable (>= 2.0, < 4.0) + signet (~> 0.9) + google-cloud-core (1.3.0) + google-cloud-env (~> 1.0) + google-cloud-env (1.2.0) + faraday (~> 0.11) + google-cloud-storage (1.16.0) + digest-crc (~> 0.4) + google-api-client (~> 0.23) + google-cloud-core (~> 1.2) + googleauth (>= 0.6.2, < 0.10.0) + googleauth (0.6.7) + faraday (~> 0.12) + jwt (>= 1.4, < 3.0) + memoist (~> 0.16) + multi_json (~> 1.11) + os (>= 0.9, < 2.0) + signet (~> 0.7) + highline (1.7.10) + http-cookie (1.0.3) + domain_name (~> 0.5) + httpclient (2.8.3) + json (2.2.0) + jwt (2.1.0) + memoist (0.16.0) + mime-types (3.2.2) + mime-types-data (~> 3.2015) + mime-types-data (3.2019.0331) + mini_magick (4.5.1) + multi_json (1.13.1) + multi_xml (0.6.0) + multipart-post (2.0.0) + nanaimo (0.2.6) + naturally (2.2.0) + os (1.0.1) + plist (3.5.0) + public_suffix (2.0.5) + 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.2.3) + security (0.1.3) + signet (0.11.0) + addressable (~> 2.3) + faraday (~> 0.9) + jwt (>= 1.5, < 3.0) + multi_json (~> 1.10) + simctl (1.6.5) + CFPropertyList + naturally + slack-notifier (2.3.2) + terminal-notifier (2.0.0) + terminal-table (1.8.0) + unicode-display_width (~> 1.1, >= 1.1.1) + tty-cursor (0.7.0) + tty-screen (0.7.0) + tty-spinner (0.9.1) + tty-cursor (~> 0.7) + uber (0.1.0) + unf (0.1.4) + unf_ext + unf_ext (0.0.7.6) + unicode-display_width (1.6.0) + word_wrap (1.0.0) + xcodeproj (1.10.0) + CFPropertyList (>= 2.3.3, < 4.0) + atomos (~> 0.1.3) + claide (>= 1.0.2, < 2.0) + colored2 (~> 3.1) + nanaimo (~> 0.2.6) + xcpretty (0.3.0) + rouge (~> 2.0.7) + xcpretty-travis-formatter (1.0.0) + xcpretty (~> 0.2, >= 0.0.7) + +PLATFORMS + ruby + +DEPENDENCIES + fastlane + +BUNDLED WITH + 2.0.2 From 85d0b08756bcd8aeaab57c18cf7df6adb5718013 Mon Sep 17 00:00:00 2001 From: IlarionHalushka Date: Tue, 2 Jul 2019 09:55:09 +0300 Subject: [PATCH 03/23] install fastlane using 'sudo bundle install' --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 284236074e3..e22e85d23a6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -200,7 +200,7 @@ jobs: name: Update Fastlane command: | cd ios - bundle install + sudo bundle install - save_cache: key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }} From f40a5417144c80e601d4629d7f95590369fc2941 Mon Sep 17 00:00:00 2001 From: IlarionHalushka Date: Tue, 2 Jul 2019 09:59:04 +0300 Subject: [PATCH 04/23] uncomment ios build commands --- .circleci/config.yml | 64 ++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e22e85d23a6..85878e8b128 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -186,15 +186,15 @@ jobs: set +e nvm install 8 -# - run: -# name: Install NPM modules -# command: | -# yarn -# -# - run: -# name: Set Google Services -# command: | -# cp GoogleService-Info.prod.plist GoogleService-Info.plist + - run: + name: Install NPM modules + command: | + yarn + + - run: + name: Set Google Services + command: | + cp GoogleService-Info.prod.plist GoogleService-Info.plist - run: name: Update Fastlane @@ -207,29 +207,29 @@ jobs: paths: - vendor/bundle -# - run: -# name: Fastlane Build -# no_output_timeout: 1200 -# command: | -# cd ios -# agvtool new-version -all $CIRCLE_BUILD_NUM -# -# if [[ $MATCH_KEYCHAIN_NAME ]]; then -# fastlane ios release -# else -# export MATCH_KEYCHAIN_NAME="temp" -# export MATCH_KEYCHAIN_PASSWORD="temp" -# fastlane ios build -# fi -# -# - store_artifacts: -# path: ios/RocketChatRN.ipa -# -# - persist_to_workspace: -# root: . -# paths: -# - ios/*.ipa -# - ios/fastlane/report.xml + - run: + name: Fastlane Build + no_output_timeout: 1200 + command: | + cd ios + agvtool new-version -all $CIRCLE_BUILD_NUM + + if [[ $MATCH_KEYCHAIN_NAME ]]; then + bundle exec fastlane ios release + else + export MATCH_KEYCHAIN_NAME="temp" + export MATCH_KEYCHAIN_PASSWORD="temp" + bundle exec fastlane ios build + fi + + - store_artifacts: + path: ios/RocketChatRN.ipa + + - persist_to_workspace: + root: . + paths: + - ios/*.ipa + - ios/fastlane/report.xml ios-testflight: macos: From d970f5fc20338d6892c408fa63993f66afdc53e0 Mon Sep 17 00:00:00 2001 From: IlarionHalushka Date: Tue, 2 Jul 2019 10:03:55 +0300 Subject: [PATCH 05/23] run set up google services in ios folder --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 85878e8b128..266c141db07 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -191,17 +191,17 @@ jobs: command: | yarn - - run: - name: Set Google Services - command: | - cp GoogleService-Info.prod.plist GoogleService-Info.plist - - run: name: Update Fastlane command: | cd ios sudo bundle install + - run: + name: Set Google Services + command: | + cp GoogleService-Info.prod.plist GoogleService-Info.plist + - save_cache: key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }} paths: From 97dc4c60bef16c5b26350bdac4da5c3321286e45 Mon Sep 17 00:00:00 2001 From: IlarionHalushka Date: Tue, 2 Jul 2019 10:13:02 +0300 Subject: [PATCH 06/23] add working_directory: ios to ios-build steps --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 266c141db07..1c8494c8f68 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -194,13 +194,14 @@ jobs: - run: name: Update Fastlane command: | - cd ios sudo bundle install + working_directory: ios - run: name: Set Google Services command: | cp GoogleService-Info.prod.plist GoogleService-Info.plist + working_directory: ios - save_cache: key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }} @@ -221,6 +222,7 @@ jobs: export MATCH_KEYCHAIN_PASSWORD="temp" bundle exec fastlane ios build fi + working_directory: ios - store_artifacts: path: ios/RocketChatRN.ipa From 269654be5e0e5d13b6a201f8edc7035c42297807 Mon Sep 17 00:00:00 2001 From: IlarionHalushka Date: Tue, 2 Jul 2019 10:18:01 +0300 Subject: [PATCH 07/23] remove 'cd ios' from Fastlane build step --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1c8494c8f68..b80f5764e72 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -212,7 +212,6 @@ jobs: name: Fastlane Build no_output_timeout: 1200 command: | - cd ios agvtool new-version -all $CIRCLE_BUILD_NUM if [[ $MATCH_KEYCHAIN_NAME ]]; then From 2199a4730e1f28bc2685ff6d953bef1c5e91b1da Mon Sep 17 00:00:00 2001 From: IlarionHalushka Date: Tue, 2 Jul 2019 10:41:21 +0300 Subject: [PATCH 08/23] add save\restore cache for npm modules --- .circleci/config.yml | 66 +++++++++++++++++++++++++++----------------- 1 file changed, 41 insertions(+), 25 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b80f5764e72..86a5a86a123 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -177,6 +177,12 @@ jobs: - restore_cache: key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }} + - restore_cache: + key: yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }} + + - restore_cache: + key: node-v1-{{ checksum "package.json" }}-{{ arch }} + - run: name: Install Node 8 command: | @@ -191,46 +197,56 @@ jobs: command: | yarn + - save_cache: + key: yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }} + paths: + - ~/.cache/yarn + + - save_cache: + key: node-v1-{{ checksum "package.json" }}-{{ arch }} + paths: + - node_modules + - run: name: Update Fastlane command: | sudo bundle install working_directory: ios - - run: - name: Set Google Services - command: | - cp GoogleService-Info.prod.plist GoogleService-Info.plist - working_directory: ios - - save_cache: key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }} paths: - vendor/bundle - run: - name: Fastlane Build - no_output_timeout: 1200 + name: Set Google Services command: | - agvtool new-version -all $CIRCLE_BUILD_NUM - - if [[ $MATCH_KEYCHAIN_NAME ]]; then - bundle exec fastlane ios release - else - export MATCH_KEYCHAIN_NAME="temp" - export MATCH_KEYCHAIN_PASSWORD="temp" - bundle exec fastlane ios build - fi + cp GoogleService-Info.prod.plist GoogleService-Info.plist working_directory: ios - - store_artifacts: - path: ios/RocketChatRN.ipa - - - persist_to_workspace: - root: . - paths: - - ios/*.ipa - - ios/fastlane/report.xml +# - run: +# name: Fastlane Build +# no_output_timeout: 1200 +# command: | +# agvtool new-version -all $CIRCLE_BUILD_NUM +# +# if [[ $MATCH_KEYCHAIN_NAME ]]; then +# 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 +# +# - store_artifacts: +# path: ios/RocketChatRN.ipa +# +# - persist_to_workspace: +# root: . +# paths: +# - ios/*.ipa +# - ios/fastlane/report.xml ios-testflight: macos: From 273bae98ca553380236205828bb80f648e60533d Mon Sep 17 00:00:00 2001 From: IlarionHalushka Date: Tue, 2 Jul 2019 10:50:26 +0300 Subject: [PATCH 09/23] group save_cache steps --- .circleci/config.yml | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 86a5a86a123..630bfb5b0c1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -197,27 +197,12 @@ jobs: command: | yarn - - save_cache: - key: yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }} - paths: - - ~/.cache/yarn - - - save_cache: - key: node-v1-{{ checksum "package.json" }}-{{ arch }} - paths: - - node_modules - - run: name: Update Fastlane command: | sudo bundle install working_directory: ios - - save_cache: - key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }} - paths: - - vendor/bundle - - run: name: Set Google Services command: | @@ -238,7 +223,21 @@ jobs: # bundle exec fastlane ios build # fi # working_directory: ios -# + + - save_cache: + key: yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }} + paths: + - ~/.cache/yarn + + - save_cache: + key: node-v1-{{ checksum "package.json" }}-{{ arch }} + paths: + - node_modules + + - save_cache: + key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }} + paths: + - vendor/bundle # - store_artifacts: # path: ios/RocketChatRN.ipa # From f04ae750c65082e8c26c438cc1ca204d3e260aa0 Mon Sep 17 00:00:00 2001 From: Ilarion Date: Tue, 2 Jul 2019 14:13:51 +0300 Subject: [PATCH 10/23] cache fastlane in ios-testflight job --- .circleci/config.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 630bfb5b0c1..7a12f374a46 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -257,18 +257,25 @@ jobs: - attach_workspace: at: ios + - restore_cache: + key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }} + - run: name: Update Fastlane command: | - brew update - brew install ruby - sudo gem install fastlane + sudo bundle install + working_directory: ios - run: name: Fastlane Tesflight Upload command: | - cd ios - fastlane pilot upload --ipa ios/RocketChatRN.ipa --changelog "$(sh ../.circleci/changelog.sh)" + bundle exec fastlane pilot upload --ipa ios/RocketChatRN.ipa --changelog "$(sh ../.circleci/changelog.sh)" + working_directory: ios + + - save_cache: + key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }} + paths: + - vendor/bundle workflows: version: 2 From 5f29c8de9e21056009904be791990622cee7246b Mon Sep 17 00:00:00 2001 From: Ilarion Date: Tue, 2 Jul 2019 14:17:23 +0300 Subject: [PATCH 11/23] uncomment previously commented jobs\steps --- .circleci/config.yml | 89 ++++++++++++++++++++++---------------------- 1 file changed, 45 insertions(+), 44 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7a12f374a46..507820de94d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -209,20 +209,20 @@ jobs: cp GoogleService-Info.prod.plist GoogleService-Info.plist working_directory: ios -# - run: -# name: Fastlane Build -# no_output_timeout: 1200 -# command: | -# agvtool new-version -all $CIRCLE_BUILD_NUM -# -# if [[ $MATCH_KEYCHAIN_NAME ]]; then -# 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 + - run: + name: Fastlane Build + no_output_timeout: 1200 + command: | + agvtool new-version -all $CIRCLE_BUILD_NUM + + if [[ $MATCH_KEYCHAIN_NAME ]]; then + 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 - save_cache: key: yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }} @@ -238,14 +238,15 @@ jobs: key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }} paths: - vendor/bundle -# - store_artifacts: -# path: ios/RocketChatRN.ipa -# -# - persist_to_workspace: -# root: . -# paths: -# - ios/*.ipa -# - ios/fastlane/report.xml + + - store_artifacts: + path: ios/RocketChatRN.ipa + + - persist_to_workspace: + root: . + paths: + - ios/*.ipa + - ios/fastlane/report.xml ios-testflight: macos: @@ -281,27 +282,27 @@ workflows: version: 2 build-and-test: jobs: -# - lint-testunit -# -# - e2e-hold: -# type: approval -# requires: -# - lint-testunit -# - e2e-test: -# requires: -# - e2e-hold + - lint-testunit + + - e2e-hold: + type: approval + requires: + - lint-testunit + - e2e-test: + requires: + - e2e-hold - ios-build -# requires: -# - lint-testunit -# - ios-hold-testflight: -# type: approval -# requires: -# - ios-build -# - ios-testflight: -# requires: -# - ios-hold-testflight -# -# - android-build: -# requires: -# - lint-testunit + requires: + - lint-testunit + - ios-hold-testflight: + type: approval + requires: + - ios-build + - ios-testflight: + requires: + - ios-hold-testflight + + - android-build: + requires: + - lint-testunit From 9729e3e96862fb239899c141f7b163ba37bc8dfa Mon Sep 17 00:00:00 2001 From: Ilarion Date: Tue, 2 Jul 2019 14:19:27 +0300 Subject: [PATCH 12/23] fix: add missing colon --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 507820de94d..03760a9e758 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -292,7 +292,7 @@ workflows: requires: - e2e-hold - - ios-build + - ios-build: requires: - lint-testunit - ios-hold-testflight: From af4a14c2576c47ccf0bfe4d0ead1389f169ce39e Mon Sep 17 00:00:00 2001 From: IlarionHalushka Date: Tue, 2 Jul 2019 20:02:31 +0300 Subject: [PATCH 13/23] use key for caching: node-modules-{{ checksum ".circleci/config.yml" }}-{{ checksum "yarn.lock" }} --- .circleci/config.yml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 03760a9e758..6b8f8d67143 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -178,10 +178,7 @@ jobs: key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }} - restore_cache: - key: yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }} - - - restore_cache: - key: node-v1-{{ checksum "package.json" }}-{{ arch }} + key: node-modules-{{ checksum ".circleci/config.yml" }}-{{ checksum "yarn.lock" }} - run: name: Install Node 8 @@ -225,14 +222,9 @@ jobs: working_directory: ios - save_cache: - key: yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }} - paths: - - ~/.cache/yarn - - - save_cache: - key: node-v1-{{ checksum "package.json" }}-{{ arch }} + key: node-modules-{{ checksum ".circleci/config.yml" }}-{{ checksum "yarn.lock" }} paths: - - node_modules + - ./node_modules - save_cache: key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }} From d7205f8b9123e0688fe7bfa2c7493672a0b40b98 Mon Sep 17 00:00:00 2001 From: IlarionHalushka Date: Tue, 2 Jul 2019 20:05:06 +0300 Subject: [PATCH 14/23] add names for save\restore steps --- .circleci/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6b8f8d67143..1d1bbbd46ec 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -175,9 +175,11 @@ jobs: - checkout - restore_cache: + name: Restoring gems cache key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }} - restore_cache: + name: Restoring npm cache key: node-modules-{{ checksum ".circleci/config.yml" }}-{{ checksum "yarn.lock" }} - run: @@ -222,11 +224,13 @@ jobs: working_directory: ios - save_cache: + name: Saving npm cache key: node-modules-{{ checksum ".circleci/config.yml" }}-{{ checksum "yarn.lock" }} paths: - ./node_modules - save_cache: + name: Saving gems cache key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }} paths: - vendor/bundle From c72bf09832bf9a3926c21bc633e00feb812e2422 Mon Sep 17 00:00:00 2001 From: IlarionHalushka Date: Wed, 3 Jul 2019 09:35:34 +0300 Subject: [PATCH 15/23] ci: add `default` step with `working_directory: ~/repo` to ios-build job --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1d1bbbd46ec..da6d5be2879 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -165,6 +165,7 @@ jobs: - ~/.gradle ios-build: + <<: *defaults macos: xcode: "10.2.1" From fe858a2abf6ddd7cbee3b71bd131a1f0cb6df673 Mon Sep 17 00:00:00 2001 From: IlarionHalushka Date: Wed, 3 Jul 2019 09:42:52 +0300 Subject: [PATCH 16/23] return back caching npm: `node-v1-{{ checksum "package.json" }}-{{ arch }}` --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index da6d5be2879..23f052e0980 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -181,7 +181,7 @@ jobs: - restore_cache: name: Restoring npm cache - key: node-modules-{{ checksum ".circleci/config.yml" }}-{{ checksum "yarn.lock" }} + key: node-v1-{{ checksum "package.json" }}-{{ arch } - run: name: Install Node 8 @@ -226,9 +226,9 @@ jobs: - save_cache: name: Saving npm cache - key: node-modules-{{ checksum ".circleci/config.yml" }}-{{ checksum "yarn.lock" }} + key: node-v1-{{ checksum "package.json" }}-{{ arch }} paths: - - ./node_modules + - node_modules - save_cache: name: Saving gems cache From aaedf78990973c4040f476aca761307a4534d1cc Mon Sep 17 00:00:00 2001 From: Ilarion Date: Wed, 3 Jul 2019 14:48:09 +0300 Subject: [PATCH 17/23] fix: add missing curly braces --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 23f052e0980..6a3c448dbf2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -181,7 +181,7 @@ jobs: - restore_cache: name: Restoring npm cache - key: node-v1-{{ checksum "package.json" }}-{{ arch } + key: node-v1-{{ checksum "package.json" }}-{{ arch }} - run: name: Install Node 8 From 841abbd44eee87ad4cc6d0a491c6d92c3e54f651 Mon Sep 17 00:00:00 2001 From: Ilarion Date: Wed, 3 Jul 2019 15:31:34 +0300 Subject: [PATCH 18/23] save\restore cache in e2e-test job; remove {{arch}} from cache names --- .circleci/config.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6a3c448dbf2..85c87058506 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -52,6 +52,10 @@ jobs: steps: - checkout + - restore_cache: + name: Restoring npm cache + key: node-v1-mac-{{ checksum "package.json" }} + - run: name: Install Node 8 command: | @@ -84,6 +88,12 @@ jobs: command: | detox test --configuration ios.sim.release --cleanup + - save_cache: + name: Saving npm cache + key: node-v1-mac-{{ checksum "package.json" }} + paths: + - node_modules + - store_artifacts: path: /tmp/screenshots @@ -177,11 +187,11 @@ jobs: - restore_cache: name: Restoring gems cache - key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }} + key: bundle-v1-{{ checksum "ios/Gemfile.lock" }} - restore_cache: name: Restoring npm cache - key: node-v1-{{ checksum "package.json" }}-{{ arch }} + key: node-v1-mac-{{ checksum "package.json" }} - run: name: Install Node 8 @@ -226,13 +236,13 @@ jobs: - save_cache: name: Saving npm cache - key: node-v1-{{ checksum "package.json" }}-{{ arch }} + key: node-v1-mac-{{ checksum "package.json" }} paths: - node_modules - save_cache: name: Saving gems cache - key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }} + key: bundle-v1-{{ checksum "ios/Gemfile.lock" }} paths: - vendor/bundle @@ -256,7 +266,7 @@ jobs: at: ios - restore_cache: - key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }} + key: bundle-v1-{{ checksum "ios/Gemfile.lock" }} - run: name: Update Fastlane @@ -271,7 +281,7 @@ jobs: working_directory: ios - save_cache: - key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }} + key: bundle-v1-{{ checksum "ios/Gemfile.lock" }} paths: - vendor/bundle From ed2a1cfc0dbe940f0e029314d7260130400a631a Mon Sep 17 00:00:00 2001 From: Ilarion Date: Wed, 3 Jul 2019 22:06:00 +0300 Subject: [PATCH 19/23] add names to restore_cache steps in android-build job --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 85c87058506..2db043c0224 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -113,6 +113,7 @@ jobs: - checkout - restore_cache: + name: Restore npm cache key: node-modules-{{ checksum ".circleci/config.yml" }}-{{ checksum "yarn.lock" }} - run: @@ -121,6 +122,7 @@ jobs: yarn - restore_cache: + name: Restore gradle cache key: android-{{ checksum ".circleci/config.yml" }}-{{ checksum "android/build.gradle" }}-{{ checksum "android/app/build.gradle" }} - run: From 6d4334007131bc91e38793af41c4cd05d8deda90 Mon Sep 17 00:00:00 2001 From: Ilarion Date: Wed, 3 Jul 2019 22:09:06 +0300 Subject: [PATCH 20/23] add names to save_cache steps in android-build job --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2db043c0224..842ac43a07e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -167,11 +167,13 @@ jobs: path: /tmp/build/outputs - save_cache: + name: Restore npm cache key: node-modules-{{ checksum ".circleci/config.yml" }}-{{ checksum "yarn.lock" }} paths: - ./node_modules - save_cache: + name: Restore gradle cache key: android-{{ checksum ".circleci/config.yml" }}-{{ checksum "android/build.gradle" }}-{{ checksum "android/app/build.gradle" }} paths: - ~/.gradle From 82c2f0145f5b642d5930c89071cb0da08b891564 Mon Sep 17 00:00:00 2001 From: Ilarion Date: Wed, 3 Jul 2019 22:45:31 +0300 Subject: [PATCH 21/23] add names to all save\restore steps; change checksum package.json to yarn.lock --- .circleci/config.yml | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 842ac43a07e..c6f19f8495e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,7 +15,8 @@ jobs: - checkout - restore_cache: - key: node-modules-{{ checksum ".circleci/config.yml" }}-{{ checksum "yarn.lock" }} + name: Restore npm cache + key: node-modules-{{ checksum "yarn.lock" }} - run: name: Install NPM modules @@ -38,7 +39,8 @@ jobs: yarn codecov - save_cache: - key: node-modules-{{ checksum ".circleci/config.yml" }}-{{ checksum "yarn.lock" }} + key: node-modules-{{ checksum "yarn.lock" }} + name: Save npm cache paths: - ./node_modules @@ -53,8 +55,8 @@ jobs: - checkout - restore_cache: - name: Restoring npm cache - key: node-v1-mac-{{ checksum "package.json" }} + name: Restore npm cache + key: node-v1-mac-{{ checksum "yarn.lock" }} - run: name: Install Node 8 @@ -89,8 +91,8 @@ jobs: detox test --configuration ios.sim.release --cleanup - save_cache: - name: Saving npm cache - key: node-v1-mac-{{ checksum "package.json" }} + name: Save npm cache + key: node-v1-mac-{{ checksum "yarn.lock" }} paths: - node_modules @@ -114,7 +116,7 @@ jobs: - restore_cache: name: Restore npm cache - key: node-modules-{{ checksum ".circleci/config.yml" }}-{{ checksum "yarn.lock" }} + key: node-modules-{{ checksum "yarn.lock" }} - run: name: Install NPM modules @@ -168,7 +170,7 @@ jobs: - save_cache: name: Restore npm cache - key: node-modules-{{ checksum ".circleci/config.yml" }}-{{ checksum "yarn.lock" }} + key: node-modules-{{ checksum "yarn.lock" }} paths: - ./node_modules @@ -179,7 +181,6 @@ jobs: - ~/.gradle ios-build: - <<: *defaults macos: xcode: "10.2.1" @@ -190,12 +191,12 @@ jobs: - checkout - restore_cache: - name: Restoring gems cache + name: Restore gems cache key: bundle-v1-{{ checksum "ios/Gemfile.lock" }} - restore_cache: - name: Restoring npm cache - key: node-v1-mac-{{ checksum "package.json" }} + name: Restore npm cache + key: node-v1-mac-{{ checksum "yarn.lock" }} - run: name: Install Node 8 @@ -239,13 +240,13 @@ jobs: working_directory: ios - save_cache: - name: Saving npm cache - key: node-v1-mac-{{ checksum "package.json" }} + name: Save npm cache + key: node-v1-mac-{{ checksum "yarn.lock" }} paths: - node_modules - save_cache: - name: Saving gems cache + name: Save gems cache key: bundle-v1-{{ checksum "ios/Gemfile.lock" }} paths: - vendor/bundle @@ -270,6 +271,7 @@ jobs: at: ios - restore_cache: + name: Restore gems cache key: bundle-v1-{{ checksum "ios/Gemfile.lock" }} - run: @@ -285,6 +287,7 @@ jobs: working_directory: ios - save_cache: + name: Save gems cache key: bundle-v1-{{ checksum "ios/Gemfile.lock" }} paths: - vendor/bundle From 257f802102fb21846e974c544e3bec3e1c1dfd15 Mon Sep 17 00:00:00 2001 From: Ilarion Date: Wed, 3 Jul 2019 22:55:04 +0300 Subject: [PATCH 22/23] change `npm` to `NPM` in steps naming --- .circleci/config.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c6f19f8495e..969611c4d71 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,7 +15,7 @@ jobs: - checkout - restore_cache: - name: Restore npm cache + name: Restore NPM cache key: node-modules-{{ checksum "yarn.lock" }} - run: @@ -40,7 +40,7 @@ jobs: - save_cache: key: node-modules-{{ checksum "yarn.lock" }} - name: Save npm cache + name: Save NPM cache paths: - ./node_modules @@ -55,7 +55,7 @@ jobs: - checkout - restore_cache: - name: Restore npm cache + name: Restore NPM cache key: node-v1-mac-{{ checksum "yarn.lock" }} - run: @@ -91,7 +91,7 @@ jobs: detox test --configuration ios.sim.release --cleanup - save_cache: - name: Save npm cache + name: Save NPM cache key: node-v1-mac-{{ checksum "yarn.lock" }} paths: - node_modules @@ -115,7 +115,7 @@ jobs: - checkout - restore_cache: - name: Restore npm cache + name: Restore NPM cache key: node-modules-{{ checksum "yarn.lock" }} - run: @@ -169,7 +169,7 @@ jobs: path: /tmp/build/outputs - save_cache: - name: Restore npm cache + name: Restore NPM cache key: node-modules-{{ checksum "yarn.lock" }} paths: - ./node_modules @@ -195,7 +195,7 @@ jobs: key: bundle-v1-{{ checksum "ios/Gemfile.lock" }} - restore_cache: - name: Restore npm cache + name: Restore NPM cache key: node-v1-mac-{{ checksum "yarn.lock" }} - run: @@ -240,7 +240,7 @@ jobs: working_directory: ios - save_cache: - name: Save npm cache + name: Save NPM cache key: node-v1-mac-{{ checksum "yarn.lock" }} paths: - node_modules From 495eb16b5c86289f193db6edc1a6a074ef9fdf17 Mon Sep 17 00:00:00 2001 From: Ilarion Date: Wed, 3 Jul 2019 23:15:53 +0300 Subject: [PATCH 23/23] remove {{ checksum circle ci }} from android-build job and fix naming of steps --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 969611c4d71..8e1745caaf2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -125,7 +125,7 @@ jobs: - restore_cache: name: Restore gradle cache - key: android-{{ checksum ".circleci/config.yml" }}-{{ checksum "android/build.gradle" }}-{{ checksum "android/app/build.gradle" }} + key: android-{{ checksum "android/build.gradle" }}-{{ checksum "android/app/build.gradle" }} - run: name: Configure Gradle @@ -169,14 +169,14 @@ jobs: path: /tmp/build/outputs - save_cache: - name: Restore NPM cache + name: Save NPM cache key: node-modules-{{ checksum "yarn.lock" }} paths: - ./node_modules - save_cache: - name: Restore gradle cache - key: android-{{ checksum ".circleci/config.yml" }}-{{ checksum "android/build.gradle" }}-{{ checksum "android/app/build.gradle" }} + name: Save gradle cache + key: android-{{ checksum "android/build.gradle" }}-{{ checksum "android/app/build.gradle" }} paths: - ~/.gradle