-
-
Notifications
You must be signed in to change notification settings - Fork 2
166 lines (160 loc) · 5.52 KB
/
flutter-deploy.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
name: Flutter CI
on:
push:
workflow_dispatch:
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.22.0'
- name: Install compiler dependencies
run: sudo apt-get update && sudo apt-get install -y clang ninja-build libgtk-3-dev libmpv-dev mpv
- name: Install project dependencies
run: flutter pub get
- name: Enable linux building
run: flutter config --enable-linux-desktop
- name: Install flutter_distributor
run: flutter pub global activate flutter_distributor
- name: Build artifacts
run: flutter_distributor package --platform linux --target rpm,deb
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: localbooru-linux-binaries
path: build/linux/x64/release/bundle
- name: Upload distro specific package artifacts
uses: actions/upload-artifact@v4
with:
name: localbooru-linux-distro-specific-packages
path: dist
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Enable big longpaths because ruindows
run: git config --system core.longpaths true
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.22.0'
- name: Use pub version of media_kit_video
uses: fjogeleit/yaml-update-action@main
with:
valueFile: 'pubspec.yaml'
commitChange: false
changes: |
{
"pubspec.yaml": {
"dependencies.media_kit_video": "^1.2.4",
"dependency_overrides": {}
}
}
- name: Install project dependencies
run: flutter pub get
- name: Enable windows building
run: flutter config --enable-windows-desktop
- name: Install flutter_distributor
run: flutter pub global activate flutter_distributor
- name: Build artifacts
run: flutter_distributor package --platform windows --target exe
- name: Upload portable artifacts
uses: actions/upload-artifact@v4
with:
name: localbooru-windows-portable
path: build/windows/x64/runner/Release
- name: Upload setup artifacts
uses: actions/upload-artifact@v4
with:
name: localbooru-windows-setup
path: dist
build-macos:
if: false
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.22.0'
- name: Install project dependencies
run: flutter pub get
- name: Enable macOS building
run: flutter config --enable-macos-desktop
- name: Build artifacts
run: flutter build macos --release
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: localbooru-macos
path: build/macos/Build/Products/*/LocalBooru.app
build-android:
runs-on: ubuntu-latest
environment: Production
steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v2
with:
distribution: "temurin"
java-version: 17
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.22.0'
- name: Install project dependencies
run: flutter pub get
- name: Build artifacts
run: flutter build apk --release
- name: Sign APK
uses: ilharp/sign-android-release@v1
id: sign_app
with:
releaseDir: build/app/outputs/apk/release
signingKey: ${{ secrets.KEYSTORE_FILE_BASE64 }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }}
keyAlias: ${{ secrets.KEYSTORE_KEY_ALIAS }}
keyPassword: ${{ secrets.KEYSTORE_KEY_PASSWORD }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: localbooru-android
path: ${{steps.sign_app.outputs.signedFile}}
package:
runs-on: ubuntu-latest
needs: [build-android, build-windows, build-linux]
steps:
- uses: actions/download-artifact@v4
- name: Create folder
run: mkdir build
- name: Pack Linux binaries
uses: vimtor/[email protected]
with:
files: localbooru-linux-binaries/
dest: build/localbooru-linux-binaries.zip
- name: Pack Windows binaries
uses: vimtor/[email protected]
with:
files: localbooru-windows-portable/
dest: build/localbooru-windows-portable.zip
# - name: Pack macOS
# uses: vimtor/[email protected]
# with:
# files: localbooru-macos/Release/
# dest: build/localbooru-macos.zip
- name: Rename files
run: |
mv localbooru-android/app-release-signed.apk build/localbooru-android.apk
mv localbooru-linux-distro-specific-packages/*/localbooru-*-linux.deb build/localbooru-linux.deb
mv localbooru-linux-distro-specific-packages/*/localbooru-*-linux.rpm build/localbooru-linux.rpm
mv localbooru-windows-setup/*/localbooru-*-windows-setup.exe build/localbooru-windows-setup.exe
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: localbooru-packages
path: build