Skip to content

Commit 8018358

Browse files
committed
Split signing tasks between the app signing and upload keystores
This allows us to have a matching signing key for the APKs we publish as well as what people download directly from the Google Play store.
1 parent 35b918b commit 8018358

2 files changed

Lines changed: 59 additions & 22 deletions

File tree

.github/workflows/draft-release-flutter.yml

Lines changed: 48 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,44 @@ on:
77
description: Asset slug name
88
required: true
99
type: string
10-
android_key_alias:
10+
android_app_signing_key_alias:
1111
description: >
12-
Alias name of the signing key inside the Android keystore.
12+
Alias name of the app signing key inside the Android keystore.
1313
required: false
1414
type: string
15-
default: release
15+
default: appsigning
16+
android_upload_key_alias:
17+
description: >
18+
Alias name of the upload key inside the Android keystore.
19+
required: false
20+
type: string
21+
default: upload
1622
secrets:
17-
ANDROID_KEYSTORE_B64:
23+
ANDROID_APP_SIGNING_KEYSTORE_B64:
24+
description: >
25+
Base64-encoded Android app signing keystore (PKCS12 or JKS) used by
26+
Gradle to sign release APKs in CI.
27+
required: true
28+
ANDROID_APP_SIGNING_KEYSTORE_PASSWORD:
29+
description: >
30+
Password protecting the Android app signing keystore file.
31+
required: true
32+
ANDROID_APP_SIGNING_KEY_PASSWORD:
33+
description: >
34+
Password for the app signing key alias within the Android keystore.
35+
required: true
36+
ANDROID_UPLOAD_KEYSTORE_B64:
1837
description: >
19-
Base64-encoded Android signing keystore (PKCS12 or JKS) used by Gradle
20-
to sign release App Bundles and APKs in CI.
38+
Base64-encoded Android upload keystore (PKCS12 or JKS) used by
39+
Gradle to sign release App Bundles in CI.
2140
required: true
22-
ANDROID_KEYSTORE_PASSWORD:
41+
ANDROID_UPLOAD_KEYSTORE_PASSWORD:
2342
description: >
24-
Password protecting the Android signing keystore file.
43+
Password protecting the Android upload keystore file.
2544
required: true
26-
ANDROID_KEY_PASSWORD:
45+
ANDROID_UPLOAD_KEY_PASSWORD:
2746
description: >
28-
Password for the signing key alias within the Android keystore.
47+
Password for the upload key alias within the Android keystore.
2948
required: true
3049

3150
permissions:
@@ -88,17 +107,31 @@ jobs:
88107
- name: Install dependencies
89108
run: flutter pub get --enforce-lockfile
90109

91-
- name: Configure Android app signing
110+
- name: Configure Android signing (upload key)
92111
env:
93-
ANDROID_KEYSTORE_B64: ${{ secrets.ANDROID_KEYSTORE_B64 }}
94-
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
95-
ANDROID_KEY_ALIAS: ${{ inputs.android_key_alias }}
96-
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
112+
ANDROID_SIGNING_ROLE: upload
113+
ANDROID_SIGNING_FORCE_DECODE: 1
114+
ANDROID_KEYSTORE_B64: ${{ secrets.ANDROID_UPLOAD_KEYSTORE_B64 }}
115+
ANDROID_KEYSTORE_FILENAME: upload-keystore.p12
116+
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_UPLOAD_KEYSTORE_PASSWORD }}
117+
ANDROID_KEY_ALIAS: ${{ inputs.android_upload_key_alias }}
118+
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_UPLOAD_KEY_PASSWORD }}
97119
run: android-signing-setup
98120

99121
- name: Build release App Bundle
100122
run: flutter build appbundle
101123

124+
- name: Configure Android signing (app signing key)
125+
env:
126+
ANDROID_SIGNING_ROLE: appsigning
127+
ANDROID_SIGNING_FORCE_DECODE: 1
128+
ANDROID_KEYSTORE_B64: ${{ secrets.ANDROID_APP_SIGNING_KEYSTORE_B64 }}
129+
ANDROID_KEYSTORE_FILENAME: app-signing-keystore.p12
130+
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_APP_SIGNING_KEYSTORE_PASSWORD }}
131+
ANDROID_KEY_ALIAS: ${{ inputs.android_app_signing_key_alias }}
132+
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_APP_SIGNING_KEY_PASSWORD }}
133+
run: android-signing-setup
134+
102135
- name: Build release APK
103136
run: flutter build apk
104137

docs/flutter.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,17 @@ and uploads them to the release.
105105

106106
**Inputs**
107107

108-
| Name | Required | Default |
109-
| ----------------- | -------- | ------- |
110-
| slug | true | — |
111-
| android_key_alias | false | release |
108+
| Name | Required | Default |
109+
| ----------------------------- | -------- | ---------- |
110+
| slug | true | — |
111+
| android_app_signing_key_alias | false | appsigning |
112+
| android_upload_key_alias | false | upload |
112113

113114
**Secrets**
114115

115-
- `ANDROID_KEYSTORE_B64`
116-
- `ANDROID_KEYSTORE_PASSWORD`
117-
- `ANDROID_KEY_PASSWORD`
116+
- `ANDROID_APP_SIGNING_KEYSTORE_B64`
117+
- `ANDROID_APP_SIGNING_KEYSTORE_PASSWORD`
118+
- `ANDROID_APP_SIGNING_KEY_PASSWORD`
119+
- `ANDROID_UPLOAD_KEYSTORE_B64`
120+
- `ANDROID_UPLOAD_KEYSTORE_PASSWORD`
121+
- `ANDROID_UPLOAD_KEY_PASSWORD`

0 commit comments

Comments
 (0)