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:
xster
2018-02-05 12:00:24 -08:00
committed by GitHub
parent 9d302ac46b
commit 5b46e0a4be
9 changed files with 107 additions and 29 deletions

View File

@@ -11,6 +11,14 @@ if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersion = file("$flutterRoot/version").text
def flutterVersionComponents = flutterVersion.split(/[^0-9]+/)
// Let the integer version code of xx.yy.zz-pre.nnn be xxyyzznnn.
int flutterVersionCode = Math.min(flutterVersionComponents[0].toInteger(), 20) * 100000000
flutterVersionCode += Math.min(flutterVersionComponents[1].toInteger(), 99) * 1000000
flutterVersionCode += Math.min(flutterVersionComponents[2].toInteger(), 999) * 1000
flutterVersionCode += Math.min(flutterVersionComponents[3]?.toInteger() ?: 0, 999)
apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
@@ -25,8 +33,9 @@ android {
applicationId "io.flutter.demo.gallery"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "0.0.1"
// The Gallery app's version is defined by the Flutter framework's version.
versionCode flutterVersionCode
versionName "$flutterVersion"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

View File

@@ -7,13 +7,14 @@ default_platform(:android)
# flutter build apk --release
# to build the app using the Flutter toolchain.
platform :android do
desc 'Push the built release APK to alpha'
lane :deploy_play_store_alpha do
desc 'Push the built release APK to alpha or beta depending on current branch'
lane :deploy_play_store do
upload_to_play_store(
track: 'alpha',
track: ENV['TRAVIS_BRANCH'] == 'beta' ? 'beta' : 'alpha',
apk: '../build/app/outputs/apk/release/app-release.apk',
json_key_data: ENV['GOOGLE_DEVELOPER_SERVICE_ACCOUNT_ACTOR_FASTLANE'],
skip_upload_screenshots: true
skip_upload_screenshots: true,
skip_upload_images: true
)
end
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

View File

@@ -10,15 +10,20 @@ default_platform(:ios)
# 1- Signing using the publishing credentials; and
# 2- xcodebuild with archive option
platform :ios do
desc "Push a new release to TestFlight"
desc 'Push a new release to TestFlight'
lane :build_and_deploy_testflight do
# Doesn't do anything when not on Travis.
setup_travis
increment_version_number(
# Relative to this file. Accept only digits and dots.
version_number: File.read('../../../../version').gsub(/[^0-9\.]/, '')
)
# Retrieves all the necessary certs and provisioning profiles.
sync_code_signing(
git_url: ENV["PUBLISHING_MATCH_CERTIFICATE_REPO"],
type: "appstore",
git_url: ENV['PUBLISHING_MATCH_CERTIFICATE_REPO'],
type: 'appstore',
readonly: true
)
@@ -27,19 +32,19 @@ platform :ios do
# then run session.
disable_automatic_code_signing
update_project_provisioning(
xcodeproj: "Runner.xcodeproj",
target_filter: "Runner",
build_configuration: "Release",
profile: ENV["sigh_io.flutter.demo.gallery_appstore_profile-path"],
xcodeproj: 'Runner.xcodeproj',
target_filter: 'Runner',
build_configuration: 'Release',
profile: ENV['sigh_io.flutter.demo.gallery_appstore_profile-path'],
)
# Build and archive the app again.
build_ios_app(
workspace: "Runner.xcworkspace",
scheme: "Runner",
export_method: "app-store",
workspace: 'Runner.xcworkspace',
scheme: 'Runner',
export_method: 'app-store',
# Verify that the right signing identity is used for publishing.
codesigning_identity: "iPhone Distribution: Store Ladd (S8QB4VV633)",
codesigning_identity: 'iPhone Distribution: Store Ladd (S8QB4VV633)',
)
upload_to_testflight