From 0bcacbed7fed7864a44f9a04eaf15a405adc450b Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Tue, 24 Oct 2023 22:43:04 +0200 Subject: [PATCH 1/5] Try latest badass-jlink-plugin plugin --- .github/workflows/deployment.yml | 6 ++++++ build.gradle | 15 ++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 0352cf29551..a2d5a7bec7c 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -95,6 +95,12 @@ jobs: java-version: 21.0.1 distribution: 'liberica' cache: 'gradle' + - name: Setup badass-jlink-plugin + run: | + git clone --depth=1 git@github.com:beryx/badass-jlink-plugin.git + cd badass-jlink-plugin/ + ./gradlew shadowJar + mvn install:install-file -Dfile=build/libs/badass-jlink-plugin-3.0.1.jar -DgroupId=org.beryx.jlink -DartifactId=org.beryx.jlink.gradle.plugin -Dversion=3.0.2 -Dpackaging=jar - name: Prepare merged jars and modules dir (macOS) if: (matrix.os == 'macos-latest') || (steps.checksecrets.outputs.secretspresent == 'NO') run: ./gradlew -i -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" prepareModulesDir diff --git a/build.gradle b/build.gradle index c77ae3f8613..83c2790d005 100644 --- a/build.gradle +++ b/build.gradle @@ -2,6 +2,15 @@ import org.gradle.internal.os.OperatingSystem import org.jabref.build.xjc.XjcPlugin import org.jabref.build.xjc.XjcTask +buildscript { + repositories { + mavenLocal() + } + dependencies { + classpath 'org.beryx.jlink:org.beryx.jlink.gradle.plugin:3.0.2' + } +} + plugins { id 'application' @@ -13,8 +22,6 @@ plugins { id 'org.openjfx.javafxplugin' version '0.1.0' - id 'org.beryx.jlink' version '3.0.0' - // nicer test outputs during running and completion // Homepage: https://github.com/radarsh/gradle-test-logger-plugin id 'com.adarshr.test-logger' version '4.0.0' @@ -30,6 +37,9 @@ plugins { id 'org.openrewrite.rewrite' version '6.4.0' } +apply plugin: 'org.beryx.jlink' + + // Enable following for debugging // gradle.startParameter.showStacktrace = org.gradle.api.logging.configuration.ShowStacktrace. @@ -546,7 +556,6 @@ tasks.register('deleteInstallerTemp', Delete) { } jpackage.dependsOn deleteInstallerTemp -jlinkZip.dependsOn jpackage jlink { addOptions('--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages') launcher { From 8c878306a6c8c60b3423e8b726b9769347c4a119 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Tue, 24 Oct 2023 22:51:54 +0200 Subject: [PATCH 2/5] Change clone URL --- .github/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index a2d5a7bec7c..2a7ea09953c 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -97,7 +97,7 @@ jobs: cache: 'gradle' - name: Setup badass-jlink-plugin run: | - git clone --depth=1 git@github.com:beryx/badass-jlink-plugin.git + git clone --depth=1 https://github.com/beryx/badass-jlink-plugin.git cd badass-jlink-plugin/ ./gradlew shadowJar mvn install:install-file -Dfile=build/libs/badass-jlink-plugin-3.0.1.jar -DgroupId=org.beryx.jlink -DartifactId=org.beryx.jlink.gradle.plugin -Dversion=3.0.2 -Dpackaging=jar From 67c81beb470425b5db66579627b95c007fbcb34a Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Tue, 24 Oct 2023 22:59:33 +0200 Subject: [PATCH 3/5] Let's try Java 17 --- .github/workflows/deployment.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 2a7ea09953c..a5d4a927a5e 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -92,7 +92,7 @@ jobs: - name: Setup JDK uses: actions/setup-java@v3 with: - java-version: 21.0.1 + java-version: '17.0.9' distribution: 'liberica' cache: 'gradle' - name: Setup badass-jlink-plugin @@ -101,6 +101,12 @@ jobs: cd badass-jlink-plugin/ ./gradlew shadowJar mvn install:install-file -Dfile=build/libs/badass-jlink-plugin-3.0.1.jar -DgroupId=org.beryx.jlink -DartifactId=org.beryx.jlink.gradle.plugin -Dversion=3.0.2 -Dpackaging=jar + - name: Setup JDK + uses: actions/setup-java@v3 + with: + java-version: 21.0.1 + distribution: 'liberica' + cache: 'gradle' - name: Prepare merged jars and modules dir (macOS) if: (matrix.os == 'macos-latest') || (steps.checksecrets.outputs.secretspresent == 'NO') run: ./gradlew -i -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" prepareModulesDir From 827ab2a88d6fa5c595d15727c63a405bbcced14c Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Tue, 24 Oct 2023 23:18:17 +0200 Subject: [PATCH 4/5] Fix shell --- .github/workflows/deployment.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 2090f8890d1..9c0b9d9444b 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -96,6 +96,7 @@ jobs: distribution: 'liberica' cache: 'gradle' - name: Setup badass-jlink-plugin + shell: bash run: | git clone --depth=1 https://github.com/beryx/badass-jlink-plugin.git cd badass-jlink-plugin/ From b18172f83b5906e19cff6dfaa9939cadb64df2d6 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Tue, 24 Oct 2023 23:35:08 +0200 Subject: [PATCH 5/5] Enable binary building on forks --- .github/workflows/deployment.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 9c0b9d9444b..6594335a75b 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -109,7 +109,7 @@ jobs: distribution: 'liberica' cache: 'gradle' - name: Prepare merged jars and modules dir (macOS) - if: (matrix.os == 'macos-latest') || (steps.checksecrets.outputs.secretspresent == 'NO') + if: (matrix.os == 'macos-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') run: ./gradlew -i -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" prepareModulesDir - name: Setup macOS key chain if: (matrix.os == 'macos-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') @@ -177,21 +177,21 @@ jobs: --file-associations buildres/mac/bibtexAssociations.properties \ --jlink-options --bind-services - name: Build runtime image and installer (linux, Windows) - if: (matrix.os != 'macos-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') + if: (matrix.os != 'macos-latest') || (steps.checksecrets.outputs.secretspresent != 'YES') shell: bash run: ./gradlew -i -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" jpackage jlinkZip - name: Package application image (linux, Windows) - if: (matrix.os != 'macos-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') + if: (matrix.os != 'macos-latest') shell: bash run: ${{ matrix.archivePortable }} - name: Rename files - if: (matrix.os != 'macos-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') + if: (matrix.os != 'macos-latest') shell: pwsh run: | get-childitem -Path build/distribution/* | rename-item -NewName {$_.name -replace "${{ steps.gitversion.outputs.AssemblySemVer }}","${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}"} get-childitem -Path build/distribution/* | rename-item -NewName {$_.name -replace "portable","${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}-portable"} - name: Repack deb file for Debian - if: (matrix.os == 'ubuntu-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') + if: (matrix.os == 'ubuntu-latest') shell: bash run: | cd build/distribution