-
-
Notifications
You must be signed in to change notification settings - Fork 25
159 lines (126 loc) · 4.48 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
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 APKs
run: |
mv build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk build/app/outputs/flutter-apk/AnymeX-Android-armeabi-v7a.apk
mv build/app/outputs/flutter-apk/app-arm64-v8a-release.apk build/app/outputs/flutter-apk/AnymeX-Android-arm64.apk
mv build/app/outputs/flutter-apk/app-x86_64-release.apk build/app/outputs/flutter-apk/AnymeX-Android-x86_64.apk
- name: Build Universal APK
run: flutter build apk --release
- name: Rename Universal APK
run: mv build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/AnymeX-Android-universal.apk
- name: Release Android APKs
uses: ncipollo/release-action@v1
with:
artifacts: "build/app/outputs/flutter-apk/AnymeX-Android-*.apk"
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
tag: ${{ github.ref_name }}
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: Create ZIP of iOS Build
run: |
cd build/ios/iphoneos
zip -r ../../../AnymeX-iOS.zip *.app
- name: Release iOS Build
uses: ncipollo/release-action@v1
with:
artifacts: "AnymeX-iOS.zip"
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
tag: ${{ github.ref_name }}
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: Zip Linux Artifacts
run: |
cd build/linux/x64/release/bundle
zip -r ../../../../../AnymeX-Linux.zip .
- name: Release Linux Build
uses: ncipollo/release-action@v1
with:
artifacts: "AnymeX-Linux.zip"
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
tag: ${{ github.ref_name }}
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: Setup Inno Setup
run: choco install innosetup -y
- name: Build Installer with Inno Setup
run: |
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" inno.iss
- name: Release Windows Builds
uses: ncipollo/release-action@v1
with:
artifacts: "build/windows/x64/runner/Release/AnymeX-Windows.zip,output/AnymeX-Setup.exe"
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
tag: ${{ github.ref_name }}