@@ -67,69 +67,119 @@ jobs:
6767 run : |
6868 if [[ "$GITHUB_WORKFLOW" == *"early access"* && "$REPO_OWNER" != "JabRef" ]]; then
6969 echo "🚫 Early access workflow for JabRef disabled for non-JabRef owner"
70+ echo "🚫 Early access workflow for JabRef disabled for non-JabRef owner" >> $GITHUB_STEP_SUMMARY
7071 echo "should-build=false" >> "$GITHUB_OUTPUT"
7172 exit 0
7273 fi
7374
7475 if [[ "$EVENT_NAME" != "labeled" || "$LABEL_NAME" == "automerge" || "$LABEL_NAME" == "dev: binaries" ]]; then
7576 echo "📦 build enabled"
77+ echo "📦 build enabled" >> $GITHUB_STEP_SUMMARY
7678 echo "should-build=true" >> "$GITHUB_OUTPUT"
7779 else
7880 echo "🚫 build should be skipped"
81+ echo "🚫 build should be skipped" >> $GITHUB_STEP_SUMMARY
7982 echo "should-build=false" >> "$GITHUB_OUTPUT"
8083 exit 0
8184 fi
8285
8386 if [ -z "$BUILDJABREFPRIVATEKEY" ]; then
87+ echo "🚫 Secret BUILDJABREFPRIVATEKEY not present – skipping upload"
88+ echo "🚫 Secret BUILDJABREFPRIVATEKEY not present – skipping upload"
8489 echo "upload-to-builds-jabref-org=false" >> "$GITHUB_OUTPUT"
8590 echo "secretspresent=false" >> "$GITHUB_OUTPUT"
86- echo "🚫 Secret BUILDJABREFPRIVATEKEY not present – skipping upload"
8791 exit 0
8892 fi
8993 echo "secretspresent=true" >> "$GITHUB_OUTPUT"
9094
9195 if [[ "$GITHUB_REF" == refs/heads/gh-readonly-queue* ]]; then
92- echo "upload-to-builds-jabref-org=false" >> "$GITHUB_OUTPUT"
9396 echo "🚫 merge queue – skipping upload"
97+ echo "🚫 merge queue – skipping upload" >> $GITHUB_STEP_SUMMARY
98+ echo "upload-to-builds-jabref-org=false" >> "$GITHUB_OUTPUT"
9499 exit 0
95100 fi
96101
97102 if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
103+ echo "tag bulid" >> $GITHUB_STEP_SUMMARY
98104 echo "tagbuild=true" >> "$GITHUB_OUTPUT"
99105 else
106+ echo "no tag bulid" >> $GITHUB_STEP_SUMMARY
100107 echo "tagbuild=false" >> "$GITHUB_OUTPUT"
101108 fi
102109
103110 if [[ "${GITHUB_REF}" == refs/tags/* ]] || [[ "${{ inputs.notarization }}" == "true" ]]; then
104111 # This workflow runs on ubuntu-latest even for notarization for macOS; need to check later if really on macOS
105112 echo "🧾 macOS notarization"
113+ echo "🧾 macOS notarization" >> $GITHUB_STEP_SUMMARY
106114 echo "should-notarize=true" >> "$GITHUB_OUTPUT"
107115 echo "☁️ will upload"
116+ echo "☁️ will upload" >> $GITHUB_STEP_SUMMARY
108117 echo "upload-to-builds-jabref-org=true" >> "$GITHUB_OUTPUT"
109118 exit 0;
110119 else
111120 echo "🚫 no macOS notarization"
121+ echo "🚫 no macOS notarization" >> $GITHUB_STEP_SUMMARY
112122 echo "should-notarize=false" >> "$GITHUB_OUTPUT"
113123 fi
114124
115125 if [ "${{ github.event_name }}" != "pull_request" ]; then
116- echo "upload-to-builds-jabref-org=true" >> "$GITHUB_OUTPUT"
117126 echo "☁️ Non-PR event – will upload"
127+ echo "☁️ Non-PR event – will upload" >> $GITHUB_STEP_SUMMARY
128+ echo "upload-to-builds-jabref-org=true" >> "$GITHUB_OUTPUT"
118129 exit 0
119130 fi
120131
121132 LABELS=$(gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels --jq '.[].name')
122133
123134 if echo "$LABELS" | grep -q "^dev: binaries$"; then
124- echo "upload-to-builds-jabref-org=true" >> "$GITHUB_OUTPUT"
125135 echo "☁️ Label 'dev: binaries' found – will upload"
136+ echo "☁️ Label 'dev: binaries' found – will upload" >> $GITHUB_STEP_SUMMARY
137+ echo "upload-to-builds-jabref-org=true" >> "$GITHUB_OUTPUT"
126138 else
127- echo "upload-to-builds-jabref-org=false" >> "$GITHUB_OUTPUT"
128139 echo "🚫 Label 'dev: binaries' not found – skipping upload"
140+ echo "🚫 Label 'dev: binaries' not found – skipping upload" >> $GITHUB_STEP_SUMMARY
141+ echo "upload-to-builds-jabref-org=false" >> "$GITHUB_OUTPUT"
142+ fi
143+
144+ disk-space-check :
145+ needs : conditions
146+ runs-on : ubuntu-latest
147+ outputs :
148+ available : ${{ steps.diskspace.outputs.available }}
149+ steps :
150+ - name : No upload
151+ if : needs.conditions.outputs.upload-to-builds-jabref-org == 'false'
152+ shell : bash
153+ run : |
154+ echo "🚫 no upload – skipping upload"
155+ echo "🚫 no upload – skipping upload" >> $GITHUB_STEP_SUMMARY
156+ echo "available=false" >> "$GITHUB_OUTPUT"
157+ - name : Setup SSH key
158+ if : needs.conditions.outputs.upload-to-builds-jabref-org == 'true'
159+ run : |
160+ echo "${{ secrets.buildJabRefPrivateKey }}" > sshkey
161+ chmod 600 sshkey
162+ - name : Check disk space on builds.jabref.org
163+ if : needs.conditions.outputs.upload-to-builds-jabref-org == 'true'
164+ shell : bash
165+ run : |
166+ USAGE=$(ssh -p 9922 -i sshkey -o StrictHostKeyChecking=no [email protected] \ 167+ "df --output=pcent /var/www/builds.jabref.org | tail -n1 | tr -dc '0-9'")
168+ echo "Remote usage: ${USAGE}%"
169+ echo "Remote usage: ${USAGE}%" >> $GITHUB_STEP_SUMMARY
170+
171+ if [ "$USAGE" -lt 80 ]; then
172+ echo "☁️ enough disk space available – will upload"
173+ echo "☁️ enough disk space available – will upload" >> $GITHUB_STEP_SUMMARY
174+ echo "available=true" >> "$GITHUB_OUTPUT"
175+ else
176+ echo "🚫 not enough disk space – skipping upload"
177+ echo "🚫 not enough disk space – skipping upload" >> $GITHUB_STEP_SUMMARY
178+ echo "available=false" >> "$GITHUB_OUTPUT"
129179 fi
130180
131181 build :
132- needs : [conditions]
182+ needs : [conditions, disk-space-check ]
133183 if : ${{ needs.conditions.outputs.should-build == 'true' }}
134184 strategy :
135185 fail-fast : false
@@ -281,62 +331,49 @@ jobs:
281331
282332 # region Upload to builds.jabref.org / GitHub artifacts store
283333 - name : Setup SSH key
284- if : ( needs.conditions.outputs.upload-to-builds-jabref-org == 'true')
334+ if : ${{ needs.disk-space-check.available == 'true' }}
285335 run : |
286336 echo "${{ secrets.buildJabRefPrivateKey }}" > sshkey
287337 chmod 600 sshkey
288- - name : Check disk space on builds.jabref.org
289- if : (needs.conditions.outputs.upload-to-builds-jabref-org == 'true')
290- id : diskspace
291- shell : bash
292- run : |
293- USAGE=$(ssh -p 9922 -i sshkey -o StrictHostKeyChecking=no [email protected] \ 294- "df --output=pcent /var/www/builds.jabref.org | tail -n1 | tr -dc '0-9'")
295- echo "Remote usage: $USAGE%"
296- if [ "$USAGE" -lt 90 ]; then
297- echo "available=true" >> "$GITHUB_OUTPUT"
298- else
299- echo "available=false" >> "$GITHUB_OUTPUT"
300- fi
301338 - name : Setup rsync (macOS)
302- if : ${{ (steps.diskspace.outputs .available == 'true') && (startsWith(matrix.os, 'macos') && (needs.conditions.outputs.upload-to-builds-jabref-org == 'true')) }}
339+ if : ${{ (needs.disk-space-check .available == 'true') && (startsWith(matrix.os, 'macos') && (needs.conditions.outputs.upload-to-builds-jabref-org == 'true')) }}
303340 run : brew install rsync
304341 - name : Setup rsync (Windows)
305- if : ${{ (steps.diskspace.outputs .available == 'true') && (matrix.os == 'windows-latest') }}
342+ if : ${{ (needs.disk-space-check .available == 'true') && (matrix.os == 'windows-latest') }}
306343 # We want to have rsync available at this place to avoid uploading and downloading from GitHub artifact store (taking > 5 minutes in total)
307344 # We cannot use "action-rsyncer", because that requires Docker which is unavailable on Windows
308345 # We cannot use "setup-rsync", because that does not work on Windows
309346 # We do not use egor-tensin/setup-cygwin@v4, because it replaces the default shell
310347 # We need to use v6.4.4 as v6.4.5 misses "lib\rsync\tools\bin\ssh.exe"
311348 run : choco install rsync --version=6.4.4
312349 - name : Upload jabgui to builds.jabref.org (Windows)
313- if : ${{ (steps.diskspace.outputs .available == 'true') && (matrix.os == 'windows-latest') }}
350+ if : ${{ (needs.disk-space-check .available == 'true') && (matrix.os == 'windows-latest') }}
314351 shell : cmd
315352 # for rsync installed by chocolatey, we need the ssh.exe delivered with that installation
316353 run : |
317354 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' jabgui/build/packages/${{ matrix.os }}/ [email protected] :/var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }}/ || true 318355 - name : Upload jabkkit to builds.jabref.org (Windows)
319- if : ${{ (steps.diskspace.outputs .available == 'true') && (matrix.os == 'windows-latest') }}
356+ if : ${{ (needs.disk-space-check .available == 'true') && (matrix.os == 'windows-latest') }}
320357 shell : cmd
321358 run : |
322359 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' jabkit/build/packages/${{ matrix.os }}/ [email protected] :/var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }}/ || true 323360 - name : Upload jabls-cli to builds.jabref.org (Windows)
324- if : ${{ (steps.diskspace.outputs .available == 'true') && (matrix.os == 'windows-latest') }}
361+ if : ${{ (needs.disk-space-check .available == 'true') && (matrix.os == 'windows-latest') }}
325362 shell : cmd
326363 run : |
327364 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' jabls-cli/build/packages/${{ matrix.os }}/ [email protected] :/var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }}/ || true 328365 - name : Upload jabgui to builds.jabref.org (linux, macOS)
329- if : ${{ (steps.diskspace.outputs .available == 'true') && ((startsWith(matrix.os, 'macos') && (needs.conditions.outputs.should-notarize != 'true')) || startsWith(matrix.os, 'ubuntu')) }}
366+ if : ${{ (needs.disk-space-check .available == 'true') && ((startsWith(matrix.os, 'macos') && (needs.conditions.outputs.should-notarize != 'true')) || startsWith(matrix.os, 'ubuntu')) }}
330367 shell : bash
331368 run : |
332369 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' jabgui/build/packages/${{ matrix.os }}/ [email protected] :/var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }}/ || true 333370 - name : Upload jabkit to builds.jabref.org (linux, macOS)
334- if : ${{ (steps.diskspace.outputs .available == 'true') && (startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')) }}
371+ if : ${{ (needs.disk-space-check .available == 'true') && (startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')) }}
335372 shell : bash
336373 run : |
337374 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' jabkit/build/packages/${{ matrix.os }}/ [email protected] :/var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }}/ || true 338375 - name : Upload jabls-cli to builds.jabref.org (linux, macOS)
339- if : ${{ (steps.diskspace.outputs .available == 'true') && (startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')) }}
376+ if : ${{ (needs.disk-space-check .available == 'true') && (startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')) }}
340377 shell : bash
341378 run : |
342379 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' jabls-cli/build/packages/${{ matrix.os }}/ [email protected] :/var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }}/ || true
0 commit comments