Skip to content

Commit

Permalink
Try to get signed release on github
Browse files Browse the repository at this point in the history
  • Loading branch information
case committed Jun 24, 2020
1 parent 0f7119b commit a8e8da1
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 7 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ jobs:
with:
java-version: '12.x'
- uses: subosito/flutter-action@v1
env:
KEY_JKS: ${{ secrets.KEY_JKS }}
KEY_PASSWORD: ${{ secrets.ALIAS_PASSWORD }}
ALIAS_PASSWORD: ${{ secrets.KEY_PASSWORD }}
- run: flutter pub get
- run: flutter test
- run: flutter build apk --debug
- run: ./build.sh
- name: Create Release
if: contains(github.ref, 'release')
id: create_release
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ app.*.map.json

# Exceptions to above rules.
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

/Envfile
*.jks
12 changes: 6 additions & 6 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ android {
versionName flutterVersionName
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
release {
storeFile file("../../key.jks")
storePassword = "$System.env.KEY_PASSWORD"
keyAlias = "key"
keyPassword = "$System.env.ALIAS_PASSWORD"
}
}
buildTypes {
release {
Expand Down
13 changes: 13 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,16 @@ localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()

def plugins = new Properties()
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
if (pluginsFile.exists()) {
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
}

plugins.each { name, path ->
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
include ":$name"
project(":$name").projectDir = pluginDirectory
}
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
echo $KEY_JKS | base64 --decode > key.jks && flutter build apk --release

0 comments on commit a8e8da1

Please sign in to comment.