Skip to content

Commit bf1e37c

Browse files
build(conda): publish the SDK for win-64 and osx-64 (#129)
Extend the conda-release matrix to ubuntu-22.04 + macos-13 (osx-64) + windows-2022 (win-64). The plugins' win-64 solve can't resolve plotjuggler_sdk until it exists on prefix.dev for win-64; all SDK host deps (nlohmann_json/fmt/fast_float) are on win-64, so only the package build was missing. - recipe.yaml: split the build script into if:unix / if:win branches (Windows installs under %LIBRARY_PREFIX% and needs an explicit Release config); replace the bash 'test -f' checks with a cross-platform package_contents test (Jinja lib vs Library/lib path); keep the deeper example-consumer build unix-only for now (MSVC plugin-lib validation is a follow-up). - conda-release.yml: add a pull_request trigger that builds all three platforms WITHOUT uploading, so the win-64/osx-64 legs are validated before a release tag; upload step gated to tag/dispatch only; relative --output-dir for Git Bash on Windows. Validated: linux build + tests pass locally; win-64/osx-64 build on CI.
1 parent 1290a18 commit bf1e37c

2 files changed

Lines changed: 46 additions & 24 deletions

File tree

.github/workflows/conda-release.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ on:
77
push:
88
tags:
99
- "v*"
10+
# Build-only on PRs that touch the recipe/workflow, so the win-64/osx-64 legs
11+
# are validated before a release tag (the upload step is skipped — see below).
12+
pull_request:
13+
paths:
14+
- "recipe.yaml"
15+
- ".github/workflows/conda-release.yml"
1016
# Manual dispatch builds the current conanfile.py/recipe.yaml version (no tag
1117
# guard); idempotent via `rattler-build upload --skip-existing`.
1218
workflow_dispatch: {}
@@ -21,7 +27,8 @@ jobs:
2127
strategy:
2228
fail-fast: false
2329
matrix:
24-
os: [ubuntu-22.04] # extend to macos-15-intel, windows-2022 in a later task
30+
# linux-64, osx-64 (macos-13 is Intel), win-64.
31+
os: [ubuntu-22.04, macos-13, windows-2022]
2532
steps:
2633
- name: Checkout
2734
uses: actions/checkout@v4
@@ -55,18 +62,23 @@ jobs:
5562
setup-only: true
5663
rattler-build-version: v0.66.2
5764

65+
# Relative output dir (not runner.temp) so the bash glob below works
66+
# identically under Git Bash on the Windows runner.
5867
- name: Build conda package
5968
shell: bash
6069
run: |
6170
rattler-build build \
6271
--recipe recipe.yaml \
6372
--channel conda-forge \
64-
--output-dir "${{ runner.temp }}/conda-output"
73+
--output-dir conda-output
6574
75+
# Upload only on a release tag or manual dispatch — never on pull_request
76+
# (PRs are build-only validation of the win-64/osx-64 legs).
6677
- name: Upload to prefix.dev (plotjuggler)
78+
if: github.event_name != 'pull_request'
6779
shell: bash
6880
env:
6981
PREFIX_API_KEY: ${{ secrets.PREFIX_API_KEY }}
7082
run: |
71-
find "${{ runner.temp }}/conda-output" -name '*.conda' -print0 \
83+
find conda-output -name '*.conda' -print0 \
7284
| xargs -0 rattler-build upload prefix --channel plotjuggler --skip-existing

recipe.yaml

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,19 @@ source:
1313
build:
1414
number: 0
1515
script:
16-
- cmake -G Ninja -B build -S .
17-
-DPJ_INSTALL_SDK=ON
18-
-DPJ_BUILD_TESTS=OFF
19-
-DPJ_BUILD_PORTED_PLUGINS=OFF
20-
-DCMAKE_BUILD_TYPE=Release
21-
-DCMAKE_CXX_STANDARD=20
22-
-DCMAKE_PREFIX_PATH=$PREFIX
23-
-DCMAKE_INSTALL_PREFIX=$PREFIX
24-
-DCMAKE_INSTALL_LIBDIR=lib
25-
- cmake --build build
26-
- cmake --install build --prefix $PREFIX
16+
# Unix (linux-64, osx-64): install prefix is $PREFIX, libs in $PREFIX/lib.
17+
- if: unix
18+
then:
19+
- cmake -G Ninja -B build -S . -DPJ_INSTALL_SDK=ON -DPJ_BUILD_TESTS=OFF -DPJ_BUILD_PORTED_PLUGINS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=20 -DCMAKE_PREFIX_PATH=$PREFIX -DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_INSTALL_LIBDIR=lib
20+
- cmake --build build
21+
- cmake --install build --prefix $PREFIX
22+
# Windows (win-64): conda installs under %LIBRARY_PREFIX% (the Library\ tree);
23+
# MSVC needs an explicit Release config at build/install time.
24+
- if: win
25+
then:
26+
- cmake -G Ninja -B build -S . -DPJ_INSTALL_SDK=ON -DPJ_BUILD_TESTS=OFF -DPJ_BUILD_PORTED_PLUGINS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=20 -DCMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%"
27+
- cmake --build build --config Release
28+
- cmake --install build --config Release
2729

2830
requirements:
2931
build:
@@ -49,17 +51,25 @@ requirements:
4951
- fast_float
5052

5153
tests:
54+
# Installed CMake package files — cross-platform (conda puts them under
55+
# $PREFIX/lib on unix, %LIBRARY_PREFIX%\lib i.e. Library/lib on Windows).
56+
- package_contents:
57+
files:
58+
- ${{ "lib" if unix else "Library/lib" }}/cmake/plotjuggler_sdk/plotjuggler_sdkConfig.cmake
59+
- ${{ "lib" if unix else "Library/lib" }}/cmake/plotjuggler_sdk/plotjuggler_sdkConfigVersion.cmake
60+
- ${{ "lib" if unix else "Library/lib" }}/cmake/plotjuggler_sdk/PjPluginManifest.cmake
61+
# Actually exercise the package: build the repo's example consumer, which
62+
# find_package(plotjuggler_sdk COMPONENTS plugin_sdk), links a plugin lib, and
63+
# runs pj_emit_plugin_manifest(). Catches broken CMake config / find_dependency
64+
# / manifest helper — failure modes the file checks above cannot see. Kept
65+
# unix-only for now: the Windows package build itself is the win-64 gate, and
66+
# the plugin-shared-lib example needs separate validation on MSVC (follow-up).
5267
- script:
53-
- test -f $PREFIX/lib/cmake/plotjuggler_sdk/plotjuggler_sdkConfig.cmake
54-
- test -f $PREFIX/lib/cmake/plotjuggler_sdk/plotjuggler_sdkConfigVersion.cmake
55-
- test -f $PREFIX/lib/cmake/plotjuggler_sdk/PjPluginManifest.cmake
56-
- test -f $PREFIX/lib/libpj_base.a
57-
# Actually exercise the package: build the repo's example consumer, which
58-
# find_package(plotjuggler_sdk COMPONENTS plugin_sdk), links a plugin .so, and
59-
# runs pj_emit_plugin_manifest(). Catches broken CMake config / find_dependency
60-
# / manifest helper — failure modes the test -f checks above cannot see.
61-
- cmake -G Ninja -B test_build -S examples/sdk_consumer -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=20 -DCMAKE_PREFIX_PATH=$PREFIX
62-
- cmake --build test_build
68+
- if: unix
69+
then:
70+
- test -f $PREFIX/lib/libpj_base.a
71+
- cmake -G Ninja -B test_build -S examples/sdk_consumer -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=20 -DCMAKE_PREFIX_PATH=$PREFIX
72+
- cmake --build test_build
6373
requirements:
6474
run:
6575
- ${{ compiler('cxx') }}

0 commit comments

Comments
 (0)