-
Notifications
You must be signed in to change notification settings - Fork 3
117 lines (107 loc) · 3.38 KB
/
flutter.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Flutter
permissions:
contents: read
checks: write
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
format:
name: format
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: install flutter
uses: subosito/flutter-action@v2
with:
cache: true
- name: dart format
working-directory: sport-log-client
run: dart format --set-exit-if-changed .
analyze:
name: analize
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: install flutter
uses: subosito/flutter-action@v2
with:
cache: true
- name: flutter pub get
working-directory: sport-log-client
run: |
cp sport-log-client.yaml.template sport-log-client.yaml
flutter pub get
- name: flutter analyze
working-directory: sport-log-client
run: flutter analyze
#- name: dart run dart_code_linter
#working-directory: sport-log-client
#run: dart run dart_code_linter:metrics analyze --set-exit-on-violation-level=warning lib
build-android:
name: build android
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: install java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: gradle
- name: install flutter
uses: subosito/flutter-action@v2
with:
cache: true
- name: flutter pub get
working-directory: sport-log-client
run: flutter pub get
- name: flutter build apk
working-directory: sport-log-client
run: |
cp sport-log-client.yaml.template sport-log-client.yaml
flutter build apk --release \
--flavor production \
--target-platform android-arm64 \
--split-per-abi \
--dart-define GIT_REF=$(git show-ref --head --hash=7 HEAD)
env:
SDK_REGISTRY_TOKEN: ${{ secrets.SDK_REGISTRY_TOKEN }}
build-linux:
name: build linux
runs-on: ubuntu-20.04
steps:
- name: checkout
uses: actions/checkout@v4
- name: install flutter
uses: subosito/flutter-action@v2
with:
cache: true
- name: install linux dependencies
run: |
sudo apt-get update -y
sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev
sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
- name: enable linux build
run: flutter config --enable-linux-desktop
- name: flutter build linux
working-directory: sport-log-client
run: |
cp sport-log-client.yaml.template sport-log-client.yaml
flutter build linux --release
env:
SDK_REGISTRY_TOKEN: ${{ secrets.SDK_REGISTRY_TOKEN }}
- name: install and setup flatpak
run: |
sudo apt-get update -y
sudo apt-get install -y flatpak flatpak-builder
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install --user -y flathub org.freedesktop.Platform//21.08 org.freedesktop.Sdk//21.08
- name: build flatpak
working-directory: sport-log-client
run: flatpak-builder --user --install --force-clean --state-dir ../.flatpak-builder ../flatpak-build flatpak/org.sport-log.sport-log-client.yml