DOPS-90 Add CI build for iOS App iPhone simulator (#4543)

* add CI build for iPhone simulator

* fix missing quote

* move first to root folder before S3 upload

* run on every build and not publish on GH releases
This commit is contained in:
Saturnino Abril
2020-07-10 21:23:49 +08:00
committed by GitHub
parent adcca4e501
commit 044ff3e425
3 changed files with 57 additions and 12 deletions

View File

@@ -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:

View File

@@ -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

View File

@@ -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]