Jpackage Windows #2
This file contains 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: Jpackage Windows | |
on: | |
workflow_dispatch: | |
jobs: | |
build-gradle-project: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout project sources | |
uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
with: | |
gradle-version: '7.3.3' | |
- name: Install WiX Toolset | |
run: choco install wixtoolset | |
- name: Change wrapper permissions | |
run: powershell Set-ExecutionPolicy Unrestricted -Scope Process -Force; ./gradlew.bat | |
- name: Run customFatJar task | |
run: ./gradlew customFatJar | |
- name: Check jpackage availability | |
run: | | |
jpackage --input build\libs\ --name PassMan --main-jar PassManJAR-1.0-SNAPSHOT.jar --main-class com.heshanthenura.passman.Launcher --type msi --win-dir-chooser --dest build\win\ --win-menu --win-shortcut --app-version 1.0 --vendor "Heshan Thenura" --icon icon/icon.png | |
- name: List contents of build/win directory | |
run: dir build\win | |
- name: Create release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v1.0 | |
release_name: PassMan-win | |
draft: false | |
prerelease: false | |
- name: Upload MSI to release | |
if: success() | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: build/win/PassMan-1.0.msi | |
asset_name: PassMan-win.msi | |
asset_content_type: application/octet-stream |