diff --git a/.circleci/config.yml b/.circleci/config.yml index e793c20de7..ccb055f4f2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -368,6 +368,31 @@ jobs: - save: filename: "Mattermost-unsigned.ipa" + build-ios-simulator: + executor: ios + steps: + - checkout: + path: ~/mattermost-mobile + - ruby-setup + - npm-dependencies + - pods-dependencies + - assets + - fastlane-dependencies: + for: ios + - run: + working_directory: fastlane + name: Run fastlane to build unsigned x86_64 iOS app for iPhone simulator + no_output_timeout: 30m + command: | + HOMEBREW_NO_AUTO_UPDATE=1 brew install watchman + bundle exec fastlane ios simulator + - persist_to_workspace: + root: ~/ + paths: + - mattermost-mobile/Mattermost-simulator-x86_64.app.zip + - save: + filename: "Mattermost-simulator-x86_64.app.zip" + deploy-android-release: executor: name: android @@ -548,6 +573,17 @@ workflows: only: /^v(\d+\.)(\d+\.)(\d+)(.*)?$/ branches: only: unsigned + - build-ios-simulator: + context: mattermost-mobile-unsigned + requires: + - test + filters: + branches: + only: + - /^build-\d+$/ + - /^build-ios-\d+$/ + - /^build-ios-beta-\d+$/ + - github-release: context: mattermost-mobile-unsigned requires: diff --git a/Makefile b/Makefile index 920f91900f..e5c156e35b 100644 --- a/Makefile +++ b/Makefile @@ -188,13 +188,7 @@ unsigned-ios: stop pre-build check-style ## Build an unsigned version of the iOS ios-sim-x86_64: stop pre-build check-style ## Build an unsigned x86_64 version of the iOS app for iPhone simulator $(call start_packager) @echo "Building unsigned x86_64 iOS app for iPhone simulator" - @cd fastlane && NODE_ENV=production bundle exec fastlane ios unsigned - @mkdir -p build-ios - @cd ios/ && xcodebuild -workspace Mattermost.xcworkspace/ -scheme Mattermost -arch x86_64 -sdk iphonesimulator -configuration Release -parallelizeTargets -resultBundlePath ../build-ios/result -derivedDataPath ../build-ios/ ENABLE_BITCODE=NO CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ENABLE_BITCODE=NO - @cd build-ios/Build/Products/Release-iphonesimulator/ && zip -r Mattermost-simulator-x86_64.app.zip Mattermost.app/ - @mv build-ios/Build/Products/Release-iphonesimulator/Mattermost-simulator-x86_64.app.zip . - @rm -rf build-ios/ - @cd fastlane && bundle exec fastlane upload_file_to_s3 file:Mattermost-simulator-x86_64.app.zip os_type:iOS + @cd fastlane && NODE_ENV=production bundle exec fastlane ios simulator $(call stop_packager) unsigned-android: stop pre-build check-style prepare-android-build ## Build an unsigned version of the Android app diff --git a/fastlane/Fastfile b/fastlane/Fastfile index e317fd94c2..01806be172 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -346,6 +346,26 @@ platform :ios do sh 'rm -rf ../build-ios/' end + lane :simulator do + UI.success('Building iOS app for simulator') + + ENV['APP_NAME'] = 'Mattermost' + ENV['REPLACE_ASSETS'] = 'true' + ENV['BUILD_FOR_RELEASE'] = 'true' + ENV['APP_SCHEME'] = 'mattermost-mobile' + + update_identifiers + replace_assets + + sh 'cd ../ios && xcodebuild -workspace Mattermost.xcworkspace -scheme Mattermost -arch x86_64 -sdk iphonesimulator -configuration Release -parallelizeTargets -derivedDataPath ../build-ios ENABLE_BITCODE=NO CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ENABLE_BITCODE=NO' + sh 'cd ../ios/Build/Products/Release-iphonesimulator && zip -r Mattermost-simulator-x86_64.app.zip Mattermost.app' + sh 'mv ../ios/Build/Products/Release-iphonesimulator/Mattermost-simulator-x86_64.app.zip ../' + upload_file_to_s3({ + :os_type => "iOS", + :file => "Mattermost-simulator-x86_64.app.zip" + }) + end + lane :update_identifiers do # Set the name for the app app_name = ENV['APP_NAME'] || 'Mattermost Beta' @@ -767,11 +787,6 @@ def send_message_to_mattermost(options) title: 'Build Number', value: options[:build_number], short: true - }, - { - title: 'Built by', - value: 'Jenkins', - short: true }] }, success: options[:success]