-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (58 loc) · 1.91 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
flutter_test:
name: Run Flutter Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- uses: subosito/flutter-action@v2
- run: flutter pub get
- run: flutter --version
- run: flutter analyze
- run: flutter test
build_androidBundle:
name: Build Flutter App (Android)
needs: [flutter_test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- uses: subosito/flutter-action@v2
# Prepare Keystore (decode and save it)
- name: Decode Keystore
run: |
echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 -d > ./android/app/key.jks
# Set up key.properties file
- name: Set up key.properties file
run: |
echo "storePassword=${{ secrets.ANDROID_KEYSTORE_PASSWORD }}" > $GITHUB_WORKSPACE/android/key.properties
echo "keyPassword=${{ secrets.ANDROID_KEY_PASSWORD }}" >> $GITHUB_WORKSPACE/android/key.properties
echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" >> $GITHUB_WORKSPACE/android/key.properties
echo "storeFile=key.jks" >> $GITHUB_WORKSPACE/android/key.properties
- run: flutter pub get
- run: flutter clean
- run: flutter build appbundle
- name: Archive android bundle file.
uses: actions/upload-artifact@v4
with:
name: openshock.aab
path: build/app/outputs/bundle/release/app-release.aab
- name: Archive android apk file.
uses: actions/upload-artifact@v4
with:
name: openshock.aab
path: build/app/outputs/flutter-apk/app-release.apk