Skip to content

Add GitHub Actions CI/CD for Multi-Platform Native Library Builds - #44

Merged
bnorthan merged 3 commits into
clij:masterfrom
NicoKiaru:master
Dec 2, 2025
Merged

Add GitHub Actions CI/CD for Multi-Platform Native Library Builds#44
bnorthan merged 3 commits into
clij:masterfrom
NicoKiaru:master

Conversation

@NicoKiaru

Copy link
Copy Markdown
Contributor

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:
    • win64windows-x86_64
    • linux64linux-x86_64
    • macosxmacosx-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.

## 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.
@NicoKiaru NicoKiaru changed the title # Add GitHub Actions CI/CD for Multi-Platform Native Library Builds Add GitHub Actions CI/CD for Multi-Platform Native Library Builds Dec 2, 2025
@NicoKiaru
NicoKiaru requested a review from Copilot December 2, 2025 10:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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., win64windows-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.

Comment thread .github/workflows/build-and-deploy.yml
Comment thread native/clij2fft/cppbuild.sh
Comment thread README.md Outdated
NicoKiaru and others added 2 commits December 2, 2025 11:41
Fix badge

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@bnorthan
bnorthan merged commit d293f40 into clij:master Dec 2, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants