-
Notifications
You must be signed in to change notification settings - Fork 2
227 lines (208 loc) · 6.03 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
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
name: Flutter CI/CD
on:
push:
branches:
- master
jobs:
build_windows:
name: Build Android, Web, and Windows
runs-on: windows-latest
steps:
# Step 1: Checkout the Repository
- name: Checkout Repository
uses: actions/checkout@v2
# Step 2: Set up JDK for Android build
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '21'
# Step 3: Install Flutter
- name: Install Flutter
run: |
git clone https://github.com/flutter/flutter.git --depth 1 -b stable _flutter
# Step 4: Flutter Configuration for Windows
- name: Flutter Config
run: ${{ github.workspace }}\_flutter\bin\flutter.bat config --enable-windows-desktop
# Step 5: Install Dependencies (Flutter packages)
- name: Install Dependencies
run: ${{ github.workspace }}\_flutter\bin\flutter.bat pub get
# Step 6: Build Windows Executable
- name: Build Windows Executable
run: ${{ github.workspace }}\_flutter\bin\flutter.bat build windows
# Step 7: Upload Windows Artifact
- name: Upload Windows Artifact
uses: actions/upload-artifact@v3
with:
name: windows-app
path: build/windows/runner/Release/
# Step 8: Build Android APK
- name: Build Android APK
run: ${{ github.workspace }}\_flutter\bin\flutter.bat build apk --release
# Step 9: Upload APK Artifact
- name: Upload APK Artifact
uses: actions/upload-artifact@v3
with:
name: android-app
path: build/app/outputs/flutter-apk/app-release.apk
# Step 10: Build Web Application
- name: Build Web
run: ${{ github.workspace }}\_flutter\bin\flutter.bat build web --release
# Step 11: Upload Web Artifact
- name: Upload Web Artifact
uses: actions/upload-artifact@v3
with:
name: web-app
path: build/web/
# build_windows:
# name: Build Android, Web, and Windows
# runs-on: windows-latest
#
# steps:
# # Step 1: Checkout the Repository
# - name: Checkout Repository
# uses: actions/checkout@v2
#
# # Step 2: Set up JDK for Android build
# - name: Set up JDK 17
# uses: actions/setup-java@v2
# with:
# distribution: 'temurin'
# java-version: '17'
#
# # Step 3: Install Flutter and Set the Version
# - name: Install Flutter
# run: |
# git clone https://github.com/flutter/flutter.git --depth 1 -b stable _flutter
# echo "${{ github.workspace }}/_flutter/bin" >> $GITHUB_PATH
#
# # Step 4: Flutter Configuration for Windows
# - name: Flutter Config
# run: flutter config --enable-windows-desktop
#
# # Step 5: Install Dependencies (Flutter packages)
# - name: Install Dependencies
# run: flutter pub get
#
# # Step 6: Build Windows Executable
# - name: Build Windows Executable
# run: flutter build windows
#
# # Step 7: Upload Windows Artifact
# - name: Upload Windows Artifact
# uses: actions/upload-artifact@v2
# with:
# name: windows-app
# path: build/windows/runner/Release/
#
# # Step 8: Build Android APK
# - name: Build Android APK
# run: flutter build apk --release
#
# # Step 9: Upload APK Artifact
# - name: Upload APK Artifact
# uses: actions/upload-artifact@v2
# with:
# name: android-app
# path: build/app/outputs/flutter-apk/app-release.apk
#
# # Step 10: Build Web Application
# - name: Build Web
# run: flutter build web --release
#
# # Step 11: Upload Web Artifact
# - name: Upload Web Artifact
# uses: actions/upload-artifact@v2
# with:
# name: web-app
# path: build/web/
build_ios:
name: Build iOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: "17.x"
- uses: subosito/flutter-action@v1
with:
flutter-version: '3.24.2'
- run : |
sudo gem install cocoapods
cd ios
pod install
- run : flutter pub get
- run: flutter build ios --no-codesign
#name: Flutter CI/CD
#
#on:
# push:
# branches:
# - master
#
#jobs:
# build:
# name: Build Android & Web
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout Repository
# uses: actions/checkout@v2
#
# - name: Setup Flutter
# uses: subosito/flutter-action@v2
# with:
# flutter-version: '3.24.3' # specify the Flutter version
#
# - name: Set up JDK 17
# uses: actions/setup-java@v2
# with:
# distribution: 'temurin'
# java-version: '17'
#
# - name: Install Dependencies
# run: flutter pub get
#
# - name: Build APK
# run: flutter build apk --release
#
# - name: Upload APK Artifact
# uses: actions/upload-artifact@v3
# with:
# name: android-app
# path: build/app/outputs/flutter-apk/app-release.apk
#
# - name: Build WEB
# run: flutter build web --release
#
# - name: Upload Web Artifact
# uses: actions/upload-artifact@v3
# with:
# name: web-app
# path: build/web/
#
#
#
## build_ios:
## runs-on: macOS-latest
## steps:
## - name: Checkout Repository
## uses: actions/checkout@v2
##
## - name: Setup Flutter
## uses: subosito/flutter-action@v2
## with:
## flutter-version: '3.13.8'
## - name: Install CocoaPods
## run: |
## sudo gem install cocoapods
## cd ios
## pod install
##
## - name: Install Dependencies
## run: flutter pub get
##
## - name: Build iOS
## run: flutter build ios --release --no-codesign
#
# # Add more steps as needed, deploying to stores, etc.