-
Notifications
You must be signed in to change notification settings - Fork 2
85 lines (70 loc) · 2.17 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: CI
on: [push]
jobs:
# Set up Flutter for all other tasks.
setup:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
# os: [ubuntu-latest, macos-latest]
include:
- os: ubuntu-latest
flutter_path: /opt/hostedtoolcache/flutter
# - os: macos-latest
# flutter_path: /Users/runner/hostedtoolcache/flutter
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Cache Flutter dependencies
uses: actions/cache@v1
with:
path: ${{ matrix.flutter_path }}
key: ${{ runner.os }}-flutter
- uses: subosito/flutter-action@v1
with:
channel: 'stable'
build:
runs-on: ${{ matrix.os }}
needs: setup
strategy:
matrix:
os: [ubuntu-latest]
# os: [ubuntu-latest, macos-latest]
include:
- os: ubuntu-latest
flutter_path: /opt/hostedtoolcache/flutter
# - os: macos-latest
# flutter_path: /Users/runner/hostedtoolcache/flutter
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Cache Flutter
id: cache-flutter
uses: actions/cache@v1
with:
path: ${{ matrix.flutter_path }}
key: ${{ runner.os }}-flutter
- uses: subosito/flutter-action@v1
with:
channel: 'stable' # 'dev'
- name: Create signing files
working-directory: ${{github.workspace}}
shell: bash
env:
KEY_FILE: ${{secrets.KEY_FILE}}
KEY_PROPS: ${{secrets.KEY_PROPS}}
run: |
echo "$KEY_FILE" | base64 --decode > android/app/123456.jks
echo "$KEY_PROPS" > android/key.properties
- name: Setup Java 17
run: echo "JAVA_HOME=$JAVA_HOME_17_X64" >> $GITHUB_ENV
- name: Build
working-directory: ${{github.workspace}}
run: |
flutter build apk --target-platform=android-arm,android-arm64
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: app-release.apk
path: ${{github.workspace}}/build/app/outputs/apk/release/app-release.apk