diff --git a/.github/workflows/deployment-arm64.yml b/.github/workflows/deployment-arm64.yml index 85aa33b7f11..dad4aaa49d8 100644 --- a/.github/workflows/deployment-arm64.yml +++ b/.github/workflows/deployment-arm64.yml @@ -1,16 +1,23 @@ -name: Deployment Release for ARM64 - Run manually! - +name: Deployment for Arm64 on: + push: + branches: + - main + - main-release + paths-ignore: + - 'docs/**' + - 'src/test/**' + - 'README.md' + tags: + - '*' + pull_request: + merge_group: workflow_dispatch: inputs: notarization: type: boolean - required: true - default: true - push: - branches: - - arm64mac-release - - updateArm64Notarization + required: false + default: false env: SpringerNatureAPIKey: ${{ secrets.SpringerNatureAPIKey }} @@ -30,9 +37,8 @@ jobs: strategy: fail-fast: false matrix: - os: [self-hosted] include: - - os: self-hosted + - os: macos-14 displayName: macOS (Arm64) suffix: '_arm64' runs-on: ${{ matrix.os }} @@ -42,9 +48,9 @@ jobs: id: checksecrets shell: bash run: | - [ -n "$BUILDJABREFPRIVATEKEY" ] || exit 1 + [ -n "$BUILDJABREFPRIVATEKEY" ] || exit 1 env: - BUILDJABREFPRIVATEKEY: ${{ secrets.buildJabRefPrivateKey }} + BUILDJABREFPRIVATEKEY: ${{ secrets.buildJabRefPrivateKey }} - name: Fetch all history for all tags and branches uses: actions/checkout@v4 with: @@ -66,29 +72,27 @@ jobs: - name: Clean up keychain run: | security delete-keychain signing_temp.keychain ${{runner.temp}}/keychain/notarization.keychain || true - - name: Setup OSX key chain on macOS + - name: Setup OSX key chain on macOS-arm + if: (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 OSX key chain on OSX for app id cert + if: (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: Create notarization keychain - run: | - mkdir ${{runner.temp}}/keychain - security create-keychain -p jabref ${{runner.temp}}/keychain/notarization.keychain - security set-keychain-settings ${{runner.temp}}/keychain/notarization.keychain - name: Setup Gradle uses: gradle/gradle-build-action@v3 - name: Prepare merged jars and modules dir (macOS) run: ./gradlew -i -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" prepareModulesDir - name: Build dmg (macOS) + if: (steps.checksecrets.outputs.secretspresent == 'YES') shell: bash run: | jpackage \ @@ -113,6 +117,7 @@ jobs: --file-associations buildres/mac/bibtexAssociations.properties \ --jlink-options --bind-services - name: Build pkg (macOS) + if: (steps.checksecrets.outputs.secretspresent == 'YES') shell: bash run: | jpackage \ @@ -137,32 +142,85 @@ jobs: --file-associations buildres/mac/bibtexAssociations.properties \ --jlink-options --bind-services - name: Rename files with arm64 suffix as well + if: (steps.checksecrets.outputs.secretspresent == 'YES') shell: bash run: | mv build/distribution/JabRef-${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}.dmg build/distribution/JabRef-${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}-arm64.dmg mv build/distribution/JabRef-${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}.pkg build/distribution/JabRef-${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}-arm64.pkg + - name: Setup rsync (macOS) + if: ${{ (!startsWith(github.ref, 'refs/heads/gh-readonly-queue')) && (steps.checksecrets.outputs.secretspresent == 'YES') && ((matrix.os == 'macos-14') && !((startsWith(github.ref, 'refs/tags/') || inputs.notarization == true))) }} + run: brew install rsync + - name: Setup SSH key + if: ${{ (steps.checksecrets.outputs.secretspresent == 'YES') && (!startsWith(github.ref, 'refs/heads/gh-readonly-queue')) && ((matrix.os != 'macos-14') || !((startsWith(github.ref, 'refs/tags/') || (inputs.notarization == true)))) }} + run: | + echo "${{ secrets.buildJabRefPrivateKey }}" > sshkey + chmod 600 sshkey + - 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-14') && !((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-14') && (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-arm-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 + + notarize: # outsourced in a separate job to be able to rerun if this fails for timeouts + name: macOS notarization-arm + runs-on: macos-14 + 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-arm-tbn + path: build/distribution/ - name: Notarize dmg - if: (startsWith(github.ref, 'refs/tags/') || (${{ inputs.notarization }})) + 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 }}" --keychain ${{runner.temp}}/keychain/notarization.keychain - xcrun notarytool submit build/distribution/JabRef-${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}-arm64.dmg --keychain-profile "notarytool-profile" --keychain ${{runner.temp}}/keychain/notarization.keychain --wait - xcrun stapler staple build/distribution/JabRef-${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}-arm64.dmg + 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 }}-arm64.dmg --keychain-profile "notarytool-profile" --wait + xcrun stapler staple build/distribution/JabRef-${{ needs.build.outputs.major }}.${{ needs.build.outputs.minor }}-arm64.dmg - name: Notarize pkg - if: (startsWith(github.ref, 'refs/tags/') || (${{ inputs.notarization }})) + 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 }}" --keychain ${{runner.temp}}/keychain/notarization.keychain - xcrun notarytool submit build/distribution/JabRef-${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}-arm64.pkg --keychain-profile "notarytool-profile" --keychain ${{runner.temp}}/keychain/notarization.keychain --wait - xcrun stapler staple build/distribution/JabRef-${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}-arm64.pkg - - name: Upload with rsync - if: ${{ !startsWith(github.ref, 'refs/heads/gh-readonly-queue') }} + 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 }}-arm64.pkg --keychain-profile "notarytool-profile" --wait + xcrun stapler staple build/distribution/JabRef-${{ needs.build.outputs.major }}.${{ needs.build.outputs.minor }}-arm64.pkg + - name: Upload to builds.jabref.org + if: (steps.checksecrets.outputs.secretspresent == 'YES') shell: bash run: | - rsync -Pavz --itemize-changes --stats --partial-dir=/tmp/partial --rsync-path="mkdir -p /var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }} && rsync" -e 'ssh -p 9922 -i ~/.ssh/id_rsa' build/distribution/ jrrsync@build-upload.jabref.org:/var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }}/ - - name: Upload to GitHub workflow artifacts store - if: ${{ !startsWith(github.ref, 'refs/heads/gh-readonly-queue') }} - uses: actions/upload-artifact@v4 - with: - name: JabRef-${{ matrix.displayName }} - path: build/distribution + 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 }}/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 8783e3c4ba0..c83a4906cc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv - We added a fetcher for [ISIDORE](https://isidore.science/), simply paste in the link into the text field or the last 6 digits in the link that identify that paper. [#10423](https://github.com/JabRef/jabref/issues/10423) - When importing entries form the "Citation relations" tab, the field [cites](https://docs.jabref.org/advanced/entryeditor/entrylinks) is now filled according to the relationship between the entries. [#10572](https://github.com/JabRef/jabref/pull/10752) - We added a new group icon column to the main table showing the icons of the entry's groups. [#10801](https://github.com/JabRef/jabref/pull/10801) +- We added a new boolean to the style files for Openoffice/Libreoffice integration to switch between ZERO_WIDTH_SPACE (default) and no space. [#10843](https://github.com/JabRef/jabref/pull/10843) ### Changed @@ -36,6 +37,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv - The last page of a PDF is now indexed by the full text search. [#10193](https://github.com/JabRef/jabref/issues/10193) - We fixed an issue where the duplicate check did not take umlauts or other LaTeX-encoded characters into account. [#10744](https://github.com/JabRef/jabref/pull/10744) - We fixed the colors of the icon on hover for unset special fields. [#10431](https://github.com/JabRef/jabref/issues/10431) +- We fixed an issue where the CrossRef field did not work if autocompletion was disabled [#8145](https://github.com/JabRef/jabref/issues/8145) ### Removed diff --git a/src/main/java/org/jabref/gui/LibraryTab.java b/src/main/java/org/jabref/gui/LibraryTab.java index ea00153a7a4..66b1c4588ec 100644 --- a/src/main/java/org/jabref/gui/LibraryTab.java +++ b/src/main/java/org/jabref/gui/LibraryTab.java @@ -568,8 +568,8 @@ private void setupAutoCompletion() { if (autoCompletePreferences.shouldAutoComplete()) { suggestionProviders = new SuggestionProviders(getDatabase(), Globals.journalAbbreviationRepository, autoCompletePreferences); } else { - // Create empty suggestion providers if auto-completion is deactivated - suggestionProviders = new SuggestionProviders(); + // Create suggestion providers with database for crossref if auto-completion is deactivated + suggestionProviders = new SuggestionProviders(getDatabase()); } searchAutoCompleter = new PersonNameSuggestionProvider(FieldFactory.getPersonNameFields(), getDatabase()); } diff --git a/src/main/java/org/jabref/gui/autocompleter/SuggestionProviders.java b/src/main/java/org/jabref/gui/autocompleter/SuggestionProviders.java index 06d2abef8a8..7d023f4d815 100644 --- a/src/main/java/org/jabref/gui/autocompleter/SuggestionProviders.java +++ b/src/main/java/org/jabref/gui/autocompleter/SuggestionProviders.java @@ -22,12 +22,21 @@ public SuggestionProviders(BibDatabase database, JournalAbbreviationRepository a this.isEmpty = false; } + public SuggestionProviders(BibDatabase database) { + this.database = database; + this.isEmpty = true; + } + public SuggestionProviders() { this.isEmpty = true; } public SuggestionProvider getForField(Field field) { if (isEmpty || !autoCompletePreferences.getCompleteFields().contains(field)) { + Set fieldProperties = field.getProperties(); + if (fieldProperties.contains(FieldProperty.SINGLE_ENTRY_LINK)) { + return new BibEntrySuggestionProvider(database); + } return new EmptySuggestionProvider(); } diff --git a/src/main/java/org/jabref/logic/openoffice/frontend/UpdateCitationMarkers.java b/src/main/java/org/jabref/logic/openoffice/frontend/UpdateCitationMarkers.java index 3993afdf9a0..9f5f1eeb99d 100644 --- a/src/main/java/org/jabref/logic/openoffice/frontend/UpdateCitationMarkers.java +++ b/src/main/java/org/jabref/logic/openoffice/frontend/UpdateCitationMarkers.java @@ -78,8 +78,11 @@ public static void fillCitationMarkInCursor(XTextDocument doc, if (withText) { OOText citationText2 = style.decorateCitationMarker(citationText); - // inject a ZERO_WIDTH_SPACE to hold the initial character format - final String ZERO_WIDTH_SPACE = "\u200b"; + String ZERO_WIDTH_SPACE = ""; + if (style.spaceBeforeCitation()) { + // inject a ZERO_WIDTH_SPACE to hold the initial character format + ZERO_WIDTH_SPACE = "\u200b"; + } citationText2 = OOText.fromString(ZERO_WIDTH_SPACE + citationText2.toString()); OOTextIntoOO.write(doc, cursor, citationText2); } else { diff --git a/src/main/java/org/jabref/logic/openoffice/style/OOBibStyle.java b/src/main/java/org/jabref/logic/openoffice/style/OOBibStyle.java index d0e5fa605ab..36650dc662b 100644 --- a/src/main/java/org/jabref/logic/openoffice/style/OOBibStyle.java +++ b/src/main/java/org/jabref/logic/openoffice/style/OOBibStyle.java @@ -109,6 +109,7 @@ public class OOBibStyle implements Comparable { private static final String AUTHOR_FIELD = "AuthorField"; private static final String BRACKET_AFTER = "BracketAfter"; private static final String BRACKET_BEFORE = "BracketBefore"; + private static final String SPACE_BEFORE = "SpaceBefore"; private static final String IS_NUMBER_ENTRIES = "IsNumberEntries"; private static final String IS_SORT_BY_POSITION = "IsSortByPosition"; private static final String SORT_ALGORITHM = "SortAlgorithm"; @@ -203,6 +204,7 @@ private void setDefaultProperties() { citProperties.put(IN_TEXT_YEAR_SEPARATOR, " "); citProperties.put(BRACKET_BEFORE, "("); citProperties.put(BRACKET_AFTER, ")"); + citProperties.put(SPACE_BEFORE, Boolean.TRUE); citProperties.put(CITATION_SEPARATOR, "; "); citProperties.put(PAGE_INFO_SEPARATOR, "; "); citProperties.put(GROUPED_NUMBERS_SEPARATOR, "-"); @@ -493,6 +495,10 @@ public boolean isFormatCitations() { return (Boolean) citProperties.get(FORMAT_CITATIONS); } + public boolean spaceBeforeCitation() { + return (Boolean) citProperties.get(SPACE_BEFORE); + } + public boolean isCitationKeyCiteMarkers() { return (Boolean) citProperties.get(CITATION_KEY_CITATIONS); } diff --git a/src/test/resources/org/jabref/logic/openoffice/style/test.jstyle b/src/test/resources/org/jabref/logic/openoffice/style/test.jstyle index 3ecd9bfbf08..7d81444002c 100644 --- a/src/test/resources/org/jabref/logic/openoffice/style/test.jstyle +++ b/src/test/resources/org/jabref/logic/openoffice/style/test.jstyle @@ -27,6 +27,7 @@ FormatCitations="false" CitationCharacterFormat="Default" PageInfoSeparator="; " OxfordComma="," +SpaceBefore="true" LAYOUT article=\format[Authors(LastFirst,Semicolon)]{\author} (\year\uniq). \title, \journal \volume\begin{pages} : \format[FormatPagesForHTML]{\pages}\end{pages}. diff --git a/src/test/resources/org/jabref/logic/openoffice/style/testWithDefaultAtFirstLIne.jstyle b/src/test/resources/org/jabref/logic/openoffice/style/testWithDefaultAtFirstLIne.jstyle index 2a4dcf7a697..f2d7d13611a 100644 --- a/src/test/resources/org/jabref/logic/openoffice/style/testWithDefaultAtFirstLIne.jstyle +++ b/src/test/resources/org/jabref/logic/openoffice/style/testWithDefaultAtFirstLIne.jstyle @@ -27,6 +27,7 @@ FormatCitations="false" CitationCharacterFormat="Default" PageInfoSeparator="; " OxfordComma="," +SpaceBefore="true" LAYOUT