Use fastlane for publishing to Play Store

This commit is contained in:
Varakh 2021-02-03 21:51:03 +01:00
parent a72bded4da
commit 162137ee10
9 changed files with 94 additions and 6 deletions

5
.gitignore vendored
View file

@ -41,6 +41,11 @@ flutter_export_environment.sh
**/android/local.properties **/android/local.properties
**/android/**/GeneratedPluginRegistrant.java **/android/**/GeneratedPluginRegistrant.java
**/android/**/gen/ **/android/**/gen/
**/android/key.properties
**/android/fastlane/secrets/*
!**/android/fastlane/secrets/.gitkeep
**/android/fastlane/metadata/**
**/android/fastlane/report.*
# iOS/XCode related # iOS/XCode related
**/ios/**/*.mode1v3 **/ios/**/*.mode1v3

View file

@ -81,11 +81,10 @@ different platforms.
##### Android ##### Android
* Extract the encrypted ZIP file from `_secrets/` into the same folder with GPG. Ask for the password if necessary.
* Copy `android/key.properties.example` to `android/key.properties` * Copy `android/key.properties.example` to `android/key.properties`
* Adjust properties matching your setup and folder structure * Adjust properties matching your setup and folder structure
* Point to the `_secrets/key.jks` you just extracted and ask for the store password. * Point to the `android/fastlane/secrets/key.jks` you just extracted and ask for the store password.
* Copy the `api-xxx.json` file into `android/fastlane/` * Copy the `api-access.json` file into `android/fastlane/secrets/`
##### iOS ##### iOS

3
android/Gemfile Normal file
View file

@ -0,0 +1,3 @@
source "https://rubygems.org"
gem "fastlane"

View file

@ -24,6 +24,12 @@ if (flutterVersionName == null) {
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android { android {
compileSdkVersion 29 compileSdkVersion 29
@ -40,12 +46,22 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }
buildTypes { signingConfigs {
release { release {
// TODO: Add your own signing config for the release build. keyAlias keystoreProperties['keyAlias']
// Signing with the debug keys for now, so `flutter run --release` works. keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug signingConfig signingConfigs.debug
} }
release {
signingConfig signingConfigs.release
}
} }
} }

2
android/fastlane/Appfile Normal file
View file

@ -0,0 +1,2 @@
json_key_file("fastlane/secrets/api-access.json")
package_name("de.varakh.fbmobile")

20
android/fastlane/Fastfile Normal file
View file

@ -0,0 +1,20 @@
default_platform(:android)
platform :android do
desc "Build"
lane :build do
sh("#{ENV['PWD']}/fastlane/buildAndroid.sh")
end
desc "Deploy a new version to the Google Play as Beta"
lane :beta do
build
upload_to_play_store(track: 'beta', aab: '../build/app/outputs/bundle/release/app-release.aab')
end
desc "Deploy a new version to the Google Play"
lane :deploy do
build
upload_to_play_store(aab: '../build/app/outputs/bundle/release/app-release.aab')
end
end

View file

@ -0,0 +1,39 @@
fastlane documentation
================
# Installation
Make sure you have the latest version of the Xcode command line tools installed:
```
xcode-select --install
```
Install _fastlane_ using
```
[sudo] gem install fastlane -NV
```
or alternatively using `brew install fastlane`
# Available Actions
## Android
### android build
```
fastlane android build
```
Build
### android beta
```
fastlane android beta
```
Deploy a new version to the Google Play as Beta
### android deploy
```
fastlane android deploy
```
Deploy a new version to the Google Play
----
This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run.
More information about fastlane can be found on [fastlane.tools](https://fastlane.tools).
The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools).

View file

View file

@ -0,0 +1,4 @@
storePassword=
keyPassword=
keyAlias=key
storeFile=/absolute/path/to/git/android/fastlane/secrets/key.jks