-
Notifications
You must be signed in to change notification settings - Fork 8
246 lines (218 loc) · 7.28 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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
name: Release
on:
workflow_dispatch:
inputs:
build_windows:
description: 'Build for Windows'
type: boolean
required: true
default: true
build_linux:
description: 'Build for Linux'
type: boolean
required: true
default: true
build_macos:
description: 'Build for MacOS'
type: boolean
required: true
default: true
build_android:
description: 'Build for Android'
type: boolean
required: true
default: true
jobs:
create_release:
name: Create Draft Release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release_id.outputs.upload_url }}
steps:
- name: Create Draft Release
id: create_release_id
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: auto-generated draft
release_name: Auto-Generated Draft
body: |
New Features:
- Foo
Fixes:
- Bar
Known Issues:
- Foobar
Authors:
@Bonfra04
draft: true
prerelease: false
build_windows:
name: Build Windows
needs: create_release
runs-on: windows-latest
if: ${{ inputs.build_windows }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download dependencies
run: |
dotnet tool install --global wix --version 4.0.4
wix extension add --global WixToolset.UI.wixext/4.0.4
- name: Download Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.27.1"
channel: "stable"
cache: false # windows cache is broken
cache-key: "flutter-windows"
cache-path: "${{ runner.tool_cache }}/flutter/windows"
architecture: x64
- name: Build Windows App
run: |
flutter config --enable-windows-desktop
flutter build windows --release
- name: Pack Outputs
run: |
cd build\windows\x64
cpack
- name: Upload Release Asset (Portable)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ./build/windows/x64/Stronzflix.7z
asset_name: Stronzflix Windows - amd64 (Portable).7z
asset_content_type: application/x-7z-compressed
- name: Upload Release Asset (MSI)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ./build/windows/x64/Stronzflix.msi
asset_name: Stronzflix.msi
asset_content_type: application/x-msi
build_linux:
name: Build Linux
needs: create_release
runs-on: ubuntu-latest
if: ${{ inputs.build_linux }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev desktop-file-utils
wget "https://github.com/AppImage/appimagetool/releases/download/1.9.0/appimagetool-x86_64.AppImage" -O appimagetool
chmod +x appimagetool
sudo mv appimagetool /usr/local/bin
- name: Download Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.27.1"
channel: "stable"
cache: true
cache-key: "flutter-linux"
cache-path: "${{ runner.tool_cache }}/flutter/linux"
architecture: x64
- name: Download ffmpeg
run: |
wget "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-linux64-gpl.tar.xz"
tar -xf ffmpeg-master-latest-linux64-gpl.tar.xz
mv ffmpeg-master-latest-linux64-gpl ffmpeg
- name: Build Linux App
run: |
flutter config --enable-linux-desktop
flutter build linux --release
- name: Copy dependencies
run: |
cp ffmpeg/bin/ffmpeg build/linux/x64/release/bundle
cp ffmpeg/LICENSE.txt build/linux/x64/release/bundle/ffmpeg_LICENSE.txt
- name: Build AppImage
run: |
./linux/appimage/generate_appimage.sh
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ./build/linux/x64/release/Stronzflix.AppImage
asset_name: Stronzflix.AppImage
asset_content_type: application/octet-stream
build_macos:
name: Build MacOS
needs: create_release
runs-on: macos-14
if: ${{ inputs.build_macos }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.27.1"
channel: "stable"
cache: true
cache-key: "flutter-macos"
cache-path: "${{ runner.tool_cache }}/flutter/macos"
- name: Build MacOS App
run: |
flutter config --enable-macos-desktop
flutter build macos --release
- name: Zip File
run: |
cd build/macos/Build/Products/Release; 7z a ../../../../../build.7z stronzflix.app; cd -
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ./build.7z
asset_name: Stronzflix MacOS - arm.zip
asset_content_type: application/x-7z-compressed
build_android:
name: Build Android
needs: create_release
runs-on: ubuntu-latest
if: ${{ inputs.build_android }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download dependencies
uses: actions/setup-java@v2
with:
distribution: "zulu"
java-version: "17"
- name: Download Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.27.1"
channel: "stable"
cache: true
cache-key: "flutter-android"
cache-path: "${{ runner.tool_cache }}/flutter/android"
architecture: x64
- name: Build Android App
env:
KEY_JKS: ${{ secrets.KEY_JKS }}
KEY_PASSWORD: ${{ secrets.ALIAS_PASSWORD }}
ALIAS_PASSWORD: ${{ secrets.KEY_PASSWORD }}
run: |
base64 -d <<< $KEY_JKS > ./android/app/release-key.jks
flutter config --enable-android
flutter build apk --release
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: build/app/outputs/flutter-apk/app-release.apk
asset_name: Stronzflix.apk
asset_content_type: application/vnd.android.package-archive