Build for 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: Build for windows | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'App version' | |
required: true | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: maven | |
- name: Update yt-dlp | |
run: packaging/bin/windows/yt-dlp.exe -U | |
- name: Install fx-controls into local Maven repository | |
run: mvn install:install-file -Dfile='./lib/fx-controls-1.0.jar' -DgroupId='com.github.engatec' -DartifactId='fx-controls' -Dversion='1.0' -Dpackaging='jar' -DgeneratePom='true' | |
- name: Build with Maven | |
run: mvn clean package -Dassembly=windows | |
- name: Copy vdl.jar to binaries folder | |
run: cp target/vdl-assembly-windows.jar packaging/bin/windows/vdl.jar | |
- name: Create jar for update | |
run: cp target/vdl-assembly-windows.jar upd_windows.jar | |
- name: Create portable | |
run: jpackage --input packaging/bin/windows --name "vdl" --app-version ${{github.event.inputs.version}} --main-jar vdl.jar --main-class com.github.engatec.vdl.MainWrapper --icon packaging/icons/icon.ico --type app-image --java-options "-Dapp.dir=`$APPDIR -Dapp.ytdlp=yt-dlp.exe -Dapp.portable=true -Dapp.logPath=`$APPDIR -Djavafx.cachedir=`$APPDIR\cache" | |
- name: Zip portable | |
run: 7z a vdl-video-downloader-${{github.event.inputs.version}}-windows-portable.zip vdl/* | |
- name: Create installer | |
run: jpackage --input packaging/bin/windows --name "vdl" --app-version ${{github.event.inputs.version}} --main-jar vdl.jar --main-class com.github.engatec.vdl.MainWrapper --icon packaging/icons/icon.ico --type msi --java-options "-Dapp.dir=`$APPDIR -Dapp.ytdlp=yt-dlp.exe" --win-dir-chooser --win-shortcut | |
- name: Rename installer | |
run: mv vdl-${{github.event.inputs.version}}.msi vdl-video-downloader-${{github.event.inputs.version}}-windows.msi | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: vdl_win_package | |
path: | | |
upd_windows.jar | |
vdl-video-downloader-${{github.event.inputs.version}}-windows-portable.zip | |
vdl-video-downloader-${{github.event.inputs.version}}-windows.msi | |
retention-days: 1 |