chore: add Flatpak packaging and update metadata for v1.1.9 release #42
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
| # .github/workflows/build.yml | |
| # This workflow builds, packages, and creates a draft release for the application on Windows (x64), | |
| # macOS (x64, arm64), and Linux (x64, arm64), including AppImage for Linux. | |
| name: Build and Release | |
| on: | |
| push: | |
| branches: [ "release" ] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| include: | |
| - os: ubuntu-22.04 | |
| arch: "x64" | |
| runner: "ubuntu-22.04" | |
| gradle_task: "packageReleaseDeb" | |
| os_name: "ubuntu" | |
| - os: ubuntu-22.04-arm | |
| arch: "arm64" | |
| runner: "ubuntu-22.04-arm" | |
| gradle_task: "packageReleaseDeb" | |
| os_name: "ubuntu" | |
| - os: ubuntu-latest | |
| arch: "x64" | |
| runner: "ubuntu-latest" | |
| os_name: "rocky-linux-8" | |
| - os: ubuntu-24.04-arm | |
| arch: "arm64" | |
| runner: "ubuntu-24.04-arm" | |
| os_name: "rocky-linux-8" | |
| - os: macos-13 | |
| arch: "x64" | |
| runner: "macos-13" | |
| gradle_task: "packageReleaseDmg packageReleasePkg" | |
| os_name: "macos" | |
| - os: macos-latest | |
| arch: "arm64" | |
| runner: "macos-15" | |
| gradle_task: "packageReleaseDmg packageReleasePkg" | |
| os_name: "macos" | |
| - os: windows-latest | |
| arch: "x64" | |
| runner: "windows-latest" | |
| gradle_task: "packageReleaseMsi packageReleaseExe" | |
| os_name: "windows" | |
| - os: windows-11-arm | |
| arch: "arm64" | |
| runner: "windows-11-arm" | |
| gradle_task: "packageReleaseMsi packageReleaseExe" | |
| os_name: "windows" | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Update and Install Dependencies for Ubuntu | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| - name: Install Dependencies for Rocky Linux | |
| if: matrix.os_name == 'rocky-linux-8' | |
| run: | | |
| sudo apt-get install -y curl wget git gnupg ca-certificates libfuse2 curl unzip binutils file libglib2.0-0 | |
| - name: Set up JDK 21 for Windows ARM | |
| if: matrix.os == 'windows-11-arm' | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '21' | |
| architecture: ${{ matrix.arch }} | |
| - name: Set up JDK 24 for other architectures | |
| if: ${{ matrix.os != 'windows-11-arm' && matrix.os_name != 'rocky-linux-8' }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '24' | |
| architecture: ${{ matrix.arch }} | |
| - name: Remove JVM args for Windows ARM | |
| if: matrix.os == 'windows-11-arm' | |
| shell: powershell | |
| run: | | |
| $content = Get-Content composeApp/build.gradle.kts | |
| $content = $content | Where-Object { | |
| $_ -notmatch '"--enable-native-access=ALL-UNNAMED",' -and | |
| $_ -notmatch '"--illegal-native-access=deny"' | |
| } | |
| $content | Set-Content composeApp/build.gradle.kts | |
| - name: Grant execute permission for gradlew | |
| if: runner.os != 'Windows' | |
| run: chmod +x ./gradlew | |
| - name: Build Jar with Gradle on Windows | |
| if: matrix.os_name == 'windows' | |
| shell: bash | |
| run: ./gradlew.bat -PosArch=${{ matrix.arch }} ${{ matrix.gradle_task }} packageReleaseUberJarForCurrentOS | |
| - name: Build Jar with Gradle on macOS | |
| if: matrix.os_name == 'macos' | |
| run: ./gradlew -PosArch=${{ matrix.arch }} ${{ matrix.gradle_task }} packageReleaseUberJarForCurrentOS | |
| - name: Build Jar with Gradle on Ubuntu | |
| if: matrix.os_name == 'ubuntu' | |
| run: ./gradlew -PosArch=${{ matrix.arch }} ${{ matrix.gradle_task }} packageReleaseUberJarForCurrentOS | |
| - name: Build AppImage on Rocky Linux 8 | |
| if: matrix.os_name == 'rocky-linux-8' | |
| shell: bash | |
| run: | | |
| docker run --rm \ | |
| -v ${{ github.workspace }}:${{ github.workspace }} \ | |
| -w ${{ github.workspace }} \ | |
| -e ARCH=${{ matrix.arch }} \ | |
| -e WORKSPACE_PATH="${{ github.workspace }}" \ | |
| rockylinux:8 /bin/bash packaging/build-scripts/package.sh | |
| - name: Rename Packages for Release | |
| shell: bash | |
| run: | | |
| ARTIFACT_DIR="composeApp/build/compose/binaries/main-release" | |
| ARCH="${{ matrix.arch }}" | |
| rename_files() { | |
| DIR_PATH="$1" | |
| EXT="$2" | |
| if [ -d "$DIR_PATH" ]; then | |
| for f in "$DIR_PATH"/*."$EXT"; do | |
| if [ -f "$f" ]; then | |
| # Constructs the new name, e.g., app-1.0.0.msi -> app-1.0.0-x64.msi | |
| NEW_NAME="$(basename "$f" ."$EXT")-$ARCH.$EXT" | |
| echo "Renaming $f to $DIR_PATH/$NEW_NAME" | |
| mv "$f" "$DIR_PATH/$NEW_NAME" | |
| fi | |
| done | |
| fi | |
| } | |
| # Rename only the package types that have conflicting names | |
| rename_files "$ARTIFACT_DIR/dmg" "dmg" | |
| rename_files "$ARTIFACT_DIR/pkg" "pkg" | |
| rename_files "$ARTIFACT_DIR/msi" "msi" | |
| rename_files "$ARTIFACT_DIR/exe" "exe" | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: package-${{ matrix.os_name }}-${{ matrix.arch }} | |
| path: | | |
| composeApp/build/compose/binaries/main-release/deb/*.deb | |
| composeApp/build/compose/binaries/main-release/appimage/*.AppImage | |
| composeApp/build/compose/binaries/main-release/appimage/*.zsync | |
| composeApp/build/compose/binaries/main-release/dmg/*.dmg | |
| composeApp/build/compose/binaries/main-release/pkg/*.pkg | |
| composeApp/build/compose/binaries/main-release/msi/*.msi | |
| composeApp/build/compose/binaries/main-release/exe/*.exe | |
| composeApp/build/compose/jars/*.jar | |
| composeApp/build/compose/binaries/main-release/tarball/*.tar.gz | |
| retention-days: 1 | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Get Project Version | |
| id: get_version | |
| run: | | |
| # Extracts the version from the line 'packageVersion = "1.0.0"' | |
| VERSION=$(grep 'packageVersion = ' composeApp/build.gradle.kts | head -n 1 | sed -e 's/.*packageVersion = "\(.*\)"/\1/') | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Download all build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Create Draft Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: Pomolin v${{ steps.get_version.outputs.version }} Beta | |
| draft: false | |
| prerelease: false | |
| make_latest: true | |
| tag_name: v${{ steps.get_version.outputs.version }} | |
| body: | | |
| ## Description | |
| Pomolin is a simple, beautiful, and minimalist Pomodoro timer for your desktop. Designed to help you stay focused and productive, it provides an elegant and straightforward way to manage your work and break intervals. With a clean interface and essential features, Pomolin helps you get into a rhythm of focused work sessions followed by refreshing breaks, all from a native desktop application. | |
| ## Installation | |
| ### Windows | |
| - **Installer**: Download the `.exe` or `.msi` installer for easy setup with automatic shortcuts and uninstaller | |
| ### macOS | |
| - **Installer**: Download the `.dmg` or `.pkg` installer for standard macOS installation | |
| ### Linux | |
| - **AppImage** (Recommended): Download the `.AppImage` file for universal compatibility across distributions | |
| - **Flatpak**: Available for sandboxed installation. Note: Flatpak from releases does not auto-update. For auto-updates, install from Flathub or GNOME Software | |
| - **Package**: Download `.deb` for Debian/Ubuntu-based systems or `.tar.gz` for manual extraction | |
| ### Java | |
| - **JAR File**: Requires Java 24 installed (Java 21 for Windows 11 ARM64) | |
| - **Run Command**: `java -jar pomolin-windows-x64-1.1.8-release.jar` | |
| #### Linux Installation Tools | |
| For AppImage files, consider using: | |
| - **AppImageLauncher**: Provides desktop integration and automatic updates for AppImage applications | |
| - **Gear Lever**: A modern AppImage manager with GUI for organizing and running AppImage files | |
| ## System Requirements | |
| - **Java Runtime**: Java 24 required for JAR files (Java 21 for Windows 11 ARM64) | |
| - **Operating Systems**: Windows 10+, macOS 10.14+, Linux (distributions released after 2019) | |
| - **Architecture Support**: x64, ARM64 | |
| ## Download Instructions | |
| 1. Choose the appropriate package for your operating system and architecture from the assets below | |
| 2. All builds are automatically generated and tested via GitHub Actions | |
| 3. For JAR files, ensure you have the correct Java version installed | |
| 4. Follow your platform's standard installation procedures | |
| ## Package Types Available | |
| - **Windows**: `.exe` installer, `.msi` installer, `.jar` portable | |
| - **macOS**: `.dmg` installer, `.pkg` installer, `.jar` portable | |
| - **Linux**: `.AppImage` portable, `.flatpak` package, `.tar.gz` archive, `.deb` package, `.jar` portable | |
| - **Cross-platform**: Universal `.jar` files for any Java-compatible system | |
| ## Support | |
| If you encounter any issues with AppImage, Flatpak, or any other installation method, please report them using GitHub Issues. Include your operating system, architecture, and installation method when reporting problems. | |
| files: artifacts/**/* | |
| build-flatpak: | |
| name: Build Flatpak | |
| needs: release # This job will start only after the 'release' job is successful | |
| runs-on: ${{ matrix.runner }} | |
| permissions: | |
| contents: write | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| include: | |
| - arch: "x64" | |
| flatpak_arch: "x86_64" | |
| runner: "ubuntu-latest" | |
| - arch: "arm64" | |
| flatpak_arch: "aarch64" | |
| runner: "ubuntu-24.04-arm" | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Get Project Version | |
| id: get_version | |
| run: | | |
| VERSION=$(grep 'packageVersion = ' composeApp/build.gradle.kts | head -n 1 | sed -e 's/.*packageVersion = "\(.*\)"/\1/') | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Install Flatpak dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y flatpak-builder | |
| sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo | |
| sudo flatpak install --noninteractive flathub org.freedesktop.Sdk/${{ matrix.flatpak_arch }}/24.08 | |
| sudo flatpak install --noninteractive flathub org.freedesktop.Platform/${{ matrix.flatpak_arch }}/24.08 | |
| sudo flatpak install --noninteractive flathub org.freedesktop.Sdk.Extension.openjdk/${{ matrix.flatpak_arch }}/24.08 | |
| - name: Build Flatpak Bundle | |
| run: | | |
| echo "Building Flatpak for ${{ matrix.flatpak_arch }}" | |
| # 1. Build the Flatpak from the manifest file | |
| flatpak-builder --force-clean --repo=repo build-dir packaging/flatpak/pomolin.yml | |
| # 2. Create a single-file bundle from the repository | |
| flatpak build-bundle repo pomolin-${{ matrix.flatpak_arch }}.flatpak io.github.redddfoxxyy.pomolin | |
| echo "Flatpak bundle created: pomolin-${{ matrix.flatpak_arch }}.flatpak" | |
| - name: Upload Flatpak to Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release upload v${{ steps.get_version.outputs.version }} pomolin-${{ matrix.flatpak_arch }}.flatpak --clobber |