Let Travis build the gallery and push to TestFlight / Play Store (#14408)
* iOS works * Works on Android * Take in commit number in iOS also. Get rid of image upload for Android. It's just a waste of bandwidth * Tweak to fix on Travis
This commit is contained in:
@@ -3,5 +3,6 @@ set -ex
|
||||
|
||||
if [ -n "$TRAVIS" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
|
||||
gem install coveralls-lcov
|
||||
gem install bundler
|
||||
npm install -g firebase-tools@">=3.6.1 <3.7.0"
|
||||
fi
|
||||
|
||||
38
dev/bots/travis_script.sh
Executable file
38
dev/bots/travis_script.sh
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
export PATH="$PWD/bin:$PWD/bin/cache/dart-sdk/bin:$PATH"
|
||||
|
||||
if [ "$SHARD" = "build_and_deploy_gallery" ]; then
|
||||
echo "Building and deploying Flutter Gallery"
|
||||
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
echo "Building Flutter Gallery for Android..."
|
||||
export ANDROID_HOME=`pwd`/android-sdk
|
||||
(cd examples/flutter_gallery; flutter build apk --release)
|
||||
echo "Android Flutter Gallery built"
|
||||
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then # TODO(xster): add back && [ "$TRAVIS_BRANCH" = "dev" ] after testing
|
||||
echo "Deploying to Play Store..."
|
||||
(cd examples/flutter_gallery/android; bundle exec fastlane deploy_play_store)
|
||||
else
|
||||
echo "Flutter Gallery is only deployed to the Play Store on merged dev branch commits"
|
||||
fi
|
||||
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
echo "Building Flutter Gallery for iOS..."
|
||||
(cd examples/flutter_gallery; flutter build ios --release --no-codesign)
|
||||
echo "iOS Flutter Gallery built"
|
||||
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then # TODO(xster): add back && [ "$TRAVIS_BRANCH" = "dev" ] after testing
|
||||
echo "Re-building with distribution profile and deploying to TestFlight..."
|
||||
(cd examples/flutter_gallery/ios; bundle exec fastlane build_and_deploy_testflight)
|
||||
else
|
||||
echo "Flutter Gallery is only deployed to the TestFlight on merged dev branch commits"
|
||||
fi
|
||||
fi
|
||||
elif [ "$SHARD" = "docs" ]; then
|
||||
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
# Generate the API docs, upload them
|
||||
./dev/bots/docs.sh
|
||||
fi
|
||||
else
|
||||
dart ./dev/bots/test.dart
|
||||
fi
|
||||
@@ -10,6 +10,34 @@ if [ -n "$TRAVIS" ]; then
|
||||
echo "Installing Google Cloud SDK..."
|
||||
curl https://sdk.cloud.google.com | bash > /dev/null
|
||||
echo "Google Cloud SDK installation completed."
|
||||
|
||||
if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$SHARD" = "build_and_deploy_gallery" ]; then
|
||||
# Background for not using Travis's built-in Android tags
|
||||
# https://github.com/flutter/plugins/pull/145
|
||||
# Copied from https://github.com/flutter/plugins/blame/master/.travis.yml
|
||||
wget https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
|
||||
mkdir android-sdk
|
||||
unzip -qq sdk-tools-linux-3859397.zip -d android-sdk
|
||||
export ANDROID_HOME=`pwd`/android-sdk
|
||||
export PATH=`pwd`/android-sdk/tools/bin:$PATH
|
||||
mkdir -p /home/travis/.android # silence sdkmanager warning
|
||||
echo 'count=0' > /home/travis/.android/repositories.cfg # silence sdkmanager warning
|
||||
# suppressing output of sdkmanager to keep log under 4MB (travis limit)
|
||||
echo y | sdkmanager "tools" >/dev/null
|
||||
echo y | sdkmanager "platform-tools" >/dev/null
|
||||
echo y | sdkmanager "build-tools;26.0.3" >/dev/null
|
||||
echo y | sdkmanager "platforms;android-26" >/dev/null
|
||||
echo y | sdkmanager "extras;android;m2repository" >/dev/null
|
||||
echo y | sdkmanager "extras;google;m2repository" >/dev/null
|
||||
echo y | sdkmanager "patcher;v4" >/dev/null
|
||||
sdkmanager --list
|
||||
wget http://services.gradle.org/distributions/gradle-4.1-bin.zip
|
||||
unzip -qq gradle-4.1-bin.zip
|
||||
export GRADLE_HOME=$PWD/gradle-4.1
|
||||
export PATH=$GRADLE_HOME/bin:$PATH
|
||||
gradle -v
|
||||
./bin/flutter doctor
|
||||
fi
|
||||
fi
|
||||
|
||||
# disable analytics on the bots and download Flutter dependencies
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
export PATH="$PWD/bin:$PWD/bin/cache/dart-sdk/bin:$PATH"
|
||||
|
||||
if [ "$TRAVIS_OS_NAME" = "linux" ] && \
|
||||
[ "$SHARD" = "docs" ]; then
|
||||
# generate the API docs, upload them
|
||||
./dev/bots/docs.sh
|
||||
fi
|
||||
Reference in New Issue
Block a user