Skip to content

Local multi-platform package build/test tooling + CI package verification#3

Merged
pjanec merged 5 commits into
mainfrom
claude/linux-support-pr-ezm5al
Jul 12, 2026
Merged

Local multi-platform package build/test tooling + CI package verification#3
pjanec merged 5 commits into
mainfrom
claude/linux-support-pr-ezm5al

Conversation

@pjanec

@pjanec pjanec commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Follow-up to the Linux-support PR (#2). Makes building and testing the cross-platform packages repeatable, and verifies the packaged output on both platforms in CI.

What's here

Package smoke test (new consumer project)

  • examples/PackageSmokeTest consumes CycloneDDS.NET as a real NuGet package from a local feed (not project references). It declares a [DdsTopic] — so the packaged code generator + bundled idlc run at build time — then does a publish/subscribe round-trip and asserts the payload. Same project runs on Windows and Linux.

Local packing on either OS

  • CycloneDDS.Runtime.csproj: the win-only pack entries (native + .exe apphosts) are now Exists-guarded. On Windows the files are present → unchanged package; on Linux they're skipped → a clean linux-x64-only package. This lets a cross-platform package be assembled by populating both artifacts/native/<rid> folders on one (Windows) host, and a per-platform package be built locally on either OS for testing.

Reusable test scripts

  • build/test-package.sh + build/test-package.ps1: point at a feed (default artifacts/nuget), pick the newest package by write-time, run PackageSmokeTest, then install/verify/uninstall the ddsmonitor tool.

CI

  • The Windows build job now also uploads native-win-x64 (alongside the existing native-linux-x64 and the finished cross-platform nuget-packages), enabling a toolchain-free local pack (download both natives → dotnet pack).
  • Windows build job: smoke-tests the freshly-packed package with test-package.ps1.
  • New linux-verify job: downloads the finished nuget-packages (packed on Windows) and runs test-package.sh on Linux — proving the same cross-platform artifact restores, runs the bundled Linux idlc, loads libddsc.so, round-trips, and serves ddsmonitor. No native build.
  • Net effect: every green run publishes a cross-platform package that has been smoke-tested on both Windows and Linux before you download it.

Docs

  • RELEASE-GUIDE.md: a local build/test section ordered easiest-first (download the finished package from CI → toolchain-free local pack → full local build), pointed at the test-package scripts, plus updated prerequisites (.NET 10 SDK, per-OS native toolchain).

Verified

  • Linux (this VM): packed 0.3.1 + 1.1.1; build/test-package.sh → smoke PASS (native + bundled idlc code-gen + round-trip via the package) + ddsmonitor HTTP 200.
  • Windows (maintainer run of the equivalent flow): cross-platform package built, smoke PASS, ddsmonitor served HTTP 200.

No functional runtime changes to the library; this is packaging/tooling/CI/docs. Versions unchanged (CycloneDDS.NET 0.3.x, CycloneDDS.NET.DdsMonitor 1.1.x).

🤖 Generated with Claude Code

https://claude.ai/code/session_01N7RoW2a2tBB2T8tDbNHB11


Generated by Claude Code

claude added 5 commits July 12, 2026 12:21
…king

- Runtime.csproj: Exists-guard the win-only pack entries (native + .exe
  apphosts) so `dotnet pack` succeeds on Linux too, producing a clean
  linux-x64-only package. On Windows the files are present, so the produced
  package is unchanged. This lets a cross-platform package be assembled by
  populating both artifacts/native/<rid> folders on one (Windows) pack host,
  and a per-platform package be built locally on either OS for testing.

- examples/PackageSmokeTest: a consumer that references CycloneDDS.NET as a
  real NuGet package from the local feed (nuget.config), declares a [DdsTopic]
  (so the packaged code generator + idlc run at build time), and performs a
  publish/subscribe round-trip with assertions. Runs identically on Windows
  and Linux; SmokePkgVersion selects the packed version.

- RELEASE-GUIDE.md: document building/testing a multi-platform package locally
  (Windows cross-platform pack, Linux-only pack, smoke test for both the
  package and the ddsmonitor tool) and update prerequisites (.NET 10 SDK,
  per-OS native toolchain).

Verified on Linux: packed 0.3.1 + 1.1.1 locally, smoke test PASS (native +
codegen + round-trip via the package), and the ddsmonitor tool installed from
the local feed serves HTTP 200.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N7RoW2a2tBB2T8tDbNHB11
… CI-download flow

Follow-up to make local multi-platform package build/test repeatable, and to
address two rough edges found while verifying on Windows.

- build/test-package.sh + build/test-package.ps1: smoke-test the packages from a
  feed. They pick the NEWEST package by write-time (fixes the name-sort footgun
  that selected an old historical build), run examples/PackageSmokeTest against
  it (restore -> bundled idlc code-gen -> pub/sub round-trip), then install the
  ddsmonitor tool, confirm HTTP 200, and uninstall.

- CI: the windows build job now also uploads the win-x64 native as the
  'native-win-x64' artifact. Combined with the existing 'native-linux-x64' and
  'nuget-packages' artifacts, this enables assembling the package locally with no
  C++ toolchain (download both natives -> dotnet pack) — or just downloading the
  finished cross-platform 'nuget-packages' and testing it.

- RELEASE-GUIDE: reorder the local build/test section easiest-first (download the
  finished package from CI; toolchain-free local pack; full local build), and
  reference the test-package scripts instead of the fragile inline version picker.

Verified on Linux: build/test-package.sh -> smoke PASS + ddsmonitor HTTP 200.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N7RoW2a2tBB2T8tDbNHB11
- Windows build job: after packing, run build/test-package.ps1 to consume the
  freshly-packed cross-platform package (PackageSmokeTest round-trip + ddsmonitor
  tool) on Windows.
- New linux-verify job: downloads the finished 'nuget-packages' artifact (packed
  on Windows) and runs build/test-package.sh on Linux — proving the same
  cross-platform package restores, runs the bundled Linux idlc for code-gen,
  loads libddsc.so, round-trips, and serves the ddsmonitor tool. No native build.

Also invoke ddsmonitor by absolute path in test-package.ps1 so it works right
after `dotnet tool install --global` (tools dir may not be on PATH yet in CI).

Net effect: every green run publishes a cross-platform package that has been
smoke-tested on BOTH Windows and Linux before you download it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N7RoW2a2tBB2T8tDbNHB11
…the whole library

SourceLink was already configured (Microsoft.SourceLink.GitHub +
PublishRepositoryUrl + snupkg), and CycloneDDS.Runtime's PDB carried correct
raw.githubusercontent URLs. But the package's lib/net8.0 shipped CycloneDDS.Core
and CycloneDDS.Schema as DLLs only — their PDBs were never packed (they're
manually-added project-reference outputs, so not auto-collected). A consumer
could step into Runtime but not Core/Schema.

- Runtime.csproj: pack CycloneDDS.Core.pdb and CycloneDDS.Schema.pdb next to their
  DLLs in lib/net8.0 (Exists-guarded), mirroring the existing Runtime.pdb. These
  PDBs already carry SourceLink URLs, so all three lib assemblies are now
  debuggable straight from the .nupkg (no symbol server needed).
- Directory.Build.props: set ContinuousIntegrationBuild=true on GitHub Actions so
  published PDBs are deterministic with normalized source paths.
- RELEASE-GUIDE: document the SourceLink/symbols verification and note to publish
  both .nupkg and .snupkg from a CI build on main/a tag.

Verified: repacked locally; lib/net8.0 now has Runtime/Core/Schema .dll + .pdb,
and sourcelink print-urls lists GitHub raw URLs for all three PDBs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N7RoW2a2tBB2T8tDbNHB11
- New 'publish' job in ci.yml: on a vX.Y.Z tag, after both the Windows build and
  the linux-verify job pass, download the packages+symbols artifacts and
  `dotnet nuget push` them to NuGet.org (--skip-duplicate). Fails fast with a clear
  message if the NUGET_API_KEY secret is missing. Publishes both CycloneDDS.NET and
  CycloneDDS.NET.DdsMonitor (and their .snupkg).
- version.json (root + DdsMonitor): add ^refs/tags/v\d+\.\d+ to publicReleaseRefSpec
  so a tag build gets a clean version (no -gSHA prerelease suffix).
- RELEASE-GUIDE: document the NUGET_API_KEY repository secret, the tag/release
  flow, and that the published version is the NBGV-computed version (name the tag
  to match `nbgv get-version`).
- CHANGELOG: add 0.3.2 (SourceLink fix, CI package verification + auto-publish,
  local test tooling).

Note: merging the follow-up PR advances main to 0.3.2 (NBGV patch = git height),
so the first published release will be 0.3.2 — which is what carries the SourceLink
fix.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N7RoW2a2tBB2T8tDbNHB11
@pjanec pjanec merged commit baafe2e into main Jul 12, 2026
4 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.

2 participants