diff --git a/.circleci/config.yml b/.circleci/config.yml index 50a78a96..d718b52f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -72,11 +72,16 @@ jobs: command: | cd android - echo $KEYSTORE_BASE64 | base64 --decode > ./app/$KEYSTORE - echo -e "KEYSTORE=$KEYSTORE" > ./gradle.properties - echo -e "KEYSTORE_PASSWORD=$KEYSTORE_PASSWORD" >> ./gradle.properties - echo -e "KEY_ALIAS=$KEY_ALIAS" >> ./gradle.properties - echo -e "KEY_PASSWORD=$KEYSTORE_PASSWORD" >> ./gradle.properties + echo -e "" > ./gradle.properties + + if [[ $KEYSTORE ]]; then + echo $KEYSTORE_BASE64 | base64 --decode > ./app/$KEYSTORE + echo -e "KEYSTORE=$KEYSTORE" >> ./gradle.properties + echo -e "KEYSTORE_PASSWORD=$KEYSTORE_PASSWORD" >> ./gradle.properties + echo -e "KEY_ALIAS=$KEY_ALIAS" >> ./gradle.properties + echo -e "KEY_PASSWORD=$KEYSTORE_PASSWORD" >> ./gradle.properties + fi + echo -e "VERSIONCODE=$CIRCLE_BUILD_NUM" >> ./gradle.properties - run: @@ -89,7 +94,11 @@ jobs: name: Build Android App command: | cd android - ./gradlew assembleRelease + if [[ $KEYSTORE ]]; then + ./gradlew assembleRelease + else + ./gradlew assembleDebug + fi mkdir -p /tmp/build @@ -155,7 +164,14 @@ jobs: command: | cd ios agvtool new-version -all $CIRCLE_BUILD_NUM - fastlane ios build + + 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 diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile index 780a629a..b9513cd8 100644 --- a/ios/fastlane/Fastfile +++ b/ios/fastlane/Fastfile @@ -47,20 +47,8 @@ platform :ios do # You can also use other beta testing services here (run `fastlane actions`) end - desc "Deploy a new version to the App Store" + desc "Build App for release" lane :release do - # match(type: "appstore") - # snapshot - match( - type: "appstore", - git_url: "git@github.com:RocketChat/Rocket.Chat.ReactNative.FastLane.git" - ) # more information: https://codesigning.guide - deliver(force: true) - # frameit - end - - desc "Build App" - lane :build do # match(type: "appstore") # snapshot match( @@ -72,6 +60,22 @@ platform :ios do # frameit end + desc "Build App for development" + lane :build do |options| + xcodebuild( + project: "RocketChatRN.xcodeproj", + scheme: "RocketChatRN", + configuration: "Debug", + clean: options[:clean], + build: true, + destination: "generic/platform=iOS", + build_settings: { + "CODE_SIGNING_REQUIRED" => "NO", + "CODE_SIGN_IDENTITY" => "" + } + ) + end + # You can define as many lanes as you want after_all do |lane| diff --git a/ios/fastlane/README.md b/ios/fastlane/README.md index 25c79d48..737b41e3 100644 --- a/ios/fastlane/README.md +++ b/ios/fastlane/README.md @@ -46,12 +46,12 @@ This will also make sure the profile is up to date ``` fastlane ios release ``` -Deploy a new version to the App Store +Build App for release ### ios build ``` fastlane ios build ``` -Build App +Build App for development ---- diff --git a/ios/fastlane/report.xml b/ios/fastlane/report.xml index d3e0f05c..a44d8644 100644 --- a/ios/fastlane/report.xml +++ b/ios/fastlane/report.xml @@ -5,27 +5,27 @@ - + - + - + - + - +