forked from Predidit/Kazumi
-
Notifications
You must be signed in to change notification settings - Fork 1
276 lines (258 loc) · 11.3 KB
/
pr.yaml
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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
---
name: "PR workflow"
on:
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
signpath_sign:
description: 'sign binary by signpath'
required: false
default: false
type: boolean
jobs:
flutter-build-android:
name: "Release for android"
runs-on: "ubuntu-latest"
permissions: write-all
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang cmake libgtk-3-dev ninja-build libayatana-appindicator3-dev libasound2-dev
shell: bash
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version-file: pubspec.yaml
- name: Get Flutter dependencies
run: flutter pub get
shell: bash
- name: Build Flutter for Android
run: flutter build apk --split-per-abi
shell: bash
- name: Package android build output
run: cp build/app/outputs/flutter-apk/app-arm64-v8a-release.apk Kazumi_android_canary.apk
shell: bash
- name: Upload android outputs
uses: actions/upload-artifact@v4
with:
name: android_outputs
path: Kazumi_android_*.apk
flutter-build-windows:
name: "Release for windows"
runs-on: "windows-latest"
permissions: write-all
steps:
- name: Clone repository
uses: actions/checkout@v4
- run: choco install yq
- name: Enable Git longpaths
run: git config --system core.longpaths true
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version-file: pubspec.yaml
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path
pub-cache-key: "flutter-pub:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache of dart pub get dependencies
pub-cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '18'
- run: flutter pub get
- run: flutter build windows
# - name: Download FFmpeg Assets
# uses: dsaltares/fetch-gh-release-asset@master
# with:
# repo: 'Predidit/avbuild'
# version: 'tags/1.1.0'
# file: 'ffmpeg_windows_x64.zip'
# token: ${{ secrets.GITHUB_TOKEN }}
# - run: Remove-Item -Path build/windows/x64/runner/Release/ffmpeg-7.dll -Force
# - run: Expand-Archive -LiteralPath ffmpeg_windows_x64.zip -DestinationPath build/windows/x64/runner/Release
- run: Compress-Archive build/windows/x64/runner/Release/* Kazumi_windows_canary.zip
- name: Upload windows outputs
id: unsigned-windows-packet-artifacts
uses: actions/upload-artifact@v4
with:
name: windows_outputs
path: |
Kazumi_windows_*.zip
# - name: Build unsigned msix
# run: dart run msix:create
# - name: Upload windows msix ouputs
# uses: actions/upload-artifact@v4
# id: unsigned-windows-msix-artifacts
# with:
# name: windows_msix_outputs
# path: |
# build/windows/x64/runner/Release/kazumi.msix
# - run: New-Item -Path "build/windows/msix_signed_output" -ItemType Directory
# - name: sign windows msix
# if: ${{ github.event.inputs.signpath_sign == 'true'}}
# uses: signpath/github-action-submit-signing-request@v1
# with:
# api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
# organization-id: 'fa047255-4772-4be1-b14f-5cfa62635877'
# project-slug: 'Kazumi'
# signing-policy-slug: 'test-signing'
# artifact-configuration-slug: 'MSIX'
# github-artifact-id: '${{ steps.unsigned-windows-msix-artifacts.outputs.artifact-id }}'
# wait-for-completion: true
# output-artifact-directory: 'build/windows/msix_signed_output'
# - name: Upload windows msix signed ouputs
# if: ${{ github.event.inputs.signpath_sign == 'true'}}
# uses: actions/upload-artifact@v4
# id: signed-windows-msix-artifacts
# with:
# name: windows_msix_signed_outputs
# path: build/windows/msix_signed_output/*.msix
flutter-build-ios:
name: "Release for iOS"
runs-on: "macos-latest"
permissions: write-all
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version-file: pubspec.yaml
- run: flutter pub get
- name: Build IPA
run: |
flutter build ios --release --no-codesign
- name: Create IPA
run: |
mkdir Payload
cp -R build/ios/iphoneos/Runner.app Payload/Runner.app
zip -q -r Kazumi_ios_canary_no_sign.ipa Payload
- name: Upload iOS build
uses: actions/upload-artifact@v4
with:
name: ios_outputs
path: Kazumi_ios_*.ipa
flutter-build-macos:
name: "Release for Macos"
runs-on: "macos-latest"
permissions: write-all
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version-file: pubspec.yaml
- run: flutter pub get
- run: flutter build macos --release
- name: Create DMG
run: hdiutil create -format UDZO -srcfolder build/macos/Build/Products/Release/kazumi.app -volname kazumi Kazumi_macos_canary.dmg
- name: Upload MacOS build
uses: actions/upload-artifact@v4
with:
name: macos_outputs
path: Kazumi_macos_*.dmg
flutter-build-linux:
name: "Release for Linux"
runs-on: "ubuntu-latest"
permissions: write-all
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang cmake libgtk-3-dev ninja-build libayatana-appindicator3-dev unzip webkit2gtk-4.1 libasound2-dev
sudo apt-get install -y gcc g++ autoconf automake debhelper glslang-dev ladspa-sdk xutils-dev libasound2-dev \
libarchive-dev libbluray-dev libbs2b-dev libcaca-dev libcdio-paranoia-dev libdrm-dev \
libdav1d-dev libdvdnav-dev libegl1-mesa-dev libepoxy-dev libfontconfig-dev libfreetype6-dev \
libfribidi-dev libgl1-mesa-dev libgbm-dev libgme-dev libgsm1-dev libharfbuzz-dev libjpeg-dev \
libbrotli-dev liblcms2-dev libmodplug-dev libmp3lame-dev libopenal-dev \
libopus-dev libopencore-amrnb-dev libopencore-amrwb-dev libpulse-dev librtmp-dev \
libsdl2-dev libsixel-dev libssh-dev libsoxr-dev libspeex-dev libtool \
libv4l-dev libva-dev libvdpau-dev libvorbis-dev libvo-amrwbenc-dev \
libunwind-dev libvpx-dev libwayland-dev libx11-dev libxext-dev \
libxkbcommon-dev libxrandr-dev libxss-dev libxv-dev libxvidcore-dev \
linux-libc-dev nasm ninja-build pkg-config python3 python3-docutils wayland-protocols \
x11proto-core-dev zlib1g-dev libfdk-aac-dev libtheora-dev libwebp-dev \
unixodbc-dev libpq-dev libxxhash-dev libaom-dev
shell: bash
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version-file: pubspec.yaml
- name: Get Flutter dependencies
run: flutter pub get
shell: bash
- name: Build Flutter for Linux
run: flutter build linux
shell: bash
# - name: Download FFmpeg Assets
# uses: dsaltares/fetch-gh-release-asset@master
# with:
# repo: 'Predidit/avbuild'
# version: 'tags/1.1.0'
# file: 'ffmpeg_linux_amd64.zip'
# token: ${{ secrets.GITHUB_TOKEN }}
# - run: rm -f build/linux/x64/release/bundle/lib/libffmpeg.so.7
# - run: unzip ffmpeg_linux_amd64.zip -d build/linux/x64/release/bundle/lib
- name: Package linux build output
run: |
# Tarball package
tar -zcvf Kazumi_linux_canary.tar.gz -C build/linux/x64/release/bundle .
# Debian package
mkdir Kazumi_linux_canary_amd64
cd Kazumi_linux_canary_amd64
mkdir -p opt/Kazumi
mkdir -p usr/share/applications
mkdir -p usr/share/icons/hicolor/512x512/apps
cp -r ../build/linux/x64/release/bundle/* opt/Kazumi
cp -r ../assets/linux/DEBIAN .
chmod 0755 DEBIAN/postinst
chmod 0755 DEBIAN/postrm
cat>DEBIAN/control<<EOF
Maintainer: madoka773 <[email protected]>
Package: Kazumi
Version: 0.0.1
Section: x11
Priority: optional
Architecture: amd64
Essential: no
Installed-Size: 34648
Description: Watch Animes online with danmaku support.
Homepage: https://github.com/Predidit/Kazumi
Depends: libayatana-appindicator3-1,
gir1.2-ayatanaappindicator3-0.1,
libwebkit2gtk-4.1-0
EOF
cp ../assets/linux/io.github.Predidit.Kazumi.desktop usr/share/applications
cp ../assets/images/logo/logo_linux.png usr/share/icons/hicolor/512x512/apps/io.github.Predidit.Kazumi.png
cd ..
dpkg-deb --build --root-owner-group Kazumi_linux_canary_amd64
shell: bash
- name: Upload linux outputs
uses: actions/upload-artifact@v4
with:
name: linux_outputs
path: |
Kazumi_linux_*.tar.gz
Kazumi_linux_*.deb