Example .NET application and CI/CD pipeline for integrating it with Semaphore 2.0.
This demo uses the preinstalled .NET 10 toolchain available on Semaphore's ubuntu2404 image.
The repository contains:
- a .NET solution file
- a console application
- a reusable class library
- an xUnit test project
- a Semaphore pipeline that restores, builds, tests, publishes, and runs the app
The application prints a greeting generated by the core library. The tests validate that greeting behavior directly at the library level.
.
├── .semaphore/
│ └── semaphore.yml
├── src/
│ ├── HelloSemaphore.App/
│ └── HelloSemaphore.Core/
├── tests/
│ └── HelloSemaphore.Tests/
├── Directory.Build.props
└── HelloSemaphore.sln
If you have the .NET 10 SDK installed, run:
dotnet restore HelloSemaphore.sln
dotnet build HelloSemaphore.sln --configuration Release
dotnet test HelloSemaphore.sln --configuration Release
dotnet run --project src/HelloSemaphore.App/HelloSemaphore.App.csproj --configuration ReleaseTo override the default runtime values:
DEMO_APP_NAME="Semaphore Demo" DEMO_ENVIRONMENT="dev" dotnet run --project src/HelloSemaphore.App/HelloSemaphore.App.csprojThe pipeline is defined in .semaphore/semaphore.yml and runs these steps:
Inspect ToolchainRestoreBuildTestPublishRun Demo
The workflow is intentionally verbose enough to show:
- which projects were built
- which tests were executed
- where the test results were written
- which files were produced by publish
The projects target net10.0 to match the current toolchain available on Semaphore's Ubuntu 24.04 image.