Skip to content

Commit d36e492

Browse files
committed
Configure app signing and add GitHub Actions release workflow
1 parent 7847990 commit d36e492

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

.github/workflows/release.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Flutter Android Release
2+
3+
# Triggers the workflow when you push a tag like "v1.0.0"
4+
on:
5+
push:
6+
tags:
7+
- 'v*'
8+
9+
jobs:
10+
build:
11+
name: Build & Release Signed App
12+
runs-on: ubuntu-latest
13+
14+
permissions:
15+
contents: write
16+
17+
steps:
18+
- name: Checkout Repository
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Java
22+
uses: actions/setup-java@v4
23+
with:
24+
distribution: 'temurin'
25+
java-version: '17'
26+
27+
- name: Set up Flutter
28+
uses: subosito/flutter-action@v2
29+
with:
30+
channel: 'stable'
31+
32+
- name: Install Dependencies
33+
run: flutter pub get
34+
35+
# Decode the Base64 secret back into a physical file in the android/app folder
36+
- name: Decode Keystore
37+
run: echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > android/app/upload-keystore.jks
38+
39+
# Build the signed App Bundle (.aab) while passing the passwords
40+
- name: Build App Bundle
41+
env:
42+
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
43+
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
44+
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
45+
run: flutter build appbundle --release
46+
47+
# Build the signed APK (.apk) just in case you want direct downloads too
48+
- name: Build APK
49+
env:
50+
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
51+
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
52+
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
53+
run: flutter build apk --release
54+
55+
# Create the GitHub Release and upload BOTH the .aab and .apk
56+
- name: Create GitHub Release
57+
uses: softprops/action-gh-release@v2
58+
with:
59+
files: |
60+
build/app/outputs/bundle/release/app-release.aab
61+
build/app/outputs/flutter-apk/app-release.apk
62+
env:
63+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)