-
-
Notifications
You must be signed in to change notification settings - Fork 24
226 lines (184 loc) · 7.17 KB
/
build.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
name: Build and Release AnymeX
on:
push:
tags:
- "v*"
workflow_dispatch:
jobs:
build-android:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: "17"
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.22.3"
- name: Get Dependencies
run: flutter pub get
- name: Build Android with Split ABI
run: flutter build apk --split-per-abi
- name: Rename and Upload APKs (Split ABI)
run: |
mv build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk build/app/outputs/flutter-apk/app-armeabi-v7a-release-split.apk
mv build/app/outputs/flutter-apk/app-arm64-v8a-release.apk build/app/outputs/flutter-apk/app-arm64-v8a-release-split.apk
mv build/app/outputs/flutter-apk/app-x86_64-release.apk build/app/outputs/flutter-apk/app-x86_64-release-split.apk
- name: Build Universal APK
run: flutter build apk --release
- name: Rename and Upload Universal APK
run: mv build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/app-release-universal.apk
- name: Upload Android Artifacts
uses: actions/upload-artifact@v3
with:
name: android-build
path: build/app/outputs/flutter-apk/*.apk
build-ios:
runs-on: macos-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.22.3"
- name: Get Dependencies
run: flutter pub get
- name: Build iOS (macOS only)
run: flutter build ios --release --no-codesign
- name: Compress iOS App Directory
run: |
cd build/ios/iphoneos
zip -r AnymeX-iOS.zip *.app
- name: Upload iOS Artifacts
uses: actions/upload-artifact@v3
with:
name: ios-build
path: build/ios/iphoneos/AnymeX-iOS.zip
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y ninja-build cmake g++ libgtk-3-dev libblkid-dev liblzma-dev pkg-config libmpv-dev libwebkit2gtk-4.1-dev
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.22.3"
- name: Replace pubspec.yaml with Desktop Version
run: cp pubspec_desktop.yaml pubspec.yaml
- name: Get Dependencies
run: flutter pub get
- name: Build Linux
run: flutter build linux --release
- name: Upload Linux Artifact
uses: actions/upload-artifact@v3
with:
name: linux-build
path: build/linux/x64/release/bundle/*
build-windows:
runs-on: windows-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.22.3"
- name: Replace pubspec.yaml with Desktop Version
run: Copy-Item -Path pubspec_desktop.yaml -Destination pubspec.yaml -Force
- name: Get Dependencies
run: flutter pub get
- name: Build Windows
run: flutter build windows --release
- name: Create ZIP file for Windows Build
run: |
cd build/windows/x64/runner/Release
Compress-Archive -Path * -DestinationPath AnymeX_Windows.zip
- name: Upload Windows Artifact
uses: actions/upload-artifact@v3
with:
name: windows-build
path: build/windows/x64/runner/Release/AnymeX_Windows.zip
- name: Setup Inno Setup
run: |
choco install innosetup
- name: Build Installer with Inno Setup
run: |
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" inno.iss
release:
needs: [build-android, build-ios, build-linux, build-windows]
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ github.ref }}
name: Release ${{ github.ref }}
body: "Release for version ${{ github.ref }}"
draft: false
prerelease: false
- name: Upload Android APKs to GitHub Release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/app/outputs/flutter-apk/app-armeabi-v7a-release-split.apk
asset_name: AnymeX-armeabi-v7a.apk
asset_content_type: application/vnd.android.package-archive
- uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/app/outputs/flutter-apk/app-arm64-v8a-release-split.apk
asset_name: AnymeX-arm64-v8a.apk
asset_content_type: application/vnd.android.package-archive
- uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/app/outputs/flutter-apk/app-x86_64-release-split.apk
asset_name: AnymeX-x86_64.apk
asset_content_type: application/vnd.android.package-archive
- uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/app/outputs/flutter-apk/app-release-universal.apk
asset_name: AnymeX-universal.apk
asset_content_type: application/vnd.android.package-archive
- name: Upload iOS Artifacts to GitHub Release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/ios/iphoneos/AnymeX-iOS.zip
asset_name: AnymeX-iOS.zip
asset_content_type: application/zip
- name: Upload Windows ZIP to GitHub Release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/windows/x64/runner/Release/AnymeX_Windows.zip
asset_name: AnymeX-Windows.zip
asset_content_type: application/zip
- name: Upload Windows Installer to GitHub Release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: output/AnymeX-Setup.exe
asset_name: AnymeX-Setup.exe
asset_content_type: application/x-msdownload
- name: Upload Linux Artifact to GitHub Release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/linux/x64/release/bundle/*
asset_name: AnymeX-linux.zip
asset_content_type: application/zip