Add GitHub Actions CI/CD for Multi-Platform Native Library Builds - #44
Merged
Conversation
## Overview
This PR changes the build infrastructure by adding automated GitHub Actions workflows to build native libraries (clFFT and clij2-fft) across all supported platforms. The JAR now includes natives for all platforms, eliminating the need for manual native builds.
## Key Changes
### GitHub Actions CI/CD Pipeline
- **New workflow**: `.github/workflows/build-and-deploy.yml`
- **Matrix builds** for 4 platforms:
- Linux x86_64 (ubuntu-latest)
- Windows x86_64 (windows-latest)
- macOS x86_64 (macos-13)
- macOS ARM64 (macos-14)
- **Smart trigger system**: Natives rebuild only when commit contains `[build natives]` or on manual dispatch
- **Automatic commit-back**: Native libraries automatically committed to repository with `[skip ci]` to prevent infinite loops
### Platform-Specific Build Setup
**Linux GH build:**
- Builds clFFT from source (no package manager support)
- Dependencies: `build-essential`, `cmake`, `ocl-icd-opencl-dev`, `opencl-headers`
- CMake version patched from 2.8 → 3.5 for compatibility
**macOS (Intel & ARM64) GH build:**
- Builds clFFT from source (removed from Homebrew)
- Uses built-in OpenCL framework
- Platform-specific install paths: `/usr/local` (Intel), `/opt/homebrew` (ARM)
- Dynamic library paths fixed with `install_name_tool`
**Windows GH build:**
- Uses pre-built clFFT binaries (v2.12.2)
- Downloads OpenCL SDK components
- MSVC environment setup via `ilammy/msvc-dev-cmd` action
### Maven Build Improvements
- **Updated parent POM**: `pom-scijava` 37.0.0 → 43.0.0
- **New platform profiles**: Updated folder naming to match JavaCPP conventions:
- `win64` → `windows-x86_64`
- `linux64` → `linux-x86_64`
- `macosx` → `macosx-x86_64`
- `macosx-arm64` (unchanged)
- **Maven resources plugin**: Automatically copies all platform natives into JAR during packaging
- Local builds with `mvn clean package -Dgpg.skip=true -Djavacpp.skip=true` now produce multi-platform JARs
- **Dependency versions**: Moved to properties for easier maintenance
- **CI management**: Specified as GitHub Actions
### Repository Structure Changes
- Native libraries now committed to repository at `lib/{platform}/`
- Updated `.github/workflows/` with new build pipeline
### Documentation Updates
- README updated with relative paths
- Documented new CI-based native build process
- Removed references to manual Fiji native builds (natives now bundled in JAR)
- Added mention of `clijx-deconvolution` update site in main README
## Testing
- All 4 platform builds succeed
- Natives correctly packaged in JAR at expected paths
- JAR loads and runs (tested on windows only)
- Commit-back mechanism works without infinite loops
## Breaking Changes
None - this is purely additive infrastructure. Existing local build workflows remain compatible.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR modernizes the build infrastructure by introducing a GitHub Actions CI/CD pipeline that automatically builds native libraries (clFFT and clij2-fft) for all supported platforms. The key improvement is that the JAR now bundles natives for all platforms, eliminating manual build requirements for most users.
Key Changes:
- Automated multi-platform native builds via GitHub Actions with smart triggers (
[build natives]commit message or manual dispatch) - Updated Maven configuration with corrected platform naming conventions (e.g.,
win64→windows-x86_64) and resource plugin to package all natives in JAR - Comprehensive documentation updates with relative paths and updated build instructions reflecting the new CI-based workflow
Reviewed changes
Copilot reviewed 9 out of 44 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/build-and-deploy.yml |
New CI/CD workflow for matrix builds across 4 platforms with automatic commit-back |
pom.xml |
Updated parent POM to 43.0.0, fixed platform profile naming, added maven-resources-plugin for multi-platform JAR packaging |
native/clij2fft/cppbuild.sh |
Updated folder paths to match new naming conventions (linux64→linux-x86_64, win64→windows-x86_64, macosx→macosx-x86_64) |
native/clij2fft/CMakeLists.txt |
Removed trailing whitespace from Python command |
mvn_with_options.sh |
Fixed typo in comment |
lib/windows-x86_64/* |
New Windows native binaries (DLLs and libs) for x86_64 |
docs/buildlibs/build.md |
Restructured to prioritize GitHub Actions workflow over local builds |
README.md |
Updated with relative paths and references to new CI infrastructure |
docs/python/clij-fft-python.md |
Converted absolute URLs to relative paths |
docs/fiji/test_installation.md |
Removed manual native lib verification section (now bundled in JAR) |
docs/deconvolution/RichardsonLucy.md |
Fixed duplicate regularization link |
docs/releaselog.md |
Added release note for version 2.2.0.19 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fix badge Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR changes the build infrastructure by adding automated GitHub Actions workflows to build native libraries (clFFT and clij2-fft) across all supported platforms. The JAR now includes natives for all platforms, eliminating the need for manual native builds.
Key Changes
GitHub Actions CI/CD Pipeline
.github/workflows/build-and-deploy.yml[build natives]or on manual dispatch[skip ci]to prevent infinite loopsPlatform-Specific Build Setup
Linux GH build:
build-essential,cmake,ocl-icd-opencl-dev,opencl-headersmacOS (Intel & ARM64) GH build:
/usr/local(Intel),/opt/homebrew(ARM)install_name_toolWindows GH build:
ilammy/msvc-dev-cmdactionMaven Build Improvements
pom-scijava37.0.0 → 43.0.0win64→windows-x86_64linux64→linux-x86_64macosx→macosx-x86_64macosx-arm64(unchanged)mvn clean package -Dgpg.skip=true -Djavacpp.skip=truenow produce multi-platform JARsRepository Structure Changes
lib/{platform}/.github/workflows/with new build pipelineDocumentation Updates
clijx-deconvolutionupdate site in main READMETesting
Breaking Changes
None - this is purely additive infrastructure. Existing local build workflows remain compatible.