Skip to content

Development and Release

Will Strohl edited this page Nov 19, 2026 · 1 revision

Development and release

This repository is an SDK-style C# solution targeting .NET Framework 4.8. The library, tests, and LocalMCP tool are separate projects; only the library project is packaged for NuGet.

Repository layout

Path Purpose
WillStrohl.oEmbed/ Library source and project.
WillStrohl.API.oEmbed.Tests/ MSTest project with no-network behavior tests.
Tools/Upendo.LocalDevelopmentMcp/ Repository-local development tool; not part of the NuGet package.
README.md Project overview and current feature/security reference.
.github/workflows/publish.yml Tag-driven build, test, pack, and trusted NuGet publishing workflow.

Build and test locally

Use MSBuild on a machine with .NET Framework 4.8 developer tools installed. The approved solution build is:

MSBuild.exe WillStrohl.API.oEmbed.sln /m /p:Configuration=Release

Build the test project separately when validating tests:

MSBuild.exe WillStrohl.API.oEmbed.Tests/WillStrohl.API.oEmbed.Tests.csproj /m /p:Configuration=Release

Run the resulting test assembly with the installed Visual Studio Test Platform:

vstest.console.exe .\WillStrohl.API.oEmbed.Tests\bin\Release\net48\WillStrohl.API.oEmbed.Tests.dll

The tests are designed to avoid live provider calls. They cover routing, discovery, response parsing, security policy, and safe HTML behavior.

Create the package

The library project defines the package metadata and targets net48. Pack only the library project:

MSBuild.exe WillStrohl.oEmbed/WillStrohl.API.oEmbed.csproj `
  /m /t:Pack /p:Configuration=Release `
  /p:PackageOutputPath=artifacts\nuget\

The output should contain:

  • WillStrohl.API.oEmbed.<version>.nupkg
  • WillStrohl.API.oEmbed.<version>.snupkg

The package should contain the lib/net48 assembly, XML documentation, README, repository metadata, the MIT license expression, and only the intended Newtonsoft.Json dependency. Test and LocalMCP dependencies must not enter the package.

Release workflow

The GitHub Actions workflow runs when a tag matching v* is pushed. The tag must match the project version:

project version: 1.5.2
tag:             v1.5.2

The workflow builds on a pinned Windows runner, runs tests, packs the library, obtains a short-lived NuGet key through NuGet/login@v1, and pushes the package and symbols through NuGet trusted publishing.

Required GitHub configuration:

  • Repository secret NUGET_USER: the exact NuGet.org profile name.
  • NuGet trusted-publishing policy owner: WillStrohl.
  • NuGet trusted-publishing policy repository: oembed.
  • NuGet trusted-publishing policy workflow file: publish.yml.
  • The policy environment must match the workflow if an environment is later added.

Do not store a long-lived NuGet API key in the repository. The OIDC action creates a temporary key for the publishing job.

Release checklist

  • Project and assembly versions match.
  • README installation version matches the package version.
  • Release build succeeds.
  • Tests pass.
  • Package contains a net48 library and portable symbols.
  • Package metadata and dependency groups are correct.
  • The trusted-publishing policy matches publish.yml.
  • The release tag is v<version>.
  • NuGet.org package and symbols validation complete after publication.

Clone this wiki locally