feat: Pack CLI as .NET tool in NuGet packages#263
Draft
Conversation
Set up .NET 10 project with console application and test framework. Includes Native AOT compilation support for improved performance and central package management with TUnit for testing. Co-Authored-By: Claude <noreply@anthropic.com>
Configure Sentry.Cli as a .NET global tool with all required and recommended NuGet package metadata. The package will be published as "dotnet-sentry" and installed via "dotnet tool install -g dotnet-sentry". Changes include: - Set IsPackable to false by default in Directory.Build.props - Override IsPackable to true for Sentry.Cli project - Configure PackAsTool with command name "sentry" - Add package metadata (ID, version, authors, description, etc.) - Include LICENSE.md, README.md, and package icon in NuGet package Fixes GH-255 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add ToolPackageRuntimeIdentifiers to support platform-specific .NET tool packages for osx-arm64, osx-x64, linux-arm64, linux-x64, win-x64, and any. This enables Native AOT compilation for each supported platform using .NET 10's DotNetCliTool Version 2. Also add Deterministic and CI build properties to Directory.Build.props for reproducible builds in GitHub Actions. Refs #255 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Program.cs now dispatches to the correct native Sentry CLI binary based on the target platform/architecture using compile-time constants. The .csproj is updated to define per-RID constants and pack the native binary alongside the .NET tool for each supported RID. Also adds a pack.ts script for building NuGet packages and updates .gitignore and package.json accordingly. Co-Authored-By: Claude <noreply@anthropic.com>
Tests cover both the framework-dependent fallback (expects exit code 1 and an unsupported-platform error) and the platform-specific happy path (publishes with the current RID, copies the native binary, and asserts the version output). Includes test helpers: DotnetProject, PathUtilities, PlatformUtilities, ProcessResult, and JsonUtilities. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Runs dotnet test on all 5 targets after build-binary, downloading the platform-specific native binary artifact into dist-bin so both TUnit tests can run: the framework-dependent fallback test and the platform-specific launcher test. Also wires test-dotnet into ci-status checks and skipped-detection, and adds a test:dotnet script to package.json for local use. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Build
Other
Bug Fixes 🐛Telemetry
Other
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
Contributor
Codecov Results 📊✅ Patch coverage is 100.00%. Project has 3693 uncovered lines. Files with missing lines (70)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 73.15% 73.15% —%
==========================================
Files 111 111 —
Lines 13756 13756 —
Branches 0 0 —
==========================================
+ Hits 10063 10063 —
- Misses 3693 3693 —
- Partials 0 0 —Generated by Codecov Action |
Extract resolveTargets() and verifyBinaries() helpers from pack() to bring its complexity score below the linter's max of 15. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds script/dotnet-lint.ts wrapping `dotnet format` with a --check flag that passes --verify-no-changes (non-zero exit if any file would change). Wires up lint:dotnet / lint:dotnet:fix npm scripts and a lint-dotnet CI job that gates test-dotnet. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Redesigns pack.ts mode semantics so CI can assemble all 7 packages across three runners without duplicating the root/any packages: - `--agnostic`: packs only root (pointer) + any packages; no binary needed - `--single`: packs current platform only (no root/any) - `--target <t>`: packs one specific target only (no root/any) - no args: packs current platform + root + any (replaces "all platforms") - `--no-clean`: skips dist-pkg cleanup, allowing accumulation across calls Adds a new `build-nuget` CI job (linux/macos/windows matrix) that downloads the pre-built native binaries, calls pack.ts with --no-clean for each target + agnostic (linux only), and uploads a per-runner nuget-* artifact. Together the three runners produce all 7 packages. Updates package.json: `pack` drops --single, `pack:all` → `pack:agnostic`. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ntries Replaces the 3-runner matrix (linux/macos/windows) with 5 entries, one per binary target, so each runner packs and uploads exactly one package. - Downloads a single named artifact instead of a wildcard pattern - Replaces the pack loop with a direct --target call per entry - Moves the agnostic condition from a bash if to a step-level if Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.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.
Requires .NET SDK 10.0+.
See #255.