Fix build of PRs from forks (#184)

This commit is contained in:
Rodrigo Nascimento 2018-01-10 00:35:31 -02:00 committed by GitHub
parent 78fb33b12e
commit 89c178470a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 47 additions and 27 deletions

View File

@ -72,11 +72,16 @@ jobs:
command: | command: |
cd android cd android
echo $KEYSTORE_BASE64 | base64 --decode > ./app/$KEYSTORE echo -e "" > ./gradle.properties
echo -e "KEYSTORE=$KEYSTORE" > ./gradle.properties
echo -e "KEYSTORE_PASSWORD=$KEYSTORE_PASSWORD" >> ./gradle.properties if [[ $KEYSTORE ]]; then
echo -e "KEY_ALIAS=$KEY_ALIAS" >> ./gradle.properties echo $KEYSTORE_BASE64 | base64 --decode > ./app/$KEYSTORE
echo -e "KEY_PASSWORD=$KEYSTORE_PASSWORD" >> ./gradle.properties 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 echo -e "VERSIONCODE=$CIRCLE_BUILD_NUM" >> ./gradle.properties
- run: - run:
@ -89,7 +94,11 @@ jobs:
name: Build Android App name: Build Android App
command: | command: |
cd android cd android
./gradlew assembleRelease if [[ $KEYSTORE ]]; then
./gradlew assembleRelease
else
./gradlew assembleDebug
fi
mkdir -p /tmp/build mkdir -p /tmp/build
@ -155,7 +164,14 @@ jobs:
command: | command: |
cd ios cd ios
agvtool new-version -all $CIRCLE_BUILD_NUM 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: - store_artifacts:
path: ios/RocketChatRN.ipa path: ios/RocketChatRN.ipa

View File

@ -47,20 +47,8 @@ platform :ios do
# You can also use other beta testing services here (run `fastlane actions`) # You can also use other beta testing services here (run `fastlane actions`)
end end
desc "Deploy a new version to the App Store" desc "Build App for release"
lane :release do 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") # match(type: "appstore")
# snapshot # snapshot
match( match(
@ -72,6 +60,22 @@ platform :ios do
# frameit # frameit
end 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 # You can define as many lanes as you want
after_all do |lane| after_all do |lane|

View File

@ -46,12 +46,12 @@ This will also make sure the profile is up to date
``` ```
fastlane ios release fastlane ios release
``` ```
Deploy a new version to the App Store Build App for release
### ios build ### ios build
``` ```
fastlane ios build fastlane ios build
``` ```
Build App Build App for development
---- ----

View File

@ -5,27 +5,27 @@
<testcase classname="fastlane.lanes" name="0: Verifying required fastlane version" time="0.003408"> <testcase classname="fastlane.lanes" name="0: Verifying required fastlane version" time="0.002207">
</testcase> </testcase>
<testcase classname="fastlane.lanes" name="1: default_platform" time="0.003022"> <testcase classname="fastlane.lanes" name="1: default_platform" time="0.002098">
</testcase> </testcase>
<testcase classname="fastlane.lanes" name="2: match" time="12.238978"> <testcase classname="fastlane.lanes" name="2: create_keychain" time="0.106586">
</testcase> </testcase>
<testcase classname="fastlane.lanes" name="3: gym" time="237.52302"> <testcase classname="fastlane.lanes" name="3: xcodebuild" time="170.328674">
</testcase> </testcase>
<testcase classname="fastlane.lanes" name="4: pilot" time="72.313015"> <testcase classname="fastlane.lanes" name="4: delete_keychain" time="0.060332">
</testcase> </testcase>