Local multi-platform package build/test tooling + CI package verification#3
Merged
Conversation
…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
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.
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/PackageSmokeTestconsumesCycloneDDS.NETas a real NuGet package from a local feed (not project references). It declares a[DdsTopic]— so the packaged code generator + bundledidlcrun 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 +.exeapphosts) are nowExists-guarded. On Windows the files are present → unchanged package; on Linux they're skipped → a cleanlinux-x64-only package. This lets a cross-platform package be assembled by populating bothartifacts/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 (defaultartifacts/nuget), pick the newest package by write-time, runPackageSmokeTest, then install/verify/uninstall theddsmonitortool.CI
buildjob now also uploadsnative-win-x64(alongside the existingnative-linux-x64and the finished cross-platformnuget-packages), enabling a toolchain-free local pack (download both natives →dotnet pack).test-package.ps1.linux-verifyjob: downloads the finishednuget-packages(packed on Windows) and runstest-package.shon Linux — proving the same cross-platform artifact restores, runs the bundled Linuxidlc, loadslibddsc.so, round-trips, and servesddsmonitor. No native build.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 thetest-packagescripts, plus updated prerequisites (.NET 10 SDK, per-OS native toolchain).Verified
0.3.1+1.1.1;build/test-package.sh→ smoke PASS (native + bundled idlc code-gen + round-trip via the package) +ddsmonitorHTTP 200.ddsmonitorserved HTTP 200.No functional runtime changes to the library; this is packaging/tooling/CI/docs. Versions unchanged (
CycloneDDS.NET0.3.x,CycloneDDS.NET.DdsMonitor1.1.x).🤖 Generated with Claude Code
https://claude.ai/code/session_01N7RoW2a2tBB2T8tDbNHB11
Generated by Claude Code