-
Notifications
You must be signed in to change notification settings - Fork 7
191 lines (182 loc) · 5.59 KB
/
Copy pathbuild.yml
File metadata and controls
191 lines (182 loc) · 5.59 KB
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
name: build all
on:
push:
branches:
- main
pull_request:
env:
FLUTTER_VERSION: "3.44.4"
PYTHON_VERSION: "3.13"
jobs:
test_backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Set up uv
uses: astral-sh/setup-uv@v8.2.0
- name: Install dependencies
run: uv sync --frozen
- name: Import FastAPI app
run: uv run python -c "from server import app; print(app.title)"
test_flutter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: stable
cache: true
- name: Install dependencies
run: flutter pub get
- name: Analyze
run: flutter analyze
- name: Test
run: flutter test
build_android:
runs-on: ubuntu-latest
needs:
- test_flutter
steps:
- uses: actions/checkout@v7
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: stable
cache: true
# - name: Download Android keystore
# id: android_keystore
# uses: timheuer/base64-to-file@v1
# with:
# fileName: key.jks
# encodedString: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
# - name: Create key.properties
# run: |
# echo "storeFile=${{ steps.android_keystore.outputs.filePath }}" > android/key.properties
# echo "storePassword=${{ secrets.ANDROID_KEYSTORE_PASSWORD }}" >> android/key.properties
# echo "keyPassword=${{ secrets.ANDROID_KEY_PASSWORD }}" >> android/key.properties
# echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" >> android/key.properties
- name: Install dependencies
run: flutter pub get
- name: Build Android App Bundle
run: flutter build appbundle --release
- name: Archive Android
uses: actions/upload-artifact@v7
with:
name: android-build
path: build/app/outputs/bundle/release/app-release.aab
build_ios:
runs-on: macos-latest
needs:
- test_flutter
steps:
- uses: actions/checkout@v7
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: stable
cache: true
- name: Install dependencies
run: flutter pub get
- name: Build iOS
run: flutter build ios --release --no-codesign
- name: Archive iOS
uses: actions/upload-artifact@v7
with:
name: ios-build
path: build/ios/iphoneos/Runner.app
# - name: Export IPA
# run: |
# cd ios
# xcodebuild -workspace Runner.xcworkspace -scheme Runner -sdk iphoneos -configuration Release archive -archivePath $PWD/build/Runner.xcarchive
# xcodebuild -exportArchive -archivePath $PWD/build/Runner.xcarchive -exportOptionsPlist ExportOptions.plist -exportPath $PWD/build/Runner.ipa
# - name: Archive iOS IPA
# uses: actions/upload-artifact@v7
# with:
# name: ios-build
# path: build/ios/build/Runner.ipa/Runner.ipa
build_macos:
runs-on: macos-latest
needs:
- test_flutter
env:
MACOS_APP_RELEASE_PATH: build/macos/Build/Products/Release
steps:
- uses: actions/checkout@v7
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: stable
cache: true
- name: Install dependencies
run: flutter pub get
- name: Build macOS
run: flutter build macos --release
- name: Archive macOS
uses: actions/upload-artifact@v7
with:
name: macos-build
path: ${{ env.MACOS_APP_RELEASE_PATH }}
build_windows:
runs-on: windows-latest
needs:
- test_flutter
steps:
- uses: actions/checkout@v7
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: stable
cache: true
- name: Install dependencies
run: flutter pub get
- name: Build Windows
run: flutter build windows --release
- name: Archive Windows
uses: actions/upload-artifact@v7
with:
name: windows-build
path: build/windows/x64/runner/Release
if-no-files-found: error
build_web:
runs-on: ubuntu-latest
needs:
- test_backend
- test_flutter
steps:
- uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Set up uv
uses: astral-sh/setup-uv@v8.2.0
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: stable
cache: true
- name: Install dependencies
run: |
uv sync --frozen
flutter pub get
- name: Build Web
run: |
flutter build web --release
mkdir ./web-release
cp -r server build pyproject.toml uv.lock ./web-release
- name: Archive Web
uses: actions/upload-artifact@v7
with:
name: web-build
path: ./web-release