-
Notifications
You must be signed in to change notification settings - Fork 14
65 lines (60 loc) · 1.73 KB
/
pr.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
name: PRs
on:
pull_request:
types: [ labeled ]
env:
FLUTTER_CHANNEL: 'beta'
DART_SDK: 'beta'
permissions:
pull-requests: write
jobs:
build:
if: ${{ github.event.label.name == 'build-apk' }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
sparse-checkout: |
app
health_data_store
- name: Cache generated health data store
id: cache-generated
uses: actions/cache@v4
with:
path: health_data_store/lib
key: builder-${{ hashFiles('health_data_store/pubspec.yaml', 'health_data_store/lib/*', 'health_data_store/lib/**/*dart') }}
- name: Setup dart
if: steps.cache-generated.outputs.cache-hit != 'true'
uses: dart-lang/setup-dart@v1
with:
sdk: ${{ env.DART_SDK }}
- name: Generate code
if: steps.cache-generated.outputs.cache-hit != 'true'
run: dart run build_runner build
working-directory: health_data_store
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: ${{ env.FLUTTER_CHANNEL }}
cache: true
- name: Disable analytics
run: flutter config --no-analytics --suppress-analytics
- name: Setup java
uses: actions/setup-java@v2
with:
java-version: "17"
distribution: "temurin"
cache: 'gradle'
- name: Build apk
run: flutter build apk --flavor github --debug
working-directory: app
- uses: actions/upload-artifact@v4
with:
name: build-results
path: app/build/app/outputs/flutter-apk
- uses: mondeja/remove-labels-gh-action@v2
if: always()
with:
token: ${{ secrets.GITHUB_TOKEN }}
labels: build-apk