Notes to self. Releasing is two steps: push a tag, then upload the package by hand.
<Version> in src/Mapi/SimpleMapi.SDK.csproj is the single source of truth.
Update it, and <PackageReleaseNotes> while you're there, then commit.
Version numbers follow SemVer: patch for a fix or a packaging change, minor for a new API, major for anything that breaks callers.
git tag 1.2.3
git push origin 1.2.3
Tags have no v prefix - just the bare number, matching the existing 1.1.0 tag.
That triggers .github/workflows/release.yml, which:
- checks the tag matches
<Version>in the csproj, and fails the build if not - runs
dotnet pack -c Release - creates the GitHub release, with the
.nupkgattached and release notes generated from the commits since the last tag
No secrets are needed - creating a release uses the automatic GITHUB_TOKEN.
Download the .nupkg from the GitHub release (or build it locally, below) and
upload it at https://www.nuget.org/packages/manage/upload.
This step is deliberately not automated. It would need a nuget.org API key stored as a repo secret, which is more machinery than this project warrants.
dotnet pack src/Mapi/SimpleMapi.SDK.csproj -c Release
Lands in artifacts/ (set by <PackageOutputPath>; git-ignored).
- The library targets
net20;net40;netstandard2.0;net8.0-windows. Old .NET Framework consumers are served by thenet20/net40assets in the package - that is why those targets exist, and dropping them would break people. It has nothing to do with what SDK you build with; the modern .NET SDK emits them all, on Linux too. - Don't set
GeneratePackageOnBuild. With it on,dotnet packfails withNU5026on a clean tree, because packing fires per-target-framework before all four have built. - Simple MAPI is Windows-only at runtime but nothing about building or
packaging needs Windows, which is why CI runs on
ubuntu-latest. - To actually test it you need Windows with a default mail client
configured. Run the console demo in
src/Demos/Console-Demo. There are no automated tests - the whole library is P/Invoke intoMAPI32.DLL.