Skip to content

Commit a8e8da1

Browse files
author
case
committed
Try to get signed release on github
1 parent 0f7119b commit a8e8da1

File tree

5 files changed

+28
-7
lines changed

5 files changed

+28
-7
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@ jobs:
99
with:
1010
java-version: '12.x'
1111
- uses: subosito/flutter-action@v1
12+
env:
13+
KEY_JKS: ${{ secrets.KEY_JKS }}
14+
KEY_PASSWORD: ${{ secrets.ALIAS_PASSWORD }}
15+
ALIAS_PASSWORD: ${{ secrets.KEY_PASSWORD }}
1216
- run: flutter pub get
1317
- run: flutter test
14-
- run: flutter build apk --debug
18+
- run: ./build.sh
1519
- name: Create Release
1620
if: contains(github.ref, 'release')
1721
id: create_release

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,6 @@ app.*.map.json
4242

4343
# Exceptions to above rules.
4444
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
45+
46+
/Envfile
47+
*.jks

android/app/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ android {
5050
versionName flutterVersionName
5151
}
5252
signingConfigs {
53-
release {
54-
keyAlias keystoreProperties['keyAlias']
55-
keyPassword keystoreProperties['keyPassword']
56-
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
57-
storePassword keystoreProperties['storePassword']
58-
}
53+
release {
54+
storeFile file("../../key.jks")
55+
storePassword = "$System.env.KEY_PASSWORD"
56+
keyAlias = "key"
57+
keyPassword = "$System.env.ALIAS_PASSWORD"
58+
}
5959
}
6060
buildTypes {
6161
release {

android/settings.gradle

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,16 @@ localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
1313
def flutterSdkPath = properties.getProperty("flutter.sdk")
1414
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
1515
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
16+
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
17+
18+
def plugins = new Properties()
19+
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
20+
if (pluginsFile.exists()) {
21+
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
22+
}
23+
24+
plugins.each { name, path ->
25+
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
26+
include ":$name"
27+
project(":$name").projectDir = pluginDirectory
28+
}

build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
echo $KEY_JKS | base64 --decode > key.jks && flutter build apk --release

0 commit comments

Comments
 (0)