macos-15-intel should run on main only#15161
Conversation
Review Summary by QodoConditionally skip macOS Intel builds on non-main branches
WalkthroughsDescription• Extract build matrix to separate job for conditional platform filtering • Skip macOS Intel builds on non-main branches to reduce CI costs • Dynamically filter matrix using jq based on Git branch reference • Refactor static matrix definition into computed JSON output File Changes1. .github/workflows/binaries.yml
|
Code Review by Qodo
1. Invalid matrix syntax
|
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| # if you change the os version rename all other occurrences | ||
| - os: ubuntu-22.04 # if this is adapted, also the next lines need to be adapted | ||
| displayName: linux-amd64 | ||
| gradleCommand: 'gradle' | ||
| archivePortable: tar -c -C jabgui/build/packages/ubuntu-22.04 JabRef | pigz --rsyncable > jabgui/build/packages/ubuntu-22.04/JabRef-portable_linux.tar.gz && rm -R jabgui/build/packages/ubuntu-22.04/JabRef | ||
| archivePortableJabKit: tar -c -C jabkit/build/packages/ubuntu-22.04 jabkit | pigz --rsyncable > jabkit/build/packages/ubuntu-22.04/jabkit-portable_linux.tar.gz && rm -R jabkit/build/packages/ubuntu-22.04/jabkit | ||
| archivePortableJabLS: tar -c -C jabls-cli/build/packages/ubuntu-22.04 jabls | pigz --rsyncable > jabls-cli/build/packages/ubuntu-22.04/jabls-portable_linux.tar.gz && rm -R jabls-cli/build/packages/ubuntu-22.04/jabls | ||
| suffix: '' | ||
| archForDebianRepack: '_amd64' | ||
| - os: ubuntu-22.04-arm # if this is adapted, also the next lines need to be adapted | ||
| displayName: linux-arm | ||
| gradleCommand: 'gradle' | ||
| archivePortable: tar -c -C jabgui/build/packages/ubuntu-22.04-arm JabRef | pigz --rsyncable > jabgui/build/packages/ubuntu-22.04-arm/JabRef-portable_linux_arm64.tar.gz && rm -R jabgui/build/packages/ubuntu-22.04-arm/JabRef | ||
| archivePortableJabKit: tar -c -C jabkit/build/packages/ubuntu-22.04-arm jabkit | pigz --rsyncable > jabkit/build/packages/ubuntu-22.04-arm/jabkit-portable_linux_arm64.tar.gz && rm -R jabkit/build/packages/ubuntu-22.04-arm/jabkit | ||
| archivePortableJabLS: tar -c -C jabls-cli/build/packages/ubuntu-22.04-arm jabls | pigz --rsyncable > jabls-cli/build/packages/ubuntu-22.04-arm/jabls-portable_linux_arm64.tar.gz && rm -R jabls-cli/build/packages/ubuntu-22.04-arm/jabls | ||
| suffix: '_arm64' | ||
| archForDebianRepack: '_arm64' | ||
| - os: windows-latest | ||
| displayName: windows-amd64 | ||
| gradleCommand: './gradlew' # because of https://github.com/gradle/gradle/pull/34227 | ||
| archivePortable: 7z a -r jabgui/build/packages/windows-latest/JabRef-portable_windows.zip ./jabgui/build/packages/windows-latest/JabRef && rm -R jabgui/build/packages/windows-latest/JabRef | ||
| archivePortableJabKit: 7z a -r jabkit/build/packages/windows-latest/jabkit-portable_windows.zip ./jabkit/build/packages/windows-latest/jabkit && rm -R jabkit/build/packages/windows-latest/jabkit | ||
| archivePortableJabLS: 7z a -r jabls-cli/build/packages/windows-latest/jabls-portable_windows.zip ./jabls-cli/build/packages/windows-latest/jabls && rm -R jabls-cli/build/packages/windows-latest/jabls | ||
| suffix: '' | ||
| archForDebianRepack: '' | ||
| - os: macos-15-intel | ||
| displayName: macOS-intel | ||
| gradleCommand: 'gradle' | ||
| archivePortable: 7z a -r jabgui/build/packages/macos-15-intel/JabRef-portable_macos-intel.zip ./jabgui/build/packages/macos-15-intel/JabRef.app && rm -R jabgui/build/packages/macos-15-intel/JabRef.app | ||
| archivePortableJabKit: 7z a -r jabkit/build/packages/macos-15-intel/jabkit-portable_macos-intel.zip ./jabkit/build/packages/macos-15-intel/jabkit.app && rm -R jabkit/build/packages/macos-15-intel/jabkit.app | ||
| archivePortableJabLS: 7z a -r jabls-cli/build/packages/macos-15-intel/jabls-portable_macos-intel.zip ./jabls-cli/build/packages/macos-15-intel/jabls.app && rm -R jabls-cli/build/packages/macos-15-intel/jabls.app | ||
| suffix: '_intel' | ||
| archForDebianRepack: '' | ||
| - os: macos-15 | ||
| displayName: macOS-silicon | ||
| gradleCommand: 'gradle' | ||
| archivePortable: 7z a -r jabgui/build/packages/macos-15/JabRef-portable_macos-silicon.zip ./jabgui/build/packages/macos-15/JabRef.app && rm -R jabgui/build/packages/macos-15/JabRef.app | ||
| archivePortableJabKit: 7z a -r jabkit/build/packages/macos-15/jabkit-portable_macos-silicon.zip ./jabkit/build/packages/macos-15/jabkit.app && rm -R jabkit/build/packages/macos-15/jabkit.app | ||
| archivePortableJabLS: 7z a -r jabls-cli/build/packages/macos-15/jabls-portable_macos-silicon.zip ./jabls-cli/build/packages/macos-15/jabls.app && rm -R jabls-cli/build/packages/macos-15/jabls.app | ||
| suffix: '_silicon' | ||
| archForDebianRepack: '' | ||
| ${{ fromJSON(needs.compute-matrix.outputs.matrix) }} |
There was a problem hiding this comment.
1. Invalid matrix syntax 🐞 Bug ✓ Correctness
strategy.matrix is defined as a YAML mapping whose key is the expression, instead of assigning the expression result to matrix. This will cause GitHub Actions to fail to evaluate the matrix and the build job won’t start.
Agent Prompt
### Issue description
The `build` job’s dynamic matrix is currently expressed as a YAML mapping key, which prevents GitHub Actions from parsing/evaluating the matrix.
### Issue Context
You introduced a `compute-matrix` job that outputs JSON, and `build` should consume it via `fromJSON(...)`. GitHub Actions expects `strategy.matrix` to be assigned to the expression result.
### Fix Focus Areas
- .github/workflows/binaries.yml[420-424]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| compute-matrix: | ||
| runs-on: ubuntu-slim | ||
| outputs: | ||
| matrix: ${{ steps.set.outputs.matrix }} | ||
| steps: | ||
| - id: set | ||
| shell: bash | ||
| run: | | ||
| # if you change the os version rename all other occurrences | ||
| # ./gradlew on Windows is because of https://github.com/gradle/gradle/pull/34227 | ||
| MATRIX_JSON='{ | ||
| "include": [ | ||
| { | ||
| "os": "ubuntu-22.04", | ||
| "displayName": "linux-amd64", | ||
| "gradleCommand": "gradle", | ||
| "archivePortable": "tar -c -C jabgui/build/packages/ubuntu-22.04 JabRef | pigz --rsyncable > jabgui/build/packages/ubuntu-22.04/JabRef-portable_linux.tar.gz && rm -R jabgui/build/packages/ubuntu-22.04/JabRef", | ||
| "archivePortableJabKit": "tar -c -C jabkit/build/packages/ubuntu-22.04 jabkit | pigz --rsyncable > jabkit/build/packages/ubuntu-22.04/jabkit-portable_linux.tar.gz && rm -R jabkit/build/packages/ubuntu-22.04/jabkit", | ||
| "archivePortableJabLS": "tar -c -C jabls-cli/build/packages/ubuntu-22.04 jabls | pigz --rsyncable > jabls-cli/build/packages/ubuntu-22.04/jabls-portable_linux.tar.gz && rm -R jabls-cli/build/packages/ubuntu-22.04/jabls", | ||
| "suffix": "", | ||
| "archForDebianRepack": "_amd64" | ||
| }, | ||
| { | ||
| "os": "ubuntu-22.04-arm", | ||
| "displayName": "linux-arm", | ||
| "gradleCommand": "gradle", | ||
| "archivePortable": "tar -c -C jabgui/build/packages/ubuntu-22.04-arm JabRef | pigz --rsyncable > jabgui/build/packages/ubuntu-22.04-arm/JabRef-portable_linux_arm64.tar.gz && rm -R jabgui/build/packages/ubuntu-22.04-arm/JabRef", | ||
| "archivePortableJabKit": "tar -c -C jabkit/build/packages/ubuntu-22.04-arm jabkit | pigz --rsyncable > jabkit/build/packages/ubuntu-22.04-arm/jabkit-portable_linux_arm64.tar.gz && rm -R jabkit/build/packages/ubuntu-22.04-arm/jabkit", | ||
| "archivePortableJabLS": "tar -c -C jabls-cli/build/packages/ubuntu-22.04-arm jabls | pigz --rsyncable > jabls-cli/build/packages/ubuntu-22.04-arm/jabls-portable_linux_arm64.tar.gz && rm -R jabls-cli/build/packages/ubuntu-22.04-arm/jabls", | ||
| "suffix": "_arm64", | ||
| "archForDebianRepack": "_arm64" | ||
| }, | ||
| { | ||
| "os": "windows-latest", | ||
| "displayName": "windows-amd64", | ||
| "gradleCommand": "./gradlew", | ||
| "archivePortable": "7z a -r jabgui/build/packages/windows-latest/JabRef-portable_windows.zip ./jabgui/build/packages/windows-latest/JabRef && rm -R jabgui/build/packages/windows-latest/JabRef", | ||
| "archivePortableJabKit": "7z a -r jabkit/build/packages/windows-latest/jabkit-portable_windows.zip ./jabkit/build/packages/windows-latest/jabkit && rm -R jabkit/build/packages/windows-latest/jabkit", | ||
| "archivePortableJabLS": "7z a -r jabls-cli/build/packages/windows-latest/jabls-portable_windows.zip ./jabls-cli/build/packages/windows-latest/jabls && rm -R jabls-cli/build/packages/windows-latest/jabls", | ||
| "suffix": "", | ||
| "archForDebianRepack": "" | ||
| }, | ||
| { | ||
| "os": "macos-15-intel", | ||
| "displayName": "macOS-intel", | ||
| "gradleCommand": "gradle", | ||
| "archivePortable": "7z a -r jabgui/build/packages/macos-15-intel/JabRef-portable_macos-intel.zip ./jabgui/build/packages/macos-15-intel/JabRef.app && rm -R jabgui/build/packages/macos-15-intel/JabRef.app", | ||
| "archivePortableJabKit": "7z a -r jabkit/build/packages/macos-15-intel/jabkit-portable_macos-intel.zip ./jabkit/build/packages/macos-15-intel/jabkit.app && rm -R jabkit/build/packages/macos-15-intel/jabkit.app", | ||
| "archivePortableJabLS": "7z a -r jabls-cli/build/packages/macos-15-intel/jabls-portable_macos-intel.zip ./jabls-cli/build/packages/macos-15-intel/jabls.app && rm -R jabls-cli/build/packages/macos-15-intel/jabls.app", | ||
| "suffix": "_intel", | ||
| "archForDebianRepack": "" | ||
| }, | ||
| { | ||
| "os": "macos-15", | ||
| "displayName": "macOS-silicon", | ||
| "gradleCommand": "gradle", | ||
| "archivePortable": "7z a -r jabgui/build/packages/macos-15/JabRef-portable_macos-silicon.zip ./jabgui/build/packages/macos-15/JabRef.app && rm -R jabgui/build/packages/macos-15/JabRef.app", | ||
| "archivePortableJabKit": "7z a -r jabkit/build/packages/macos-15/jabkit-portable_macos-silicon.zip ./jabkit/build/packages/macos-15/jabkit.app && rm -R jabkit/build/packages/macos-15/jabkit.app", | ||
| "archivePortableJabLS": "7z a -r jabls-cli/build/packages/macos-15/jabls-portable_macos-silicon.zip ./jabls-cli/build/packages/macos-15/jabls.app && rm -R jabls-cli/build/packages/macos-15/jabls.app", | ||
| "suffix": "_silicon", | ||
| "archForDebianRepack": "" | ||
| } | ||
| ] | ||
| }' | ||
|
|
||
| if [[ "$GITHUB_REF" != "refs/heads/main" ]]; then | ||
| # drop macos-15-intel on non-main | ||
| MATRIX_JSON="$(jq -c ' .include |= map(select(.os != "macos-15-intel")) ' <<<"$MATRIX_JSON")" | ||
| else | ||
| MATRIX_JSON="$(jq -c . <<<"$MATRIX_JSON")" | ||
| fi |
There was a problem hiding this comment.
2. Jq not installed 🐞 Bug ⛯ Reliability
compute-matrix runs jq but does not install it, even though other ubuntu-slim jobs explicitly install jq. If jq is absent on the runner image, compute-matrix will fail and block all builds.
Agent Prompt
### Issue description
`compute-matrix` uses `jq` but does not ensure it is installed, which can cause `compute-matrix` to fail at runtime with `jq: command not found`.
### Issue Context
The `conditions` job installs `jq` on `ubuntu-slim`, suggesting the environment is minimal. `compute-matrix` should follow the same pattern to be reliable.
### Fix Focus Areas
- .github/workflows/binaries.yml[343-416]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| if [[ "$GITHUB_REF" != "refs/heads/main" ]]; then | ||
| # drop macos-15-intel on non-main | ||
| MATRIX_JSON="$(jq -c ' .include |= map(select(.os != "macos-15-intel")) ' <<<"$MATRIX_JSON")" |
There was a problem hiding this comment.
3. Tag notarize mismatch 🐞 Bug ✓ Correctness
On tag builds, notarization is always enabled and the notarize job always includes macos-15-intel, but compute-matrix removes macos-15-intel for all non-main refs (including tags). This will make tag builds fail when notarization tries to download missing Intel artifacts.
Agent Prompt
### Issue description
Tag builds enable notarization, but `compute-matrix` removes the Intel macOS build for tags, causing the notarization job to request/download Intel artifacts that were never created.
### Issue Context
- `conditions` sets `should-notarize=true` for `refs/tags/*`.
- `notarize` always includes `macos-15-intel` and downloads `JabRef-${{ matrix.os }}-tbn`.
- `compute-matrix` currently drops `macos-15-intel` for any non-`refs/heads/main` ref, including tags.
### Fix Focus Areas
- .github/workflows/binaries.yml[343-416]
- .github/workflows/binaries.yml[229-244]
- .github/workflows/binaries.yml[790-826]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
* upstream/main: (26 commits) Fix matrix Feature visual timer 15122 (JabRef#15151) Chore(deps): Bump com.googlecode.plist:dd-plist from 1.28 to 1.29 in /versions (JabRef#15166) Chore(deps): Bump jablib/src/main/resources/csl-styles from `a0eb8d7` to `e306b56` (JabRef#15162) Chore(deps): Bump io.zonky.test.postgres:embedded-postgres-binaries-bom (JabRef#15165) Chore(deps): Bump jablib/src/main/resources/csl-locales (JabRef#15163) Chore(deps): Bump jablib/src/main/abbrv.jabref.org (JabRef#15164) Change Dependabot schedule from weekly to daily macos-15-intel should run on main only (JabRef#15161) Chore(deps): Bump jablib/src/main/resources/csl-styles (JabRef#15152) Chore(deps): Bump org.jetbrains:annotations in /versions (JabRef#15154) Chore(deps): Bump jablib/src/main/abbrv.jabref.org (JabRef#15153) Chore(deps): Bump org.itsallcode.openfasttrace from 3.1.0 to 3.1.1 (JabRef#15141) Chore(deps): Bump org.junit:junit-bom from 6.0.2 to 6.0.3 in /versions (JabRef#15148) Chore(deps): Bump org.eclipse.lsp4j:org.eclipse.lsp4j from 0.24.0 to 1.0.0 in /versions (JabRef#15149) Chore(deps): Bump org.postgresql:postgresql in /versions (JabRef#15146) Chore(deps): Bump net.bytebuddy:byte-buddy in /versions (JabRef#15147) Refine code (JabRef#15132) Chore(deps): Bump com.dlsc.gemsfx:gemsfx in /versions (JabRef#15143) Update dependency de.undercouch:citeproc-java to v3.5.0 (JabRef#15145) ...
Build on (old) macOS intel only on main. The risk that something is wrong on Intel macOS is very low. We accept it.
Removed macOS intel from required checks.
Checklist
CHANGELOG.mdin a way that can be understood by the average user (if change is visible to the user)