diff --git a/.github/scripts/jpackage-per-machine.bat b/.github/scripts/jpackage-per-machine.bat new file mode 100644 index 000000000..bdac78885 --- /dev/null +++ b/.github/scripts/jpackage-per-machine.bat @@ -0,0 +1,31 @@ +for /F %%i in ('%JAVA_HOME%\bin\jdeps --module-path %JAVAFX_HOME% --print-module-deps --ignore-missing-deps %GITHUB_WORKSPACE%/app/target/lib/scenebuilder-%APP_VERSION%-all.jar') do SET JDEPS_MODULES=%%i + +REM jdeps doesn't include JavaFX modules in Windows +set JAVAFX_MODULES=javafx.fxml,javafx.media,javafx.swing,javafx.web + +%JAVA_HOME%\bin\jlink ^ +--module-path %JAVAFX_HOME% ^ +--add-modules %JDEPS_MODULES%,%JAVAFX_MODULES% ^ +--output app/target/runtime ^ +--strip-debug --compress 2 --no-header-files --no-man-pages + +%JPACKAGE_HOME%\bin\jpackage ^ +--app-version %APP_VERSION% ^ +--input app/target/lib ^ +--license-file LICENSE.txt ^ +--main-jar scenebuilder-%APP_VERSION%-all.jar ^ +--main-class %MAIN_CLASS% ^ +--name SceneBuilder ^ +--description "Scene Builder" ^ +--vendor Gluon ^ +--verbose ^ +--runtime-image app/target/runtime ^ +--dest %INSTALL_DIR% ^ +--type msi ^ +--java-options "--add-opens=javafx.fxml/javafx.fxml=ALL-UNNAMED" ^ +--java-options "-Djava.library.path=runtime\bin;runtime\lib" ^ +--icon app/assets/windows/icon-windows.ico ^ +--win-dir-chooser ^ +--win-menu ^ +--win-menu-group "Scene Builder" ^ +--win-shortcut diff --git a/.github/workflows/bundles-windows.yml b/.github/workflows/bundles-windows.yml index ede5252e0..0abeaf132 100644 --- a/.github/workflows/bundles-windows.yml +++ b/.github/workflows/bundles-windows.yml @@ -75,7 +75,7 @@ jobs: env: APP_VERSION: ${{ inputs.app-version }} - - name: Create Bundle using JPackage + - name: Create per-user Bundle using JPackage shell: cmd run: | call .github\scripts\jpackage.bat @@ -98,8 +98,37 @@ jobs: certificatename: '${{ secrets.WINDOWS_CERTNAME }}' folder: 'app/target/install' - - name: Upload Artifact + - name: Upload Artifact (per user) uses: actions/upload-artifact@v4 with: name: SceneBuilder-${{ inputs.project-version }}.msi path: app/target/install/*.msi + + - name: Create per-machine Bundle using JPackage + shell: cmd + run: | + call .github\scripts\jpackage-per-machine.bat + call ren ${{ env.INSTALL_DIR }}\SceneBuilder-${{ env.APP_VERSION }}.msi SceneBuilder-per-machine-${{ env.PROJECT_VERSION }}.msi + call dir ${{ env.INSTALL_DIR }} + env: + MAIN_CLASS: com.oracle.javafx.scenebuilder.app.SceneBuilderApp + JAVAFX_HOME: D:\javafx-jmods-${{ steps.javafx.outputs.JAVAFX_MAJOR_VERSION }} + JPACKAGE_HOME: ${{ env.JAVA_HOME }} + PROJECT_VERSION: ${{ inputs.project-version }} + APP_VERSION: ${{ inputs.app-version }} + INSTALL_DIR: app\target\install + + - name: Codesign + uses: erwin1/code-sign-action@master + if: false + with: + certificate: '${{ secrets.WINDOWS_CERTIFICATE }}' + password: '${{ secrets.WINDOWS_PASSWORD }}' + certificatename: '${{ secrets.WINDOWS_CERTNAME }}' + folder: 'app/target/install' + + - name: Upload Artifact (per machine) + uses: actions/upload-artifact@v4 + with: + name: SceneBuilder-per-machine-${{ inputs.project-version }}.msi + path: app/target/install/*.msi