Build Compose Multiplatform App #12
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 Compose Multiplatform App | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| - name: Make Gradle Wrapper executable | |
| if: runner.os != 'Windows' | |
| run: chmod +x ./gradlew | |
| # Package for Linux (.deb) | |
| - name: Package .deb (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| ./gradlew :composeApp:packageReleaseDeb \ | |
| --no-daemon --info --stacktrace > gradle.log 2>&1 || true | |
| # Package for macOS (.dmg) | |
| - name: Package .dmg (macOS) | |
| if: runner.os == 'macOS' | |
| run: | | |
| ./gradlew :composeApp:packageReleaseDmg \ | |
| --no-daemon --info --stacktrace > gradle.log 2>&1 || true | |
| # Package for Windows (.msi) | |
| - name: Package .msi (Windows) | |
| if: runner.os == 'Windows' | |
| shell: bash | |
| run: | | |
| ./gradlew :composeApp:packageReleaseMsi --no-daemon --info --stacktrace > gradle.log 2>&1 || true | |
| # Always upload the Gradle log | |
| - name: Upload build logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: gradle-log-${{ matrix.os }} | |
| path: gradle.log | |
| # Upload the installer for each OS | |
| - name: Upload .deb installer (Linux) | |
| if: runner.os == 'Linux' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: deb-installer | |
| path: composeApp/build/compose/binaries/**/deb/*.deb | |
| - name: Upload .dmg installer (macOS) | |
| if: runner.os == 'macOS' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dmg-installer | |
| path: composeApp/build/compose/binaries/**/dmg/*.dmg | |
| - name: Upload .msi installer (Windows) | |
| if: runner.os == 'Windows' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: msi-installer | |
| path: composeApp/build/compose/binaries/**/msi/*.msi |