Combine fastlane for iOS unsigned and simulator and enable build of iOS simulator both in release and PR (#6854)
* combine fastlane for ios unsigned and simulator and enable build of ios simulator both in release and pr * revert changes to circleci
This commit is contained in:
parent
602bb0984b
commit
ec7066ad06
3 changed files with 32 additions and 26 deletions
|
|
@ -13,7 +13,7 @@
|
|||
"ios.release": {
|
||||
"type": "ios.app",
|
||||
"binaryPath": "../ios/Build/Products/Release-iphonesimulator/Mattermost.app",
|
||||
"build": "cd ../fastlane && NODE_ENV=production bundle exec fastlane ios simulator && cd ../detox"
|
||||
"build": "cd .. && npm run build:ios-sim && cd detox"
|
||||
},
|
||||
"android.debug": {
|
||||
"type": "android.apk",
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
"e2e:android-test-release": "detox test -c android.emu.release --record-logs failing --take-screenshots failing",
|
||||
"e2e:ios-test": "IOS=true detox test -c ios.sim.debug",
|
||||
"e2e:ios-build-release": "detox build -c ios.sim.release",
|
||||
"e2e:ios-test-release": "IOS=true detox test -c ios.sim.release --headless --record-logs failing --take-screenshots failing",
|
||||
"e2e:ios-test-release": "IOS=true detox test -c ios.sim.release --record-logs failing --take-screenshots failing",
|
||||
"check": "npm run lint && npm run tsc",
|
||||
"lint": "eslint --ignore-path .gitignore --ignore-pattern node_modules --quiet .",
|
||||
"start:webhook": "node webhook_server.js",
|
||||
|
|
|
|||
|
|
@ -355,39 +355,27 @@ platform :ios do
|
|||
update_identifiers
|
||||
replace_assets
|
||||
|
||||
sh 'rm -rf ../build-ios/'
|
||||
sh 'cd ../ios/ && xcodebuild -workspace Mattermost.xcworkspace/ -scheme Mattermost -sdk iphoneos -configuration Release -parallelizeTargets -resultBundlePath ../build-ios/result -derivedDataPath ../build-ios/ CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO'
|
||||
sh 'cd ../build-ios/ && mkdir -p Payload && cp -R ../build-ios/Build/Products/Release-iphoneos/Mattermost.app Payload/ && zip -r Mattermost-unsigned.ipa Payload/'
|
||||
sh 'mv ../build-ios/Mattermost-unsigned.ipa ../'
|
||||
sh 'rm -rf ../build-ios/'
|
||||
build_ios_unsigned_or_simulator(
|
||||
more_xc_args: "-sdk iphoneos CODE_SIGNING_ALLOWED=NO",
|
||||
rel_build_dir: "Release-iphoneos",
|
||||
output_file: "Mattermost-unsigned.ipa",
|
||||
)
|
||||
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'
|
||||
output_file = "Mattermost-simulator-x86_64.app.zip"
|
||||
|
||||
update_identifiers
|
||||
replace_assets
|
||||
|
||||
data_path = 'ios'
|
||||
if ENV['CIRCLECI'] == 'true'
|
||||
data_path = 'build-ios'
|
||||
end
|
||||
|
||||
sh 'rm -rf ../ios/build/'
|
||||
sh 'rm -rf ../build-ios/'
|
||||
sh "cd ../ios && xcodebuild -workspace Mattermost.xcworkspace -scheme Mattermost -arch x86_64 -sdk iphonesimulator -configuration Release -parallelizeTargets -derivedDataPath ../#{data_path} ENABLE_BITCODE=NO CODE_SIGN_IDENTITY='' CODE_SIGNING_REQUIRED=NO ENABLE_BITCODE=NO"
|
||||
sh "cd ../#{data_path}/Build/Products/Release-iphonesimulator && zip -r Mattermost-simulator-x86_64.app.zip Mattermost.app"
|
||||
sh "mv ../#{data_path}/Build/Products/Release-iphonesimulator/Mattermost-simulator-x86_64.app.zip ../"
|
||||
sh 'rm -rf ../build-ios/'
|
||||
build_ios_unsigned_or_simulator(
|
||||
more_xc_args: "-sdk iphonesimulator -arch x86_64",
|
||||
rel_build_dir: "Release-iphonesimulator",
|
||||
output_file: output_file,
|
||||
)
|
||||
|
||||
upload_file_to_s3({
|
||||
:os_type => "ios",
|
||||
:file => "Mattermost-simulator-x86_64.app.zip"
|
||||
:file => output_file
|
||||
})
|
||||
end
|
||||
|
||||
|
|
@ -599,6 +587,24 @@ platform :ios do
|
|||
)
|
||||
end
|
||||
|
||||
def build_ios_unsigned_or_simulator(more_xc_args:, rel_build_dir:, output_file:)
|
||||
root_dir = Dir[File.expand_path('..')].first
|
||||
ios_build_dir = "#{root_dir}/ios/Build/Products"
|
||||
|
||||
ENV['APP_NAME'] = 'Mattermost'
|
||||
ENV['REPLACE_ASSETS'] = 'true'
|
||||
ENV['BUILD_FOR_RELEASE'] = 'true'
|
||||
ENV['APP_SCHEME'] = 'mattermost'
|
||||
|
||||
update_identifiers
|
||||
replace_assets
|
||||
|
||||
sh "rm -rf #{ios_build_dir}/"
|
||||
sh "cd #{root_dir}/ios && xcodebuild -workspace Mattermost.xcworkspace -scheme Mattermost -configuration Release -parallelizeTargets CODE_SIGN_IDENTITY='' CODE_SIGNING_REQUIRED=NO SYMROOT='#{ios_build_dir}' #{more_xc_args} "
|
||||
sh "cd #{ios_build_dir}/#{rel_build_dir} && zip -r #{output_file} Mattermost.app"
|
||||
sh "mv #{ios_build_dir}/#{rel_build_dir}/#{output_file} #{root_dir}"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
platform :android do
|
||||
|
|
|
|||
Loading…
Reference in a new issue