Enlarge and center the app icon; regenerate all sizes and icon.ico #4
Workflow file for this run
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: Release | |
| # Build a portable bundle (Java runtime embedded) for Windows, macOS and Linux | |
| # whenever a version tag is pushed, and attach them to the GitHub Release. | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| package: | |
| name: Portable (${{ matrix.label }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - { os: windows-latest, label: windows } | |
| - { os: macos-latest, label: macos } | |
| - { os: ubuntu-latest, label: linux } | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '21' | |
| - name: Version from tag | |
| id: ver | |
| shell: bash | |
| run: echo "v=$(echo "${GITHUB_REF_NAME#v}" | sed 's/-.*//')" >> "$GITHUB_OUTPUT" | |
| - name: Install the vendored DSPark engine, then build | |
| shell: bash | |
| run: | | |
| mvn -B -ntp install:install-file -Dfile=libs/dspark-0.1.0.jar -DpomFile=libs/dspark-0.1.0.pom | |
| mvn -B -ntp -DskipTests clean package | |
| mvn -B -ntp dependency:copy-dependencies -DincludeScope=runtime -DoutputDirectory=target/app | |
| cp target/quickmaster.jar target/app/ | |
| - name: Build the macOS icon | |
| if: runner.os == 'macOS' | |
| shell: bash | |
| run: | | |
| mkdir -p icon.iconset | |
| for s in 16 32 64 128 256 512; do | |
| sips -z $s $s docs/icon-master.png --out "icon.iconset/icon_${s}x${s}.png" >/dev/null | |
| d=$((s * 2)) | |
| sips -z $d $d docs/icon-master.png --out "icon.iconset/icon_${s}x${s}@2x.png" >/dev/null | |
| done | |
| iconutil -c icns icon.iconset -o docs/icon.icns | |
| - name: Package the portable app image | |
| shell: bash | |
| run: | | |
| ICON=docs/icon-master.png | |
| [ "$RUNNER_OS" = "Windows" ] && ICON=docs/icon.ico | |
| [ "$RUNNER_OS" = "macOS" ] && ICON=docs/icon.icns | |
| jpackage --type app-image \ | |
| --name QuickMaster \ | |
| --app-version "${{ steps.ver.outputs.v }}" \ | |
| --vendor "Cristian Moresi" \ | |
| --input target/app \ | |
| --main-jar quickmaster.jar \ | |
| --main-class com.quickmaster.Launcher \ | |
| --icon "$ICON" \ | |
| --add-modules java.base,java.desktop,java.scripting,java.sql,java.logging,java.xml,java.prefs,java.management,java.naming,jdk.jfr,jdk.unsupported,jdk.zipfs,jdk.localedata \ | |
| --dest dist | |
| - name: Zip the bundle (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: Compress-Archive -Path dist/QuickMaster -DestinationPath "QuickMaster-windows-${{ steps.ver.outputs.v }}.zip" | |
| - name: Zip the bundle (macOS / Linux) | |
| if: runner.os != 'Windows' | |
| shell: bash | |
| run: (cd dist && zip -ry "../QuickMaster-${{ matrix.label }}-${{ steps.ver.outputs.v }}.zip" .) | |
| - name: Attach to the release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: QuickMaster-${{ matrix.label }}-${{ steps.ver.outputs.v }}.zip |