@@ -139,10 +139,6 @@ jobs:
139139 jdkVersionFlavour : ${{ steps.binary.outputs.jdkVersionFlavour }}
140140 javafxVersion : ${{ steps.binary.outputs.javafxVersion }}
141141 steps :
142- - uses : awalsh128/cache-apt-pkgs-action@latest
143- with :
144- packages : jq
145- version : 1.0
146142 - name : Determine conditions
147143 id : binary
148144 shell : bash
@@ -426,28 +422,23 @@ jobs:
426422
427423 echo "matrix=$MATRIX_JSON" >> "$GITHUB_OUTPUT"
428424
429- build :
430- needs : [ compute-matrix, conditions, disk-space-check ]
425+ pre- build :
426+ needs : [ conditions, disk-space-check ]
431427 if : ${{ needs.conditions.outputs.should-build == 'true' }}
432- strategy :
433- fail-fast : false
434- matrix :
435- ${{ fromJSON(needs.compute-matrix.outputs.matrix) }}
436- runs-on : ${{ matrix.os }}
428+ runs-on : ubuntu-22.04
437429 outputs :
438- major : ${{ steps.gitversion.outputs.Major }}
439- minor : ${{ steps.gitversion.outputs.Minor }}
440- branchname : ${{ steps.normalize.outputs.branch }}
430+ AssemblySemVer : ${{ steps.gitversion.outputs.AssemblySemVer }}
431+ Major : ${{ steps.gitversion.outputs.Major }}
432+ Minor : ${{ steps.gitversion.outputs.Minor }}
433+ InformationalVersion : ${{ steps.gitversion.outputs.InformationalVersion }}
434+ branch : ${{ steps.normalize.outputs.branch }}
441435 url : ${{ steps.url.outputs.url }}
442- name : ${{ matrix.displayName }} installer and portable version
443436 steps :
444437 - name : Fetch all history for all tags and branches
445438 uses : actions/checkout@v6
446439 with :
447440 fetch-depth : 0
448- submodules : ' true'
449441 show-progress : ' false'
450-
451442 - name : Install GitVersion
452443 id : pre-gitversion
453444 # background: true
@@ -459,6 +450,61 @@ jobs:
459450 # background: true
460451 id : gitversion
461452 uses : gittools/actions/gitversion/execute@v3.2.1
453+ - name : Normalize branch name
454+ id : normalize
455+ # wait: gitversion
456+ shell : bash
457+ run : |
458+ branch="${{ steps.gitversion.outputs.EscapedBranchName }}"
459+ branch="${branch%-merge}" # removes suffix only if present
460+
461+ if [[ "$branch" == tag* ]]; then
462+ # tag builds go into a sub folder
463+ branch="${{ steps.gitversion.outputs.BranchName }}"
464+ fi
465+
466+ echo "branch=$branch" >> "$GITHUB_OUTPUT"
467+ - name : Output URL
468+ if : ${{ needs.disk-space-check.outputs.available == 'true' }}
469+ shell : bash
470+ id : url
471+ run : |
472+ echo "Link: https://builds.jabref.org/${{ steps.normalize.outputs.branch }}/"
473+ echo "Link: <https://builds.jabref.org/${{ steps.normalize.outputs.branch }}/>" >> $GITHUB_STEP_SUMMARY
474+ echo "url=https://builds.jabref.org/${{ steps.normalize.outputs.branch }}/" >> "$GITHUB_OUTPUT"
475+ - name : Setup SSH key
476+ if : ${{ (github.event_name == 'pull_request') && (needs.disk-space-check.outputs.available == 'true') }}
477+ run : |
478+ echo "${{ secrets.buildJabRefPrivateKey }}" > sshkey
479+ chmod 600 sshkey
480+ - name : Create backlink to PR at builds.jabref.org
481+ # background: true
482+ if : ${{ (github.event_name == 'pull_request') && (needs.disk-space-check.outputs.available == 'true') }}
483+ run : |
484+ echo "Link to PR: ${{ github.event.pull_request.html_url }}" >> _h5ai.header.md
485+ 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.normalize.outputs.branch }} && rsync" -e 'ssh -p 9922 -i sshkey -o StrictHostKeyChecking=no' _h5ai.header.md jrrsync@build-upload.jabref.org:/var/www/builds.jabref.org/www/${{ steps.normalize.outputs.branch }}/
486+
487+ build :
488+ needs : [ compute-matrix, conditions, disk-space-check, pre-build ]
489+ if : ${{ needs.conditions.outputs.should-build == 'true' }}
490+ strategy :
491+ fail-fast : false
492+ matrix :
493+ ${{ fromJSON(needs.compute-matrix.outputs.matrix) }}
494+ runs-on : ${{ matrix.os }}
495+ outputs :
496+ major : ${{ needs.pre-build.outputs.Major }}
497+ minor : ${{ needs.pre-build.outputs.Minor }}
498+ branchname : ${{ needs.pre-build.outputs.branch }}
499+ url : ${{ needs.pre-build.outputs.url }}
500+ name : ${{ matrix.displayName }} installer and portable version
501+ steps :
502+ - name : Checkout
503+ uses : actions/checkout@v6
504+ with :
505+ fetch-depth : 1
506+ submodules : ' true'
507+ show-progress : ' false'
462508
463509 - name : Setup SSH key
464510 if : ${{ needs.disk-space-check.outputs.available == 'true' }}
@@ -524,44 +570,15 @@ jobs:
524570 which jlink
525571 jlink --version
526572
527- - name : Normalize branch name
528- id : normalize
529- # wait: gitversion
530- shell : bash
531- run : |
532- branch="${{ steps.gitversion.outputs.EscapedBranchName }}"
533- branch="${branch%-merge}" # removes suffix only if present
534-
535- if [[ "$branch" == tag* ]]; then
536- # tag builds go into a sub folder
537- branch="${{ steps.gitversion.outputs.BranchName }}"
538- fi
539-
540- echo "branch=$branch" >> "$GITHUB_OUTPUT"
541- - name : Output URL
542- if : ${{ needs.disk-space-check.outputs.available == 'true' }}
543- shell : bash
544- id : url
545- run : |
546- echo "Link: https://builds.jabref.org/${{ steps.normalize.outputs.branch }}/"
547- echo "Link: <https://builds.jabref.org/${{ steps.normalize.outputs.branch }}/>" >> $GITHUB_STEP_SUMMARY
548- echo "url=https://builds.jabref.org/${{ steps.normalize.outputs.branch }}/" >> "$GITHUB_OUTPUT"
549- - name : Create backlink to PR at builds.jabref.org
550- # background: true
551- if : ${{ (github.event_name == 'pull_request') && (needs.disk-space-check.outputs.available == 'true') && (matrix.os == 'ubuntu-22.04') }}
552- run : |
553- echo "Link to PR: ${{ github.event.pull_request.html_url }}" >> _h5ai.header.md
554- 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.normalize.outputs.branch }} && rsync" -e 'ssh -p 9922 -i sshkey -o StrictHostKeyChecking=no' _h5ai.header.md jrrsync@build-upload.jabref.org:/var/www/builds.jabref.org/www/${{ steps.normalize.outputs.branch }}/
555-
556573 # jablib is used by all components - thus, compile it first
557574 - name : jablib jar
558575 id : jablib-jar
559576 # wait: gitversion
560577 # background: true
561578 run : ${{ matrix.gradleCommand }} :jablib:jar
562579 env :
563- VERSION : ${{ steps.gitversion .outputs.AssemblySemVer }}
564- VERSION_INFO : ${{ steps.gitversion .outputs.InformationalVersion }}
580+ VERSION : ${{ needs.pre-build .outputs.AssemblySemVer }}
581+ VERSION_INFO : ${{ needs.pre-build .outputs.InformationalVersion }}
565582
566583 # Save disk space
567584 # Hint by https://dev.to/mathio/squeezing-disk-space-from-github-actions-runners-an-engineers-guide-3pjg
@@ -583,15 +600,15 @@ jobs:
583600 id : jabls-jar
584601 run : ${{ matrix.gradleCommand }} :jabls:jar
585602 env :
586- VERSION : ${{ steps.gitversion .outputs.AssemblySemVer }}
587- VERSION_INFO : ${{ steps.gitversion .outputs.InformationalVersion }}
603+ VERSION : ${{ needs.pre-build .outputs.AssemblySemVer }}
604+ VERSION_INFO : ${{ needs.pre-build .outputs.InformationalVersion }}
588605 - name : jabsrv jar
589606 # background: true
590607 id : jabsrv-jar
591608 run : ${{ matrix.gradleCommand }} :jabsrv:jar
592609 env :
593- VERSION : ${{ steps.gitversion .outputs.AssemblySemVer }}
594- VERSION_INFO : ${{ steps.gitversion .outputs.InformationalVersion }}
610+ VERSION : ${{ needs.pre-build .outputs.AssemblySemVer }}
611+ VERSION_INFO : ${{ needs.pre-build .outputs.InformationalVersion }}
595612
596613 - name : Setup macOS key chain
597614 if : (startsWith(matrix.os, 'macos')) && (needs.conditions.outputs.secretspresent == 'true')
@@ -644,11 +661,11 @@ jobs:
644661 gradleCommand : ${{ matrix.gradleCommand }}
645662 component : jabls-cli
646663 componentShort : jabls
647- branchName : ${{ steps.normalize .outputs.branch }}
648- AssemblySemVer : ${{ steps.gitversion .outputs.AssemblySemVer }}
649- Major : ${{ steps.gitversion .outputs.Major }}
650- Minor : ${{ steps.gitversion .outputs.Minor }}
651- InformationalVersion : ${{ steps.gitversion .outputs.InformationalVersion }}
664+ branchName : ${{ needs.pre-build .outputs.branch }}
665+ AssemblySemVer : ${{ needs.pre-build .outputs.AssemblySemVer }}
666+ Major : ${{ needs.pre-build .outputs.Major }}
667+ Minor : ${{ needs.pre-build .outputs.Minor }}
668+ InformationalVersion : ${{ needs.pre-build .outputs.InformationalVersion }}
652669 diskSpaceAvailable : ${{ needs.disk-space-check.outputs.available }}
653670 os : ${{ matrix.os }}
654671 displayName : ${{ matrix.displayName }}
@@ -657,6 +674,7 @@ jobs:
657674 suffix : ${{ matrix.suffix }}
658675 shouldJbundle : ${{ needs.conditions.outputs.should-jbundle }}
659676 uploadAsArtifact : " ${{ github.event.inputs.upload-as-artifact }}"
677+ subdir : " /tools"
660678 secretsPresent : " ${{ needs.conditions.outputs.secretspresent }}"
661679 astrophysicsDataSystemApiKey : ${{ secrets.AstrophysicsDataSystemAPIKey }}
662680 biodiversityHeritageApiKey : ${{ secrets.BiodiversityHeritageApiKey }}
@@ -669,11 +687,11 @@ jobs:
669687 gradleCommand : ${{ matrix.gradleCommand }}
670688 component : jabsrv-cli
671689 componentShort : jabsrv
672- branchName : ${{ steps.normalize .outputs.branch }}
673- AssemblySemVer : ${{ steps.gitversion .outputs.AssemblySemVer }}
674- Major : ${{ steps.gitversion .outputs.Major }}
675- Minor : ${{ steps.gitversion .outputs.Minor }}
676- InformationalVersion : ${{ steps.gitversion .outputs.InformationalVersion }}
690+ branchName : ${{ needs.pre-build .outputs.branch }}
691+ AssemblySemVer : ${{ needs.pre-build .outputs.AssemblySemVer }}
692+ Major : ${{ needs.pre-build .outputs.Major }}
693+ Minor : ${{ needs.pre-build .outputs.Minor }}
694+ InformationalVersion : ${{ needs.pre-build .outputs.InformationalVersion }}
677695 diskSpaceAvailable : ${{ needs.disk-space-check.outputs.available }}
678696 os : ${{ matrix.os }}
679697 displayName : ${{ matrix.displayName }}
@@ -682,6 +700,7 @@ jobs:
682700 suffix : ${{ matrix.suffix }}
683701 shouldJbundle : ${{ needs.conditions.outputs.should-jbundle }}
684702 uploadAsArtifact : " ${{ github.event.inputs.upload-as-artifact }}"
703+ subdir : " /tools"
685704 secretsPresent : " ${{ needs.conditions.outputs.secretspresent }}"
686705 astrophysicsDataSystemApiKey : ${{ secrets.AstrophysicsDataSystemAPIKey }}
687706 biodiversityHeritageApiKey : ${{ secrets.BiodiversityHeritageApiKey }}
@@ -695,11 +714,11 @@ jobs:
695714 gradleCommand : ${{ matrix.gradleCommand }}
696715 component : jabgui
697716 componentShort : jabgui
698- branchName : ${{ steps.normalize .outputs.branch }}
699- AssemblySemVer : ${{ steps.gitversion .outputs.AssemblySemVer }}
700- Major : ${{ steps.gitversion .outputs.Major }}
701- Minor : ${{ steps.gitversion .outputs.Minor }}
702- InformationalVersion : ${{ steps.gitversion .outputs.InformationalVersion }}
717+ branchName : ${{ needs.pre-build .outputs.branch }}
718+ AssemblySemVer : ${{ needs.pre-build .outputs.AssemblySemVer }}
719+ Major : ${{ needs.pre-build .outputs.Major }}
720+ Minor : ${{ needs.pre-build .outputs.Minor }}
721+ InformationalVersion : ${{ needs.pre-build .outputs.InformationalVersion }}
703722 diskSpaceAvailable : ${{ needs.disk-space-check.outputs.available }}
704723 os : ${{ matrix.os }}
705724 displayName : ${{ matrix.displayName }}
@@ -708,6 +727,7 @@ jobs:
708727 suffix : ${{ matrix.suffix }}
709728 shouldJbundle : ${{ needs.conditions.outputs.should-jbundle }}
710729 uploadAsArtifact : " ${{ github.event.inputs.upload-as-artifact }}"
730+ subdir : " "
711731 secretsPresent : " ${{ needs.conditions.outputs.secretspresent }}"
712732 astrophysicsDataSystemApiKey : ${{ secrets.AstrophysicsDataSystemAPIKey }}
713733 biodiversityHeritageApiKey : ${{ secrets.BiodiversityHeritageApiKey }}
@@ -720,11 +740,11 @@ jobs:
720740 gradleCommand : ${{ matrix.gradleCommand }}
721741 component : jabkit
722742 componentShort : jabkit
723- branchName : ${{ steps.normalize .outputs.branch }}
724- AssemblySemVer : ${{ steps.gitversion .outputs.AssemblySemVer }}
725- Major : ${{ steps.gitversion .outputs.Major }}
726- Minor : ${{ steps.gitversion .outputs.Minor }}
727- InformationalVersion : ${{ steps.gitversion .outputs.InformationalVersion }}
743+ branchName : ${{ needs.pre-build .outputs.branch }}
744+ AssemblySemVer : ${{ needs.pre-build .outputs.AssemblySemVer }}
745+ Major : ${{ needs.pre-build .outputs.Major }}
746+ Minor : ${{ needs.pre-build .outputs.Minor }}
747+ InformationalVersion : ${{ needs.pre-build .outputs.InformationalVersion }}
728748 diskSpaceAvailable : ${{ needs.disk-space-check.outputs.available }}
729749 os : ${{ matrix.os }}
730750 displayName : ${{ matrix.displayName }}
@@ -733,6 +753,7 @@ jobs:
733753 suffix : ${{ matrix.suffix }}
734754 shouldJbundle : ${{ needs.conditions.outputs.should-jbundle }}
735755 uploadAsArtifact : " ${{ github.event.inputs.upload-as-artifact }}"
756+ subdir : " /tools"
736757 secretsPresent : " ${{ needs.conditions.outputs.secretspresent }}"
737758 astrophysicsDataSystemApiKey : ${{ secrets.AstrophysicsDataSystemAPIKey }}
738759 biodiversityHeritageApiKey : ${{ secrets.BiodiversityHeritageApiKey }}
@@ -863,7 +884,7 @@ jobs:
863884 run : |
864885 echo "${{ secrets.buildJabRefPrivateKey }}" > sshkey
865886 chmod 600 sshkey
866- 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' ${{ matrix.path }}/build/packages/${{ matrix.os }}/ jrrsync@build-upload.jabref.org:/var/www/builds.jabref.org/www/${{ needs.build.outputs.branchname }}/
887+ rsync -rt --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r --itemize-changes --stats -e 'ssh -p 9922 -i sshkey -o StrictHostKeyChecking=no' ${{ matrix.path }}/build/packages/${{ matrix.os }}/ jrrsync@build-upload.jabref.org:/var/www/builds.jabref.org/www/${{ needs.build.outputs.branchname }}/
867888 - name : Upload artifacts
868889 if : ${{ github.event.inputs.upload-as-artifact || 'false' == 'true' }}
869890 uses : actions/upload-artifact@v7
0 commit comments