Skip to content

Commit a9c3f95

Browse files
committed
feat(actions): build apk with signing key
1 parent 03f6aee commit a9c3f95

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
jobs:
99
test:
10-
name: Analyze project
10+
name: 🛠 Analyze project
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v1
@@ -30,7 +30,7 @@ jobs:
3030

3131
build_apk:
3232
needs: [test]
33-
name: Build & Release APK
33+
name: 🔧 Build & 📦 Release APK
3434
runs-on: ubuntu-latest
3535
steps:
3636
- uses: actions/checkout@v1
@@ -48,8 +48,14 @@ jobs:
4848
with:
4949
flutter-version: "3.13.9"
5050
cache: true
51+
- run: flutter clean
5152
- run: flutter pub get
52-
- run: flutter build apk --release
53+
- name: 🔧 Build APK
54+
env:
55+
KEY_JKS: ${{ secrets.KEY_JKS }}
56+
KEY_WATERBUS_PASSWORD: ${{ secrets.KEY_WATERBUS_PASSWORD }}
57+
ALIAS_WATERBUS_PASSWORD: ${{ secrets.ALIAS_WATERBUS_PASSWORD }}
58+
run: base64 -d <<< $KEY_JKS > ./android/app/waterbus.jks && flutter build apk --release -v
5359
- name: Create a Release APK
5460
uses: ncipollo/release-action@v1
5561
with:

android/app/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ android {
6767

6868
signingConfigs {
6969
release {
70-
keyAlias keystoreProperties['keyAlias']
71-
keyPassword keystoreProperties['keyPassword']
72-
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
73-
storePassword keystoreProperties['storePassword']
70+
storeFile file('waterbus.jks')
71+
storePassword "$System.env.KEY_WATERBUS_PASSWORD"
72+
keyAlias 'upload'
73+
keyPassword "$System.env.ALIAS_WATERBUS_PASSWORD"
7474
}
7575
}
7676

0 commit comments

Comments
 (0)