-
Notifications
You must be signed in to change notification settings - Fork 17
379 lines (317 loc) · 15.7 KB
/
build.yaml
File metadata and controls
379 lines (317 loc) · 15.7 KB
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
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
name: Build and Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
tag:
description: 'Tag to create release for (e.g., v1.0.0)'
required: true
default: 'v1.0.0'
jobs:
build-windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Get dependencies
run: flutter pub get
- name: Build Windows
run: flutter build windows --release
- name: Install Inno Setup
run: |
choco install innosetup -y
shell: cmd
- name: Create Windows installer
run: |
cd windows\installer
ISCC.exe CCloud.iss
shell: cmd
- name: Package Windows build
run: |
mkdir -p release
copy windows\installer\ccloud_gui-setup.exe release\
shell: cmd
- name: Create Windows Portable ZIP
run: |
mkdir -p release\portable
xcopy build\windows\x64\runner\Release\* release\portable\ /E /I
cd release
7z a -tzip CCloud-windows-portable.zip portable\
shell: cmd
- name: Upload Windows artifacts
uses: actions/upload-artifact@v4
with:
name: windows-build
path: |
release/ccloud_gui-setup.exe
release/CCloud-windows-portable.zip
build-macos:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Get dependencies
run: flutter pub get
- name: Enable macOS desktop support
run: flutter config --enable-macos-desktop
- name: Build macOS
run: flutter build macos --release --no-tree-shake-icons
- name: Create Universal Binary
run: |
# Create a universal binary that works on both Intel and Apple Silicon
mkdir -p release
# The built app is already a universal binary by default
# Copy the app bundle to a temporary location
TEMP_DIR=$(mktemp -d)
cp -R build/macos/Build/Products/Release/ccloud_gui.app "$TEMP_DIR/"
# Create the DMG using create-dmg tool
brew install create-dmg
create-dmg \
--volname "CCloud Installer" \
--window-pos 200 120 \
--window-size 800 400 \
--icon-size 100 \
--app-drop-link 600 185 \
"release/CCloud-macos-universal.dmg" \
"$TEMP_DIR/"
# Clean up
rm -rf "$TEMP_DIR"
- name: Create ZIP
run: |
# Create a ZIP archive of the app bundle
mkdir -p release
zip -r release/CCloud-macos-universal.zip build/macos/Build/Products/Release/ccloud_gui.app
- name: Upload macOS artifacts
uses: actions/upload-artifact@v4
with:
name: macos-build
path: |
release/CCloud-macos-universal.dmg
release/CCloud-macos-universal.zip
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Get dependencies
run: flutter pub get
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev desktop-file-utils libgdk-pixbuf2.0-dev libmpv-dev libepoxy-dev librsvg2-dev libgirepository1.0-dev
shell: bash
- name: Build Linux
run: flutter build linux --release
- name: Install packaging tools
run: |
sudo apt-get install -y rpm ruby ruby-dev rubygems build-essential
sudo gem install fpm
shell: bash
- name: Create DEB and RPM packages
run: |
# Create directory structure for packaging
mkdir -p ccloud-package/usr/bin
mkdir -p ccloud-package/usr/lib
mkdir -p ccloud-package/usr/share/applications
mkdir -p ccloud-package/usr/share/icons/hicolor/16x16/apps
mkdir -p ccloud-package/usr/share/icons/hicolor/22x22/apps
mkdir -p ccloud-package/usr/share/icons/hicolor/24x24/apps
mkdir -p ccloud-package/usr/share/icons/hicolor/32x32/apps
mkdir -p ccloud-package/usr/share/icons/hicolor/48x48/apps
mkdir -p ccloud-package/usr/share/icons/hicolor/64x64/apps
mkdir -p ccloud-package/usr/share/icons/hicolor/128x128/apps
mkdir -p ccloud-package/usr/share/icons/hicolor/256x256/apps
mkdir -p ccloud-package/usr/share/icons/hicolor/512x512/apps
# Copy application files
cp -r build/linux/x64/release/bundle/* ccloud-package/usr/bin/
# Copy desktop file
cp linux/runner/ccloud.desktop ccloud-package/usr/share/applications/
# Copy icons
cp linux/assets/16x16.png ccloud-package/usr/share/icons/hicolor/16x16/apps/ccloud.png
cp linux/assets/22x22.png ccloud-package/usr/share/icons/hicolor/22x22/apps/ccloud.png
cp linux/assets/24x24.png ccloud-package/usr/share/icons/hicolor/24x24/apps/ccloud.png
cp linux/assets/32x32.png ccloud-package/usr/share/icons/hicolor/32x32/apps/ccloud.png
cp linux/assets/48x48.png ccloud-package/usr/share/icons/hicolor/48x48/apps/ccloud.png
cp linux/assets/64x64.png ccloud-package/usr/share/icons/hicolor/64x64/apps/ccloud.png
cp linux/assets/128x128.png ccloud-package/usr/share/icons/hicolor/128x128/apps/ccloud.png
cp linux/assets/256x256.png ccloud-package/usr/share/icons/hicolor/256x256/apps/ccloud.png
cp linux/assets/512x512.png ccloud-package/usr/share/icons/hicolor/512x512/apps/ccloud.png
# Create symbolic links for library dependencies
mkdir -p ccloud-package/usr/lib/ccloud
ln -sf /usr/lib/x86_64-linux-gnu/libgtk-3.so.0 ccloud-package/usr/lib/ccloud/libgtk-3.so.0
ln -sf /usr/lib/x86_64-linux-gnu/libgdk-3.so.0 ccloud-package/usr/lib/ccloud/libgdk-3.so.0
ln -sf /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 ccloud-package/usr/lib/ccloud/libgobject-2.0.so.0
ln -sf /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 ccloud-package/usr/lib/ccloud/libglib-2.0.so.0
# Ensure release directory exists
mkdir -p release
# Get version from pubspec.yaml
VERSION=$(grep '^version:' pubspec.yaml | cut -d ':' -f 2 | tr -d ' ')
# Create DEB package
fpm -s dir -t deb \
-n ccloud \
-v $VERSION \
--description "CCloud Application" \
--url "https://github.com/code3-dev/CCloud-GUI" \
--maintainer "Hossein Pira" \
--vendor "CCloud" \
--license "MIT" \
--category "Utility" \
--depends "libgtk-3-0" \
--depends "liblzma5" \
-C ccloud-package \
--package release/ccloud.deb \
.
# Create RPM package
fpm -s dir -t rpm \
-n ccloud \
-v $VERSION \
--description "CCloud" \
--url "https://github.com/code3-dev/CCloud-GUI" \
--maintainer "Hossein Pira" \
--vendor "CCloud" \
--license "MIT" \
--category "Applications/Utilities" \
--depends "gtk3" \
--depends "xz-libs" \
-C ccloud-package \
--package release/ccloud.rpm \
.
shell: bash
- name: Create Linux AppImage (Optional)
run: |
# Ensure release directory exists
mkdir -p release
# Get version from pubspec.yaml
VERSION=$(grep '^version:' pubspec.yaml | cut -d ':' -f 2 | tr -d ' ')
echo "Building AppImage for version: $VERSION"
# Download linuxdeploy tool
echo "Downloading linuxdeploy..."
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
chmod +x linuxdeploy-x86_64.AppImage
# Download linuxdeploy-plugin-gtk plugin
echo "Downloading gtk plugin..."
wget -c "https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh"
chmod +x linuxdeploy-plugin-gtk.sh
# Create AppDir structure
echo "Creating AppDir structure..."
mkdir -p ccloud_gui.AppDir/usr/bin
cp -r build/linux/x64/release/bundle/* ccloud_gui.AppDir/usr/bin/
# Copy desktop file to AppDir root with correct name
echo "Copying desktop file..."
cp linux/runner/ccloud.desktop ccloud_gui.AppDir/ccloud.desktop
# Update desktop file for AppImage
sed -i 's|Exec=/usr/bin/ccloud_gui/AppRun|Exec=ccloud_gui|g' ccloud_gui.AppDir/ccloud.desktop
# Copy icon to AppDir root with correct name
echo "Copying icon..."
cp linux/assets/256x256.png ccloud_gui.AppDir/ccloud_gui.png
# Make sure the executable is properly linked
chmod +x ccloud_gui.AppDir/usr/bin/ccloud_gui
# List files for debugging
echo "AppDir contents:"
find ccloud_gui.AppDir -type f
# Create AppImage with GTK plugin to bundle required libraries
echo "Creating AppImage..."
LDAI_OUTPUT=release/CCloud-$VERSION-linux.AppImage ./linuxdeploy-x86_64.AppImage \
--appdir ccloud_gui.AppDir \
--plugin gtk \
--output appimage
shell: bash
- name: Package Linux build
run: |
mkdir -p release
# Check if bundle directory exists
if [ ! -d "build/linux/x64/release/bundle" ]; then
echo "Error: bundle directory not found"
ls -la build/linux/x64/release/
exit 1
fi
# Create tar.gz archive of the Linux build
tar -czf release/CCloud-linux.tar.gz -C build/linux/x64/release bundle/
- name: Upload Linux artifacts
uses: actions/upload-artifact@v4
with:
name: linux-build
path: |
release/CCloud-linux.tar.gz
release/CCloud-*-linux.AppImage
release/ccloud.deb
release/ccloud.rpm
release:
needs: [build-windows, build-macos, build-linux]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download Windows artifacts
uses: actions/download-artifact@v4
with:
name: windows-build
- name: Download macOS artifacts
uses: actions/download-artifact@v4
with:
name: macos-build
- name: Download Linux artifacts
uses: actions/download-artifact@v4
with:
name: linux-build
- name: Get tag name
id: get_tag
run: |
if [[ $GITHUB_EVENT_NAME == 'workflow_dispatch' ]]; then
echo "TAG_NAME=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
else
echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
fi
# Extract version from pubspec.yaml
VERSION=$(grep '^version:' pubspec.yaml | cut -d ':' -f 2 | tr -d ' ')
echo "VERSION=$VERSION" >> $GITHUB_ENV
shell: bash
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.TAG_NAME }}
name: Release ${{ env.TAG_NAME }}
draft: false
prerelease: false
files: |
ccloud_gui-setup.exe
CCloud-windows-portable.zip
CCloud-macos-universal.dmg
CCloud-macos-universal.zip
CCloud-linux.tar.gz
CCloud-*-linux.AppImage
ccloud.deb
ccloud.rpm
body: |
## CCloud Release ${{ env.TAG_NAME }}
### Important Note for Windows Users
If you encounter any errors when installing or running CCloud on Windows, please install the Microsoft Visual C++ Redistributable 2015-2022 and then try installing or running CCloud again.
You can download it from the official Microsoft website: [Microsoft Visual C++ Redistributable](https://docs.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist)
### Download
| Platform | Architecture | Download |
|----------|-------------|----------|
| Windows | x64 (Installer) | <a href="https://github.com/code3-dev/CCloud-GUI/releases/download/${{ env.TAG_NAME }}/ccloud_gui-setup.exe"><img src="https://img.shields.io/badge/Windows-Installer-0078D6?style=for-the-badge&logo=windows&logoColor=white" alt="Windows Installer"></a> |
| Windows | x64 (Portable ZIP) | <a href="https://github.com/code3-dev/CCloud-GUI/releases/download/${{ env.TAG_NAME }}/CCloud-windows-portable.zip"><img src="https://img.shields.io/badge/Windows-x64--Portable--ZIP-0078D6?style=for-the-badge&logo=windows&logoColor=white" alt="Windows x64 Portable ZIP"></a> |
| macOS | Universal (.dmg) | <a href="https://github.com/code3-dev/CCloud-GUI/releases/download/${{ env.TAG_NAME }}/CCloud-macos-universal.dmg"><img src="https://img.shields.io/badge/macOS-Universal-000000?style=for-the-badge&logo=apple&logoColor=white" alt="macOS Universal DMG"></a> |
| macOS | Universal (.zip) | <a href="https://github.com/code3-dev/CCloud-GUI/releases/download/${{ env.TAG_NAME }}/CCloud-macos-universal.zip"><img src="https://img.shields.io/badge/macOS-Universal-000000?style=for-the-badge&logo=apple&logoColor=white" alt="macOS Universal ZIP"></a> |
| Linux | x64 (tar.gz) | <a href="https://github.com/code3-dev/CCloud-GUI/releases/download/${{ env.TAG_NAME }}/CCloud-linux.tar.gz"><img src="https://img.shields.io/badge/Linux-tar.gz-FCC624?style=for-the-badge&logo=linux&logoColor=black" alt="Linux tar.gz"></a> |
| Linux | x64 (AppImage) | <a href="https://github.com/code3-dev/CCloud-GUI/releases/download/${{ env.TAG_NAME }}/CCloud-${{ env.VERSION }}-linux.AppImage"><img src="https://img.shields.io/badge/Linux-AppImage-FCC624?style=for-the-badge&logo=linux&logoColor=black" alt="Linux AppImage"></a> |
| Linux | x64 (.deb) | <a href="https://github.com/code3-dev/CCloud-GUI/releases/download/${{ env.TAG_NAME }}/ccloud.deb"><img src="https://img.shields.io/badge/Linux-.deb-FCC624?style=for-the-badge&logo=debian&logoColor=white" alt="Linux .deb"></a> |
| Linux | x64 (.rpm) | <a href="https://github.com/code3-dev/CCloud-GUI/releases/download/${{ env.TAG_NAME }}/ccloud.rpm"><img src="https://img.shields.io/badge/Linux-.rpm-FCC624?style=for-the-badge&logo=redhat&logoColor=white" alt="Linux .rpm"></a> |
| Android | Universal APK | <a href="https://github.com/code3-dev/CCloud/releases/latest/download/CCloud-universal.apk"><img src="https://img.shields.io/badge/Android-APK-3DDC84?style=for-the-badge&logo=android&logoColor=white" alt="Android Universal APK"></a> |
For detailed instructions on installing and running CCloud on Linux, please refer to our [Linux Installation Guide](https://github.com/code3-dev/CCloud-GUI/blob/main/assets/LINUX_INSTALL.md).