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/**/GeneratedPluginRegistrant.java
**/android/**/gen/
**/android/key.properties
**/android/fastlane/secrets/*
!**/android/fastlane/secrets/.gitkeep
**/android/fastlane/metadata/**
**/android/fastlane/report.*
# iOS/XCode related
**/ios/**/*.mode1v3

View file

@ -81,11 +81,10 @@ different platforms.
##### 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`
* Adjust properties matching your setup and folder structure
* Point to the `_secrets/key.jks` you just extracted and ask for the store password.
* Copy the `api-xxx.json` file into `android/fastlane/`
* Point to the `android/fastlane/secrets/key.jks` you just extracted and ask for the store password.
* Copy the `api-access.json` file into `android/fastlane/secrets/`
##### 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 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 {
compileSdkVersion 29
@ -40,12 +46,22 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
signingConfigs {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
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