Build and Release #22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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/ | |
| # Create ZIP archive of the Linux build | |
| # First ensure the release directory exists at the correct relative path | |
| mkdir -p build/linux/x64/release/../../release | |
| cd build/linux/x64/release | |
| zip -r ../../release/CCloud-linux.zip bundle/ | |
| - name: Upload Linux artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-build | |
| path: | | |
| release/CCloud-linux.tar.gz | |
| release/CCloud-linux.zip | |
| 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.zip | |
| 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 (ZIP) | <a href="https://github.com/code3-dev/CCloud-GUI/releases/download/${{ env.TAG_NAME }}/CCloud-linux.zip"><img src="https://img.shields.io/badge/Linux-ZIP-FCC624?style=for-the-badge&logo=linux&logoColor=black" alt="Linux ZIP"></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). |