From c6a0feeca6f5ba027bf570f305262c7ada4c119f Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Wed, 21 Feb 2024 20:52:14 +0100 Subject: [PATCH 01/21] Add JDK EA build --- .github/workflows/deployment-jdk-ea.yml | 313 ++++++++++++++++++++++++ 1 file changed, 313 insertions(+) create mode 100644 .github/workflows/deployment-jdk-ea.yml diff --git a/.github/workflows/deployment-jdk-ea.yml b/.github/workflows/deployment-jdk-ea.yml new file mode 100644 index 00000000000..119947a8a7d --- /dev/null +++ b/.github/workflows/deployment-jdk-ea.yml @@ -0,0 +1,313 @@ +# This workflow is a clone of "deployment.yml" +# The difference is that this workflow uses JDK early access builds (jdk-ea) to check the build of JabRef +# We separated this from the main workflow as we do not want to check on each PR if the JDK build, but only on main +name: Deployment (JDK early access builds) + +on: + push: + branches: + - main + paths-ignore: + - 'docs/**' + - 'src/test/**' + - 'README.md' + pull_request: + paths: + - .github/workflows/deployment-jdk-ea.yml + workflow_dispatch: + inputs: + notarization: + type: boolean + required: false + default: false + +env: + SpringerNatureAPIKey: ${{ secrets.SpringerNatureAPIKey }} + AstrophysicsDataSystemAPIKey: ${{ secrets.AstrophysicsDataSystemAPIKey }} + IEEEAPIKey: ${{ secrets.IEEEAPIKey }} + BiodiversityHeritageApiKey: ${{ secrets.BiodiversityHeritageApiKey}} + OSXCERT: ${{ secrets.OSX_SIGNING_CERT }} + GRADLE_OPTS: -Xmx4g -Dorg.gradle.vfs.watch=false + JAVA_OPTS: -Xmx4g + +concurrency: + group: "${{ github.workflow }}-${{ github.head_ref || github.ref }}" + cancel-in-progress: true + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + jdk: [22, 23] + include: + - os: ubuntu-latest + displayName: linux + archivePortable: tar -c -C build/distribution JabRef | pigz --rsyncable > build/distribution/JabRef-portable_linux.tar.gz && rm -R build/distribution/JabRef + - os: windows-latest + displayName: windows + archivePortable: 7z a -r build/distribution/JabRef-portable_windows.zip ./build/distribution/JabRef && rm -R build/distribution/JabRef + - os: macos-latest + displayName: macOS + runs-on: ${{ matrix.os }} + outputs: + major: ${{ steps.gitversion.outputs.Major }} + minor: ${{ steps.gitversion.outputs.Minor }} + branchname: ${{ steps.gitversion.outputs.branchName }} + name: ${{ matrix.displayName }} installer and portable version + steps: + - name: Check secrets presence + id: checksecrets + shell: bash + run: | + if [ "$BUILDJABREFPRIVATEKEY" == "" ]; then + echo "secretspresent=NO" >> $GITHUB_OUTPUT + else + echo "secretspresent=YES" >> $GITHUB_OUTPUT + fi + env: + BUILDJABREFPRIVATEKEY: ${{ secrets.buildJabRefPrivateKey }} + - name: Fetch all history for all tags and branches + uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: 'true' + show-progress: 'false' + - name: Install pigz and cache (linux) + if: (matrix.os == 'ubuntu-latest') + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: pigz + version: 1.0 + - name: Install GitVersion + uses: gittools/actions/gitversion/setup@v0.11.0 + with: + versionSpec: "5.x" + - name: Run GitVersion + id: gitversion + uses: gittools/actions/gitversion/execute@v0.11.0 + - name: 'Set up JDK ${{ matrix.jdk }}' + uses: oracle-actions/setup-java@v1 + with: + website: jdk.java.net + release: ${{ matrix.jdk }} + version: latest + - name: 'Prepare JDK${{ matrix.jdk }} env var' + shell: bash + run: echo "JDK${{ matrix.jdk }}=$JAVA_HOME" >> $GITHUB_ENV + - name: Setup JDK + uses: actions/setup-java@v4 + with: + java-version: 21.0.2 + distribution: 'liberica' + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + - name: Prepare merged jars and modules dir (macOS) + # prepareModulesDir is executing a build, which should run through even if no upload to builds.jabref.org is made + if: (matrix.os == 'macos-latest') || (steps.checksecrets.outputs.secretspresent == 'NO') + run: ./gradlew -PjavaToolchainVersion=${{ matrix.jdk }} -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') + uses: apple-actions/import-codesign-certs@v2 + with: + p12-file-base64: ${{ secrets.OSX_SIGNING_CERT }} + p12-password: ${{ secrets.OSX_CERT_PWD }} + keychain-password: jabref + - name: Setup macOS key chain for app id cert + if: (matrix.os == 'macos-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') + uses: apple-actions/import-codesign-certs@v2 + with: + p12-file-base64: ${{ secrets.OSX_SIGNING_CERT_APPLICATION }} + p12-password: ${{ secrets.OSX_CERT_PWD }} + create-keychain: false + keychain-password: jabref + - name: Build dmg (macOS) + if: (matrix.os == 'macos-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') + shell: bash + run: | + jpackage \ + --module org.jabref/org.jabref.Launcher \ + --module-path ${{env.JAVA_HOME}}/jmods/:build/jlinkbase/jlinkjars \ + --add-modules org.jabref,org.jabref.merged.module \ + --dest build/distribution \ + --app-content buildres/mac/jabrefHost.py \ + --app-content buildres/mac/native-messaging-host \ + --name JabRef \ + --app-version ${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }} \ + --verbose \ + --mac-sign \ + --vendor "JabRef e.V." \ + --mac-package-identifier JabRef \ + --mac-package-name JabRef \ + --type dmg --mac-signing-key-user-name "JabRef e.V. (6792V39SK3)" \ + --mac-package-signing-prefix org.jabref \ + --mac-entitlements buildres/mac/jabref.entitlements \ + --icon src/main/resources/icons/jabref.icns \ + --resource-dir buildres/mac \ + --file-associations buildres/mac/bibtexAssociations.properties \ + --jlink-options --bind-services + - name: Build pkg (macOS) + if: (matrix.os == 'macos-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') + shell: bash + run: | + jpackage \ + --module org.jabref/org.jabref.Launcher \ + --module-path ${{env.JAVA_HOME}}/jmods/:build/jlinkbase/jlinkjars \ + --add-modules org.jabref,org.jabref.merged.module \ + --dest build/distribution \ + --app-content buildres/mac/jabrefHost.py \ + --app-content buildres/mac/native-messaging-host \ + --name JabRef \ + --app-version ${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }} \ + --verbose \ + --mac-sign \ + --vendor "JabRef e.V." \ + --mac-package-identifier JabRef \ + --mac-package-name JabRef \ + --type pkg --mac-signing-key-user-name "JabRef e.V. (6792V39SK3)" \ + --mac-package-signing-prefix org.jabref \ + --mac-entitlements buildres/mac/jabref.entitlements \ + --icon src/main/resources/icons/jabref.icns \ + --resource-dir buildres/mac \ + --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') + 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') + shell: bash + run: ${{ matrix.archivePortable }} + - name: Rename files + if: (matrix.os != 'macos-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') + 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') + shell: bash + run: | + cd build/distribution + ar x jabref_${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}_amd64.deb + zstd -d < control.tar.zst | xz > control.tar.xz + zstd -d < data.tar.zst | xz > data.tar.xz + ar -m -c -a sdsd jabref_${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}_amd64_repackaged.deb debian-binary control.tar.xz data.tar.xz + rm debian-binary control.tar.* data.tar.* + mv -f jabref_${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}_amd64_repackaged.deb jabref_${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}_amd64.deb + - name: Setup rsync (macOS) + if: ${{ (!startsWith(github.ref, 'refs/heads/gh-readonly-queue')) && (steps.checksecrets.outputs.secretspresent == 'YES') && ((matrix.os == 'macos-latest') && !((startsWith(github.ref, 'refs/tags/') || inputs.notarization == true))) }} + run: brew install rsync + - name: Setup rsync (Windows) + if: (matrix.os == 'windows-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') && (!startsWith(github.ref, 'refs/heads/gh-readonly-queue')) + # We want to have rsync available at this place to avoid uploading and downloading from GitHub artifact store (taking > 5 minutes in total) + # We cannot use "action-rsyncer", because that requires Docker which is unavailable on Windows + # We cannot use "setup-rsync", because that does not work on Windows + # We do not use egor-tensin/setup-cygwin@v4, because it replaces the default shell + run: choco install --no-progress rsync + - name: Setup SSH key + if: ${{ (steps.checksecrets.outputs.secretspresent == 'YES') && (!startsWith(github.ref, 'refs/heads/gh-readonly-queue')) && ((matrix.os != 'macos-latest') || !((startsWith(github.ref, 'refs/tags/') || (inputs.notarization == true)))) }} + run: | + echo "${{ secrets.buildJabRefPrivateKey }}" > sshkey + chmod 600 sshkey + - name: Upload to builds.jabref.org (Windows) + if: (matrix.os == 'windows-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') && (!startsWith(github.ref, 'refs/heads/gh-readonly-queue')) + shell: cmd + # for rsync installed by chocolatey, we need the ssh.exe delivered with that installation + run: | + rsync -rt --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r --itemize-changes --stats --rsync-path="mkdir -p /var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }} && rsync" -e 'C:\ProgramData\chocolatey\lib\rsync\tools\bin\ssh.exe -p 9922 -i sshkey -o StrictHostKeyChecking=no' build/distribution/ jrrsync@build-upload.jabref.org:/var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }}/ + - name: Upload to builds.jabref.org (linux, macOS) + # macOS: Negated condition of "Upload to GitHub workflow artifacts store (macOS)" + # Reason: We either upload the non-notarized files - or notarize the files later (and upload these later) + # needs to be on one line; multi line does not work + if: ${{ (!startsWith(github.ref, 'refs/heads/gh-readonly-queue')) && (steps.checksecrets.outputs.secretspresent == 'YES') && ((matrix.os == 'ubuntu-latest') || ((matrix.os == 'macos-latest') && !((startsWith(github.ref, 'refs/tags/') || inputs.notarization == true)))) }} + shell: bash + run: | + rsync -rt --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r --itemize-changes --stats --rsync-path="mkdir -p /var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }} && rsync" -e 'ssh -p 9922 -i sshkey -o StrictHostKeyChecking=no' build/distribution/ jrrsync@build-upload.jabref.org:/var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }}/ + - name: Upload to GitHub workflow artifacts store (macOS) + if: (matrix.os == 'macos-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') && (startsWith(github.ref, 'refs/tags/') || inputs.notarization == true) + uses: actions/upload-artifact@v4 + with: + # tbn = to-be-notarized + name: JabRef-macOS-tbn + path: build/distribution + compression-level: 0 # no compression + - name: Upload to GitHub workflow artifacts store + if: (steps.checksecrets.outputs.secretspresent != 'YES') + uses: actions/upload-artifact@v4 + with: + # tbn = to-be-notarized + name: JabRef-${{ matrix.os }} + path: build/distribution + compression-level: 0 # no compression + announce: + name: Comment on pull request + runs-on: ubuntu-latest + needs: [build] + if: ${{ github.event_name == 'pull_request' }} + steps: + - name: Check secrets presence + id: checksecrets + shell: bash + run: | + if [ "$BUILDJABREFPRIVATEKEY" == "" ]; then + echo "secretspresent=NO" >> $GITHUB_OUTPUT + else + echo "secretspresent=YES" >> $GITHUB_OUTPUT + fi + env: + BUILDJABREFPRIVATEKEY: ${{ secrets.buildJabRefPrivateKey }} + - name: Comment PR + if: (steps.checksecrets.outputs.secretspresent == 'YES') + uses: thollander/actions-comment-pull-request@v2 + with: + message: | + The build of this PR is available at . + comment_tag: download-link + mode: recreate + notarize: # outsourced in a separate job to be able to rerun if this fails for timeouts + name: macOS notarization + runs-on: macos-latest + needs: [build] + if: ${{ startsWith(github.ref, 'refs/tags/') || inputs.notarization == true }} + steps: + - name: Check secrets presence + id: checksecrets + shell: bash + run: | + if [ "$BUILDJABREFPRIVATEKEY" == "" ]; then + echo "secretspresent=NO" >> $GITHUB_OUTPUT + else + echo "secretspresent=YES" >> $GITHUB_OUTPUT + fi + env: + BUILDJABREFPRIVATEKEY: ${{ secrets.buildJabRefPrivateKey }} + - name: Download from GitHub workflow artifacts store (macOS) + if: (steps.checksecrets.outputs.secretspresent == 'YES') + uses: actions/download-artifact@master + with: + name: JabRef-macOS-tbn + path: build/distribution/ + - name: Notarize dmg + if: (steps.checksecrets.outputs.secretspresent == 'YES') + shell: bash + run: | + xcrun notarytool store-credentials "notarytool-profile" --apple-id "vorstand@jabref.org" --team-id "6792V39SK3" --password "${{ secrets.OSX_NOTARIZATION_APP_PWD }}" + xcrun notarytool submit build/distribution/JabRef-${{ needs.build.outputs.major }}.${{ needs.build.outputs.minor }}.dmg --keychain-profile "notarytool-profile" --wait + xcrun stapler staple build/distribution/JabRef-${{ needs.build.outputs.major }}.${{ needs.build.outputs.minor }}.dmg + - name: Notarize pkg + if: (steps.checksecrets.outputs.secretspresent == 'YES') + shell: bash + run: | + xcrun notarytool store-credentials "notarytool-profile" --apple-id "vorstand@jabref.org" --team-id "6792V39SK3" --password "${{ secrets.OSX_NOTARIZATION_APP_PWD }}" + xcrun notarytool submit build/distribution/JabRef-${{ needs.build.outputs.major }}.${{ needs.build.outputs.minor }}.pkg --keychain-profile "notarytool-profile" --wait + xcrun stapler staple build/distribution/JabRef-${{ needs.build.outputs.major }}.${{ needs.build.outputs.minor }}.pkg + - name: Upload to builds.jabref.org + if: (steps.checksecrets.outputs.secretspresent == 'YES') + shell: bash + run: | + echo "${{ secrets.buildJabRefPrivateKey }}" > sshkey + chmod 600 sshkey + rsync -rt --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r --itemize-changes --stats --rsync-path="mkdir -p /var/www/builds.jabref.org/www/${{ needs.build.outputs.branchname }} && rsync" -e 'ssh -p 9922 -i sshkey -o StrictHostKeyChecking=no' build/distribution/ jrrsync@build-upload.jabref.org:/var/www/builds.jabref.org/www/${{ needs.build.outputs.branchname }}/ From a53367f1e9ac03a3197139ee8bee05cb70b4e377 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Wed, 21 Feb 2024 21:04:03 +0100 Subject: [PATCH 02/21] Remove obsolete comment --- .github/workflows/deployment-jdk-ea.yml | 1 - .github/workflows/deployment.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/deployment-jdk-ea.yml b/.github/workflows/deployment-jdk-ea.yml index 119947a8a7d..6784ab64639 100644 --- a/.github/workflows/deployment-jdk-ea.yml +++ b/.github/workflows/deployment-jdk-ea.yml @@ -238,7 +238,6 @@ jobs: if: (steps.checksecrets.outputs.secretspresent != 'YES') uses: actions/upload-artifact@v4 with: - # tbn = to-be-notarized name: JabRef-${{ matrix.os }} path: build/distribution compression-level: 0 # no compression diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 6430b42c062..997dc580748 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -227,7 +227,6 @@ jobs: if: (steps.checksecrets.outputs.secretspresent != 'YES') uses: actions/upload-artifact@v4 with: - # tbn = to-be-notarized name: JabRef-${{ matrix.os }} path: build/distribution compression-level: 0 # no compression From 7ea299165d5a4d189f47eca0e9e26a63660d8ddb Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Wed, 21 Feb 2024 21:04:22 +0100 Subject: [PATCH 03/21] Rename files --- .github/workflows/deployment-jdk-ea.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deployment-jdk-ea.yml b/.github/workflows/deployment-jdk-ea.yml index 6784ab64639..24f967a86c9 100644 --- a/.github/workflows/deployment-jdk-ea.yml +++ b/.github/workflows/deployment-jdk-ea.yml @@ -55,7 +55,7 @@ jobs: major: ${{ steps.gitversion.outputs.Major }} minor: ${{ steps.gitversion.outputs.Minor }} branchname: ${{ steps.gitversion.outputs.branchName }} - name: ${{ matrix.displayName }} installer and portable version + name: "JDK ${{ matrix.jdk }}: ${{ matrix.displayName }} installer and portable version" steps: - name: Check secrets presence id: checksecrets @@ -197,6 +197,14 @@ jobs: ar -m -c -a sdsd jabref_${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}_amd64_repackaged.deb debian-binary control.tar.xz data.tar.xz rm debian-binary control.tar.* data.tar.* mv -f jabref_${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}_amd64_repackaged.deb jabref_${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}_amd64.deb + - name: Rename files with JDK version + shell: bash + run: | + for file in build/distribution/*.*; do + base=${file%.*} + ext=${file##*.} + mv "$file" "${base}-${{ matrix.jdk }}.${ext}" + done - name: Setup rsync (macOS) if: ${{ (!startsWith(github.ref, 'refs/heads/gh-readonly-queue')) && (steps.checksecrets.outputs.secretspresent == 'YES') && ((matrix.os == 'macos-latest') && !((startsWith(github.ref, 'refs/tags/') || inputs.notarization == true))) }} run: brew install rsync From 45484eef9a7a81b28c9bc094ad8b6a126a4bafb8 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Wed, 21 Feb 2024 21:39:20 +0100 Subject: [PATCH 04/21] Fix gradle call --- .github/workflows/deployment-jdk-ea.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment-jdk-ea.yml b/.github/workflows/deployment-jdk-ea.yml index 24f967a86c9..4769fb90793 100644 --- a/.github/workflows/deployment-jdk-ea.yml +++ b/.github/workflows/deployment-jdk-ea.yml @@ -175,7 +175,7 @@ jobs: - name: Build runtime image and installer (linux, Windows) 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 + run: ./gradlew -i -PjavaToolchainVersion=${{ matrix.jdk }} -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') shell: bash From 397c7ce96bb7ad774b8b00faec09fd38d8ab7ef9 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Wed, 21 Feb 2024 21:40:20 +0100 Subject: [PATCH 05/21] Fix filename --- .github/workflows/deployment-jdk-ea.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment-jdk-ea.yml b/.github/workflows/deployment-jdk-ea.yml index 4769fb90793..555fe516e9a 100644 --- a/.github/workflows/deployment-jdk-ea.yml +++ b/.github/workflows/deployment-jdk-ea.yml @@ -203,7 +203,7 @@ jobs: for file in build/distribution/*.*; do base=${file%.*} ext=${file##*.} - mv "$file" "${base}-${{ matrix.jdk }}.${ext}" + mv "$file" "${base}-jdk${{ matrix.jdk }}.${ext}" done - name: Setup rsync (macOS) if: ${{ (!startsWith(github.ref, 'refs/heads/gh-readonly-queue')) && (steps.checksecrets.outputs.secretspresent == 'YES') && ((matrix.os == 'macos-latest') && !((startsWith(github.ref, 'refs/tags/') || inputs.notarization == true))) }} From 547fee91029c7785d19d1894c3a9413f51940d9f Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Wed, 21 Feb 2024 21:51:07 +0100 Subject: [PATCH 06/21] Remove probably conflicting foojay resolver plugin --- settings.gradle | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/settings.gradle b/settings.gradle index 18e2f97a57c..ee77a0edcfa 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,14 +1 @@ -pluginManagement { - repositories { - maven { - url 'https://oss.sonatype.org/content/repositories/snapshots' - } - gradlePluginPortal() - } -} - -plugins { - id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" -} - rootProject.name = "JabRef" From 4963aad668acb0ef77cbab5815f9d40f34827b09 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Wed, 21 Feb 2024 22:04:45 +0100 Subject: [PATCH 07/21] Use jpackage from the requested JDK --- .github/workflows/deployment-jdk-ea.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deployment-jdk-ea.yml b/.github/workflows/deployment-jdk-ea.yml index 555fe516e9a..4731c352612 100644 --- a/.github/workflows/deployment-jdk-ea.yml +++ b/.github/workflows/deployment-jdk-ea.yml @@ -93,7 +93,7 @@ jobs: website: jdk.java.net release: ${{ matrix.jdk }} version: latest - - name: 'Prepare JDK${{ matrix.jdk }} env var' + - name: 'Set JDK${{ matrix.jdk }} env var' shell: bash run: echo "JDK${{ matrix.jdk }}=$JAVA_HOME" >> $GITHUB_ENV - name: Setup JDK @@ -126,7 +126,7 @@ jobs: if: (matrix.os == 'macos-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') shell: bash run: | - jpackage \ + JDK${{ matrix.jdk }}/bin/jpackage \ --module org.jabref/org.jabref.Launcher \ --module-path ${{env.JAVA_HOME}}/jmods/:build/jlinkbase/jlinkjars \ --add-modules org.jabref,org.jabref.merged.module \ @@ -151,7 +151,7 @@ jobs: if: (matrix.os == 'macos-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') shell: bash run: | - jpackage \ + JDK${{ matrix.jdk }}/bin/jpackage \ --module org.jabref/org.jabref.Launcher \ --module-path ${{env.JAVA_HOME}}/jmods/:build/jlinkbase/jlinkjars \ --add-modules org.jabref,org.jabref.merged.module \ From db468c8197e0f6571fbbd2975ae264b15b6a2328 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Wed, 21 Feb 2024 22:10:47 +0100 Subject: [PATCH 08/21] Try other parameters --- .github/workflows/deployment-jdk-ea.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deployment-jdk-ea.yml b/.github/workflows/deployment-jdk-ea.yml index 4731c352612..e51cf2b3b48 100644 --- a/.github/workflows/deployment-jdk-ea.yml +++ b/.github/workflows/deployment-jdk-ea.yml @@ -106,7 +106,7 @@ jobs: - name: Prepare merged jars and modules dir (macOS) # prepareModulesDir is executing a build, which should run through even if no upload to builds.jabref.org is made if: (matrix.os == 'macos-latest') || (steps.checksecrets.outputs.secretspresent == 'NO') - run: ./gradlew -PjavaToolchainVersion=${{ matrix.jdk }} -i -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" prepareModulesDir + run: ./gradlew -i -Porg.gradle.java.installations.auto-download=false javaToolchains -PjavaToolchainVersion=${{ matrix.jdk }} -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') uses: apple-actions/import-codesign-certs@v2 @@ -175,7 +175,7 @@ jobs: - name: Build runtime image and installer (linux, Windows) if: (matrix.os != 'macos-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') shell: bash - run: ./gradlew -i -PjavaToolchainVersion=${{ matrix.jdk }} -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" jpackage jlinkZip + run: ./gradlew -i -Porg.gradle.java.installations.auto-download=false javaToolchains -PjavaToolchainVersion=${{ matrix.jdk }} -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') shell: bash From 6cbef6caa2b143da0e6a81ca0bc253cf0a2b30e6 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Wed, 21 Feb 2024 22:19:18 +0100 Subject: [PATCH 09/21] Add forgotten $ --- .github/workflows/deployment-jdk-ea.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deployment-jdk-ea.yml b/.github/workflows/deployment-jdk-ea.yml index e51cf2b3b48..20f993b3fe1 100644 --- a/.github/workflows/deployment-jdk-ea.yml +++ b/.github/workflows/deployment-jdk-ea.yml @@ -126,7 +126,7 @@ jobs: if: (matrix.os == 'macos-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') shell: bash run: | - JDK${{ matrix.jdk }}/bin/jpackage \ + $JDK${{ matrix.jdk }}/bin/jpackage \ --module org.jabref/org.jabref.Launcher \ --module-path ${{env.JAVA_HOME}}/jmods/:build/jlinkbase/jlinkjars \ --add-modules org.jabref,org.jabref.merged.module \ @@ -151,7 +151,7 @@ jobs: if: (matrix.os == 'macos-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') shell: bash run: | - JDK${{ matrix.jdk }}/bin/jpackage \ + $JDK${{ matrix.jdk }}/bin/jpackage \ --module org.jabref/org.jabref.Launcher \ --module-path ${{env.JAVA_HOME}}/jmods/:build/jlinkbase/jlinkjars \ --add-modules org.jabref,org.jabref.merged.module \ From 83536cd4d47e75e1f5572c47c87af872da603dd9 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Wed, 21 Feb 2024 22:28:51 +0100 Subject: [PATCH 10/21] More brute force... --- .github/workflows/deployment-jdk-ea.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deployment-jdk-ea.yml b/.github/workflows/deployment-jdk-ea.yml index 20f993b3fe1..e98a7c846e8 100644 --- a/.github/workflows/deployment-jdk-ea.yml +++ b/.github/workflows/deployment-jdk-ea.yml @@ -106,7 +106,7 @@ jobs: - name: Prepare merged jars and modules dir (macOS) # prepareModulesDir is executing a build, which should run through even if no upload to builds.jabref.org is made if: (matrix.os == 'macos-latest') || (steps.checksecrets.outputs.secretspresent == 'NO') - run: ./gradlew -i -Porg.gradle.java.installations.auto-download=false javaToolchains -PjavaToolchainVersion=${{ matrix.jdk }} -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" prepareModulesDir + run: ./gradlew -i -Porg.gradle.java.installations.auto-download=false -Porg.gradle.java.installations.auto-detect=false -Porg.gradle.java.installations.paths=$JDK${{ matrix.jdk }} javaToolchains -PjavaToolchainVersion=${{ matrix.jdk }} -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') uses: apple-actions/import-codesign-certs@v2 @@ -175,7 +175,7 @@ jobs: - name: Build runtime image and installer (linux, Windows) if: (matrix.os != 'macos-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') shell: bash - run: ./gradlew -i -Porg.gradle.java.installations.auto-download=false javaToolchains -PjavaToolchainVersion=${{ matrix.jdk }} -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" jpackage jlinkZip + run: ./gradlew -i -Porg.gradle.java.installations.auto-download=false -Porg.gradle.java.installations.auto-detect=false -Porg.gradle.java.installations.paths=$JDK${{ matrix.jdk }} javaToolchains -PjavaToolchainVersion=${{ matrix.jdk }} -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') shell: bash From c06da197501c11944ea97933f05a06f4a662776f Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Wed, 21 Feb 2024 23:01:01 +0100 Subject: [PATCH 11/21] Switch back to Foojay --- .github/workflows/deployment-jdk-ea.yml | 8 ++++++-- settings.gradle | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deployment-jdk-ea.yml b/.github/workflows/deployment-jdk-ea.yml index e98a7c846e8..7517b308001 100644 --- a/.github/workflows/deployment-jdk-ea.yml +++ b/.github/workflows/deployment-jdk-ea.yml @@ -96,6 +96,10 @@ jobs: - name: 'Set JDK${{ matrix.jdk }} env var' shell: bash run: echo "JDK${{ matrix.jdk }}=$JAVA_HOME" >> $GITHUB_ENV + - name: 'Set JDK${{ matrix.jdk }} in toolchain (linux, Windows)' + if: (matrix.os != 'macos-latest') + shell: bash + run: sed -i 's/JavaLanguageVersion.of(.*)/JavaLanguageVersion.of(${{ matrix.jdk }})/' build.gradle - name: Setup JDK uses: actions/setup-java@v4 with: @@ -106,7 +110,7 @@ jobs: - name: Prepare merged jars and modules dir (macOS) # prepareModulesDir is executing a build, which should run through even if no upload to builds.jabref.org is made if: (matrix.os == 'macos-latest') || (steps.checksecrets.outputs.secretspresent == 'NO') - run: ./gradlew -i -Porg.gradle.java.installations.auto-download=false -Porg.gradle.java.installations.auto-detect=false -Porg.gradle.java.installations.paths=$JDK${{ matrix.jdk }} javaToolchains -PjavaToolchainVersion=${{ matrix.jdk }} -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" prepareModulesDir + 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') uses: apple-actions/import-codesign-certs@v2 @@ -175,7 +179,7 @@ jobs: - name: Build runtime image and installer (linux, Windows) if: (matrix.os != 'macos-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') shell: bash - run: ./gradlew -i -Porg.gradle.java.installations.auto-download=false -Porg.gradle.java.installations.auto-detect=false -Porg.gradle.java.installations.paths=$JDK${{ matrix.jdk }} javaToolchains -PjavaToolchainVersion=${{ matrix.jdk }} -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" jpackage jlinkZip + 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') shell: bash diff --git a/settings.gradle b/settings.gradle index ee77a0edcfa..01ad017d95c 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,5 @@ +plugins { + id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" +} + rootProject.name = "JabRef" From 25d054857f00dddc2cf4359fe6887a2b2d187eec Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Wed, 21 Feb 2024 23:08:51 +0100 Subject: [PATCH 12/21] Also on macOS... --- .github/workflows/deployment-jdk-ea.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/deployment-jdk-ea.yml b/.github/workflows/deployment-jdk-ea.yml index 7517b308001..8b4d321385e 100644 --- a/.github/workflows/deployment-jdk-ea.yml +++ b/.github/workflows/deployment-jdk-ea.yml @@ -100,6 +100,10 @@ jobs: if: (matrix.os != 'macos-latest') shell: bash run: sed -i 's/JavaLanguageVersion.of(.*)/JavaLanguageVersion.of(${{ matrix.jdk }})/' build.gradle + - name: 'Set JDK${{ matrix.jdk }} in toolchain (macOS)' + if: (matrix.os == 'macos-latest') + shell: bash + run: sed -i'.bak' 's/JavaLanguageVersion.of(.*)/JavaLanguageVersion.of(${{ matrix.jdk }})/' build.gradle - name: Setup JDK uses: actions/setup-java@v4 with: From e74935c18769c2bd09bd622d3eac5906fe2798fc Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Wed, 21 Feb 2024 23:23:29 +0100 Subject: [PATCH 13/21] Only once a week and other folder --- .github/workflows/deployment-jdk-ea.yml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/deployment-jdk-ea.yml b/.github/workflows/deployment-jdk-ea.yml index 8b4d321385e..0f663abd302 100644 --- a/.github/workflows/deployment-jdk-ea.yml +++ b/.github/workflows/deployment-jdk-ea.yml @@ -4,13 +4,8 @@ name: Deployment (JDK early access builds) on: - push: - branches: - - main - paths-ignore: - - 'docs/**' - - 'src/test/**' - - 'README.md' + schedule: + - cron: "0 5 * * 2" pull_request: paths: - .github/workflows/deployment-jdk-ea.yml @@ -233,7 +228,7 @@ jobs: shell: cmd # for rsync installed by chocolatey, we need the ssh.exe delivered with that installation run: | - rsync -rt --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r --itemize-changes --stats --rsync-path="mkdir -p /var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }} && rsync" -e 'C:\ProgramData\chocolatey\lib\rsync\tools\bin\ssh.exe -p 9922 -i sshkey -o StrictHostKeyChecking=no' build/distribution/ jrrsync@build-upload.jabref.org:/var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }}/ + rsync -rt --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r --itemize-changes --stats --rsync-path="mkdir -p /var/www/builds.jabref.org/www/jdk-ea && rsync" -e 'C:\ProgramData\chocolatey\lib\rsync\tools\bin\ssh.exe -p 9922 -i sshkey -o StrictHostKeyChecking=no' build/distribution/ jrrsync@build-upload.jabref.org:/var/www/builds.jabref.org/www/jdk-ea/ - name: Upload to builds.jabref.org (linux, macOS) # macOS: Negated condition of "Upload to GitHub workflow artifacts store (macOS)" # Reason: We either upload the non-notarized files - or notarize the files later (and upload these later) @@ -241,7 +236,7 @@ jobs: if: ${{ (!startsWith(github.ref, 'refs/heads/gh-readonly-queue')) && (steps.checksecrets.outputs.secretspresent == 'YES') && ((matrix.os == 'ubuntu-latest') || ((matrix.os == 'macos-latest') && !((startsWith(github.ref, 'refs/tags/') || inputs.notarization == true)))) }} shell: bash run: | - rsync -rt --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r --itemize-changes --stats --rsync-path="mkdir -p /var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }} && rsync" -e 'ssh -p 9922 -i sshkey -o StrictHostKeyChecking=no' build/distribution/ jrrsync@build-upload.jabref.org:/var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }}/ + rsync -rt --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r --itemize-changes --stats --rsync-path="mkdir -p /var/www/builds.jabref.org/www/jdk-ea && rsync" -e 'ssh -p 9922 -i sshkey -o StrictHostKeyChecking=no' build/distribution/ jrrsync@build-upload.jabref.org:/var/www/builds.jabref.org/www/jdk-ea/ - name: Upload to GitHub workflow artifacts store (macOS) if: (matrix.os == 'macos-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') && (startsWith(github.ref, 'refs/tags/') || inputs.notarization == true) uses: actions/upload-artifact@v4 @@ -325,4 +320,4 @@ jobs: run: | echo "${{ secrets.buildJabRefPrivateKey }}" > sshkey chmod 600 sshkey - rsync -rt --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r --itemize-changes --stats --rsync-path="mkdir -p /var/www/builds.jabref.org/www/${{ needs.build.outputs.branchname }} && rsync" -e 'ssh -p 9922 -i sshkey -o StrictHostKeyChecking=no' build/distribution/ jrrsync@build-upload.jabref.org:/var/www/builds.jabref.org/www/${{ needs.build.outputs.branchname }}/ + rsync -rt --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r --itemize-changes --stats --rsync-path="mkdir -p /var/www/builds.jabref.org/www/jdk-ea && rsync" -e 'ssh -p 9922 -i sshkey -o StrictHostKeyChecking=no' build/distribution/ jrrsync@build-upload.jabref.org:/var/www/builds.jabref.org/www/jdk-ea/ From e7d47fda7f24524b1eecd22eabecfac143b87554 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Wed, 21 Feb 2024 23:28:37 +0100 Subject: [PATCH 14/21] Also build using the selected Java version --- build.gradle | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 8aed2a42830..37edf2f9d4c 100644 --- a/build.gradle +++ b/build.gradle @@ -41,8 +41,6 @@ group = "org.jabref" version = project.findProperty('projVersion') ?: '100.0.0' java { - sourceCompatibility = JavaVersion.VERSION_21 - targetCompatibility = JavaVersion.VERSION_21 // Workaround needed for Eclipse, probably because of https://github.com/gradle/gradle/issues/16922 // Should be removed as soon as Gradle 7.0.1 is released ( https://github.com/gradle/gradle/issues/16922#issuecomment-828217060 ) modularity.inferModulePath.set(false) @@ -51,6 +49,7 @@ java { // If this is updated, also update // - .devcontainer/devcontainer.json#L34 and // - .gitpod.Dockerfile + // This setting also sets sourceCompatibility and targetCompatibility languageVersion = JavaLanguageVersion.of(21) } } From 8434836b83102bacb0807c9d037b4ff473e82ebc Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Wed, 21 Feb 2024 23:34:00 +0100 Subject: [PATCH 15/21] Revert "Also build using the selected Java version" This reverts commit e7d47fda7f24524b1eecd22eabecfac143b87554. --- build.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 37edf2f9d4c..8aed2a42830 100644 --- a/build.gradle +++ b/build.gradle @@ -41,6 +41,8 @@ group = "org.jabref" version = project.findProperty('projVersion') ?: '100.0.0' java { + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 // Workaround needed for Eclipse, probably because of https://github.com/gradle/gradle/issues/16922 // Should be removed as soon as Gradle 7.0.1 is released ( https://github.com/gradle/gradle/issues/16922#issuecomment-828217060 ) modularity.inferModulePath.set(false) @@ -49,7 +51,6 @@ java { // If this is updated, also update // - .devcontainer/devcontainer.json#L34 and // - .gitpod.Dockerfile - // This setting also sets sourceCompatibility and targetCompatibility languageVersion = JavaLanguageVersion.of(21) } } From d799741a8a6c110bfc067dcddfed15ad6f1976be Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Wed, 21 Feb 2024 23:35:56 +0100 Subject: [PATCH 16/21] Fix jlink call --- .github/workflows/deployment-jdk-ea.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deployment-jdk-ea.yml b/.github/workflows/deployment-jdk-ea.yml index 0f663abd302..b3a4c54237d 100644 --- a/.github/workflows/deployment-jdk-ea.yml +++ b/.github/workflows/deployment-jdk-ea.yml @@ -129,7 +129,10 @@ jobs: if: (matrix.os == 'macos-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') shell: bash run: | - $JDK${{ matrix.jdk }}/bin/jpackage \ + # We cannot use "$JDK${{ matrix.jdk }}/bin/jpackage", because jlink expects the same java class version at .class files + # Gradle can use a toolchain of a newer JDK, but does not support .class files produced by a newer Java version. + # Here we call the latest release jpackage + jpackage \ --module org.jabref/org.jabref.Launcher \ --module-path ${{env.JAVA_HOME}}/jmods/:build/jlinkbase/jlinkjars \ --add-modules org.jabref,org.jabref.merged.module \ @@ -154,7 +157,7 @@ jobs: if: (matrix.os == 'macos-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') shell: bash run: | - $JDK${{ matrix.jdk }}/bin/jpackage \ + jpackage \ --module org.jabref/org.jabref.Launcher \ --module-path ${{env.JAVA_HOME}}/jmods/:build/jlinkbase/jlinkjars \ --add-modules org.jabref,org.jabref.merged.module \ From 66d8551d73d2e7fe5c727f464ce918ad4ee8ccd2 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Wed, 21 Feb 2024 23:56:32 +0100 Subject: [PATCH 17/21] Try internal jpackage again (macOS) --- .github/workflows/deployment-jdk-ea.yml | 61 ++----------------------- 1 file changed, 4 insertions(+), 57 deletions(-) diff --git a/.github/workflows/deployment-jdk-ea.yml b/.github/workflows/deployment-jdk-ea.yml index b3a4c54237d..bd02e4ea29a 100644 --- a/.github/workflows/deployment-jdk-ea.yml +++ b/.github/workflows/deployment-jdk-ea.yml @@ -108,7 +108,7 @@ jobs: uses: gradle/actions/setup-gradle@v3 - name: Prepare merged jars and modules dir (macOS) # prepareModulesDir is executing a build, which should run through even if no upload to builds.jabref.org is made - if: (matrix.os == 'macos-latest') || (steps.checksecrets.outputs.secretspresent == 'NO') + if: (steps.checksecrets.outputs.secretspresent == 'NO') 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') @@ -125,61 +125,8 @@ jobs: p12-password: ${{ secrets.OSX_CERT_PWD }} create-keychain: false keychain-password: jabref - - name: Build dmg (macOS) - if: (matrix.os == 'macos-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') - shell: bash - run: | - # We cannot use "$JDK${{ matrix.jdk }}/bin/jpackage", because jlink expects the same java class version at .class files - # Gradle can use a toolchain of a newer JDK, but does not support .class files produced by a newer Java version. - # Here we call the latest release jpackage - jpackage \ - --module org.jabref/org.jabref.Launcher \ - --module-path ${{env.JAVA_HOME}}/jmods/:build/jlinkbase/jlinkjars \ - --add-modules org.jabref,org.jabref.merged.module \ - --dest build/distribution \ - --app-content buildres/mac/jabrefHost.py \ - --app-content buildres/mac/native-messaging-host \ - --name JabRef \ - --app-version ${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }} \ - --verbose \ - --mac-sign \ - --vendor "JabRef e.V." \ - --mac-package-identifier JabRef \ - --mac-package-name JabRef \ - --type dmg --mac-signing-key-user-name "JabRef e.V. (6792V39SK3)" \ - --mac-package-signing-prefix org.jabref \ - --mac-entitlements buildres/mac/jabref.entitlements \ - --icon src/main/resources/icons/jabref.icns \ - --resource-dir buildres/mac \ - --file-associations buildres/mac/bibtexAssociations.properties \ - --jlink-options --bind-services - - name: Build pkg (macOS) - if: (matrix.os == 'macos-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') - shell: bash - run: | - jpackage \ - --module org.jabref/org.jabref.Launcher \ - --module-path ${{env.JAVA_HOME}}/jmods/:build/jlinkbase/jlinkjars \ - --add-modules org.jabref,org.jabref.merged.module \ - --dest build/distribution \ - --app-content buildres/mac/jabrefHost.py \ - --app-content buildres/mac/native-messaging-host \ - --name JabRef \ - --app-version ${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }} \ - --verbose \ - --mac-sign \ - --vendor "JabRef e.V." \ - --mac-package-identifier JabRef \ - --mac-package-name JabRef \ - --type pkg --mac-signing-key-user-name "JabRef e.V. (6792V39SK3)" \ - --mac-package-signing-prefix org.jabref \ - --mac-entitlements buildres/mac/jabref.entitlements \ - --icon src/main/resources/icons/jabref.icns \ - --resource-dir buildres/mac \ - --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') + - name: Build runtime image and installer + if: (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) @@ -187,7 +134,7 @@ jobs: shell: bash run: ${{ matrix.archivePortable }} - name: Rename files - if: (matrix.os != 'macos-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') + if: (steps.checksecrets.outputs.secretspresent == 'YES') 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 }}"} From 665cd962a0b1fb23a31d77f0ebd3a09098e2dba4 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Thu, 22 Feb 2024 00:07:56 +0100 Subject: [PATCH 18/21] Let's see what MacOS builds... --- .github/workflows/deployment-jdk-ea.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment-jdk-ea.yml b/.github/workflows/deployment-jdk-ea.yml index bd02e4ea29a..5e75e0778d6 100644 --- a/.github/workflows/deployment-jdk-ea.yml +++ b/.github/workflows/deployment-jdk-ea.yml @@ -134,7 +134,7 @@ jobs: shell: bash run: ${{ matrix.archivePortable }} - name: Rename files - if: (steps.checksecrets.outputs.secretspresent == 'YES') + if: (matrix.os != 'macos-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') 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 }}"} From 37c9ef530edca15712b941e77fc72ad3b072d201 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Thu, 22 Feb 2024 00:11:09 +0100 Subject: [PATCH 19/21] No notarization --- .github/workflows/deployment-jdk-ea.yml | 59 +------------------------ 1 file changed, 2 insertions(+), 57 deletions(-) diff --git a/.github/workflows/deployment-jdk-ea.yml b/.github/workflows/deployment-jdk-ea.yml index 5e75e0778d6..a79656aa6b5 100644 --- a/.github/workflows/deployment-jdk-ea.yml +++ b/.github/workflows/deployment-jdk-ea.yml @@ -159,7 +159,7 @@ jobs: mv "$file" "${base}-jdk${{ matrix.jdk }}.${ext}" done - name: Setup rsync (macOS) - if: ${{ (!startsWith(github.ref, 'refs/heads/gh-readonly-queue')) && (steps.checksecrets.outputs.secretspresent == 'YES') && ((matrix.os == 'macos-latest') && !((startsWith(github.ref, 'refs/tags/') || inputs.notarization == true))) }} + if: (matrix.os == 'macos-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') && (!startsWith(github.ref, 'refs/heads/gh-readonly-queue')) run: brew install rsync - name: Setup rsync (Windows) if: (matrix.os == 'windows-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') && (!startsWith(github.ref, 'refs/heads/gh-readonly-queue')) @@ -180,21 +180,10 @@ jobs: run: | rsync -rt --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r --itemize-changes --stats --rsync-path="mkdir -p /var/www/builds.jabref.org/www/jdk-ea && rsync" -e 'C:\ProgramData\chocolatey\lib\rsync\tools\bin\ssh.exe -p 9922 -i sshkey -o StrictHostKeyChecking=no' build/distribution/ jrrsync@build-upload.jabref.org:/var/www/builds.jabref.org/www/jdk-ea/ - name: Upload to builds.jabref.org (linux, macOS) - # macOS: Negated condition of "Upload to GitHub workflow artifacts store (macOS)" - # Reason: We either upload the non-notarized files - or notarize the files later (and upload these later) - # needs to be on one line; multi line does not work - if: ${{ (!startsWith(github.ref, 'refs/heads/gh-readonly-queue')) && (steps.checksecrets.outputs.secretspresent == 'YES') && ((matrix.os == 'ubuntu-latest') || ((matrix.os == 'macos-latest') && !((startsWith(github.ref, 'refs/tags/') || inputs.notarization == true)))) }} + if: (matrix.os != 'windows-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') && (!startsWith(github.ref, 'refs/heads/gh-readonly-queue')) shell: bash run: | rsync -rt --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r --itemize-changes --stats --rsync-path="mkdir -p /var/www/builds.jabref.org/www/jdk-ea && rsync" -e 'ssh -p 9922 -i sshkey -o StrictHostKeyChecking=no' build/distribution/ jrrsync@build-upload.jabref.org:/var/www/builds.jabref.org/www/jdk-ea/ - - name: Upload to GitHub workflow artifacts store (macOS) - if: (matrix.os == 'macos-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') && (startsWith(github.ref, 'refs/tags/') || inputs.notarization == true) - uses: actions/upload-artifact@v4 - with: - # tbn = to-be-notarized - name: JabRef-macOS-tbn - path: build/distribution - compression-level: 0 # no compression - name: Upload to GitHub workflow artifacts store if: (steps.checksecrets.outputs.secretspresent != 'YES') uses: actions/upload-artifact@v4 @@ -227,47 +216,3 @@ jobs: The build of this PR is available at . comment_tag: download-link mode: recreate - notarize: # outsourced in a separate job to be able to rerun if this fails for timeouts - name: macOS notarization - runs-on: macos-latest - needs: [build] - if: ${{ startsWith(github.ref, 'refs/tags/') || inputs.notarization == true }} - steps: - - name: Check secrets presence - id: checksecrets - shell: bash - run: | - if [ "$BUILDJABREFPRIVATEKEY" == "" ]; then - echo "secretspresent=NO" >> $GITHUB_OUTPUT - else - echo "secretspresent=YES" >> $GITHUB_OUTPUT - fi - env: - BUILDJABREFPRIVATEKEY: ${{ secrets.buildJabRefPrivateKey }} - - name: Download from GitHub workflow artifacts store (macOS) - if: (steps.checksecrets.outputs.secretspresent == 'YES') - uses: actions/download-artifact@master - with: - name: JabRef-macOS-tbn - path: build/distribution/ - - name: Notarize dmg - if: (steps.checksecrets.outputs.secretspresent == 'YES') - shell: bash - run: | - xcrun notarytool store-credentials "notarytool-profile" --apple-id "vorstand@jabref.org" --team-id "6792V39SK3" --password "${{ secrets.OSX_NOTARIZATION_APP_PWD }}" - xcrun notarytool submit build/distribution/JabRef-${{ needs.build.outputs.major }}.${{ needs.build.outputs.minor }}.dmg --keychain-profile "notarytool-profile" --wait - xcrun stapler staple build/distribution/JabRef-${{ needs.build.outputs.major }}.${{ needs.build.outputs.minor }}.dmg - - name: Notarize pkg - if: (steps.checksecrets.outputs.secretspresent == 'YES') - shell: bash - run: | - xcrun notarytool store-credentials "notarytool-profile" --apple-id "vorstand@jabref.org" --team-id "6792V39SK3" --password "${{ secrets.OSX_NOTARIZATION_APP_PWD }}" - xcrun notarytool submit build/distribution/JabRef-${{ needs.build.outputs.major }}.${{ needs.build.outputs.minor }}.pkg --keychain-profile "notarytool-profile" --wait - xcrun stapler staple build/distribution/JabRef-${{ needs.build.outputs.major }}.${{ needs.build.outputs.minor }}.pkg - - name: Upload to builds.jabref.org - if: (steps.checksecrets.outputs.secretspresent == 'YES') - shell: bash - run: | - echo "${{ secrets.buildJabRefPrivateKey }}" > sshkey - chmod 600 sshkey - rsync -rt --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r --itemize-changes --stats --rsync-path="mkdir -p /var/www/builds.jabref.org/www/jdk-ea && rsync" -e 'ssh -p 9922 -i sshkey -o StrictHostKeyChecking=no' build/distribution/ jrrsync@build-upload.jabref.org:/var/www/builds.jabref.org/www/jdk-ea/ From b17e4e7252ec7f22f1ccaf25add4706f20e5e7e9 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Thu, 22 Feb 2024 00:30:32 +0100 Subject: [PATCH 20/21] Package JabRef.app --- .github/workflows/deployment-jdk-ea.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deployment-jdk-ea.yml b/.github/workflows/deployment-jdk-ea.yml index a79656aa6b5..c7dc5e6a048 100644 --- a/.github/workflows/deployment-jdk-ea.yml +++ b/.github/workflows/deployment-jdk-ea.yml @@ -45,6 +45,7 @@ jobs: archivePortable: 7z a -r build/distribution/JabRef-portable_windows.zip ./build/distribution/JabRef && rm -R build/distribution/JabRef - os: macos-latest displayName: macOS + archivePortable: tar -c -C build/distribution JabRef.app | pigz --rsyncable > build/distribution/JabRef-portable_macos.tar.gz && rm -R build/distribution/JabRef.app runs-on: ${{ matrix.os }} outputs: major: ${{ steps.gitversion.outputs.Major }} @@ -129,8 +130,8 @@ jobs: if: (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') + - name: Package application image + if: (steps.checksecrets.outputs.secretspresent == 'YES') shell: bash run: ${{ matrix.archivePortable }} - name: Rename files From b6633066c5b95a319c5aa3e6277abdd62b75b336 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Thu, 22 Feb 2024 00:41:07 +0100 Subject: [PATCH 21/21] Fix pigz availabililty --- .github/workflows/deployment-jdk-ea.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment-jdk-ea.yml b/.github/workflows/deployment-jdk-ea.yml index c7dc5e6a048..b79e7b01b19 100644 --- a/.github/workflows/deployment-jdk-ea.yml +++ b/.github/workflows/deployment-jdk-ea.yml @@ -45,7 +45,7 @@ jobs: archivePortable: 7z a -r build/distribution/JabRef-portable_windows.zip ./build/distribution/JabRef && rm -R build/distribution/JabRef - os: macos-latest displayName: macOS - archivePortable: tar -c -C build/distribution JabRef.app | pigz --rsyncable > build/distribution/JabRef-portable_macos.tar.gz && rm -R build/distribution/JabRef.app + archivePortable: brew install pigz && tar -c -C build/distribution JabRef.app | pigz --rsyncable > build/distribution/JabRef-portable_macos.tar.gz && rm -R build/distribution/JabRef.app runs-on: ${{ matrix.os }} outputs: major: ${{ steps.gitversion.outputs.Major }}