From 0549326970ee29056278afabc4bd68cdacfcf22e Mon Sep 17 00:00:00 2001 From: Mattermost Build Date: Mon, 28 Oct 2019 12:49:15 +0100 Subject: [PATCH] Automated cherry pick of #3476 (#3483) * Fix android and iOS deployment on circleCI * Feedback review * Fix circleci yml --- .circleci/config.yml | 61 +++++++++++++++++++++----------------------- fastlane/Fastfile | 6 ++--- 2 files changed, 32 insertions(+), 35 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3b4d4fde5..751e39933 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -159,39 +159,30 @@ commands: no_output_timeout: 30m command: bundle exec fastlane ios build || exit 1 - deploy-android: - description: "Deploy apk to Google Play" + deploy-to-store: + description: "Deploy build to store" parameters: - apk_path: + task: + type: string + target: + type: string + file: type: string steps: - attach_workspace: - at: ~/mattermost-mobile - - deploy: - name: "Deploy apk to Google Play" + at: / + - run: + name: <> working_directory: fastlane - command: bundle exec fastlane android deploy apk:./<> - - deploy-ios: - description: "Deploy ipa to TestFlight" - parameters: - ipa_path: - type: string - steps: - - attach_workspace: - at: ~/mattermost-mobile - - deploy: - name: "Deploy ipa to TestFlight" - working_directory: fastlane - command: bundle exec fastlane ios deploy ipa:./<> + command: bundle exec fastlane <> deploy file:$HOME/mattermost-mobile/<> persist: description: "Persist mattermost-mobile directory" steps: - persist_to_workspace: - root: ./ + root: / paths: - - ./ + - mattermost-mobile* save: description: "Save binaries artifacts" @@ -244,7 +235,6 @@ jobs: BRANCH_TO_BUILD: ${CIRCLE_BRANCH} steps: - build-android - - persist - save: filename: "Mattermost_Beta.apk" @@ -270,7 +260,6 @@ jobs: BRANCH_TO_BUILD: ${CIRCLE_BRANCH} steps: - build-ios - - persist - save: filename: "Mattermost_Beta.ipa" @@ -279,28 +268,36 @@ jobs: name: android resource_class: medium steps: - - deploy-android: - apk_path: Mattermost.apk + - deploy-to-store: + task: "Deploy to Google Play" + target: android + file: Mattermost.apk deploy-android-beta: executor: name: android resource_class: medium steps: - - deploy-android: - apk_path: Mattermost_Beta.apk + - deploy-to-store: + task: "Deploy to Google Play" + target: android + file: Mattermost_Beta.apk deploy-ios-release: executor: ios steps: - - deploy-ios: - ipa_path: Mattermost.ipa + - deploy-to-store: + task: "Deploy to TestFlight" + target: ios + file: Mattermost.ipa deploy-ios-beta: executor: ios steps: - - deploy-ios: - ipa_path: Mattermost_Beta.ipa + - deploy-to-store: + task: "Deploy to TestFlight" + target: ios + file: Mattermost_Beta.ipa workflows: version: 2 diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 8593d2e92..7de9d94d8 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -428,7 +428,7 @@ platform :ios do end lane :deploy do |options| - ipa_path = options[:ipa] + ipa_path = options[:file] unless ipa_path.nil? submit_to_testflight(ipa_path) @@ -612,7 +612,7 @@ platform :android do end lane :deploy do |options| - apk_path = options[:apk] + apk_path = options[:file] unless apk_path.nil? submit_to_google_play(apk_path) @@ -729,7 +729,7 @@ def submit_to_testflight(ipa_path) if(File.file?(ipa_path)) UI.success("ipa file #{ipa_path}") - upload_to_tesflight( + pilot( ipa: ipa_path ) else