This document describes all six CI/CD workflows and explains how they connect.
Feature branch push
│
▼
[build.yml] ──── format → compile → test → pack → publish-dev + assembly metadata
│
│ promote-branch (manual)
▼
preview/X.Y branch
│
▼
[pull-request.yml] ──── compile → test → pack → publish-dev + benchmark (optional)
│
│ merge PR
▼
[release.yml] ──── compile → test → pack → publish-NuGet → GitHub Release → documentation
│
│ publish-documentation (manual)
▼
GitHub Pages (petesramek.github.io/polyline-algorithm-csharp)
Version bumping runs independently via bump-version.yml (manual trigger).
Trigger: Push to any branch except preview/** and release/**, when files under src/ change.
Jobs (in order):
| Job | Depends on | Description |
|---|---|---|
workflow-variables |
— | Sets is-release and is-preview flags |
versioning |
— | Extracts version from branch name, builds semver strings |
format |
— | Runs dotnet format and pushes changes back to the branch |
build |
versioning, format |
Compiles source, uploads build artifact |
test |
build |
Runs MSTest suite, generates test + coverage reports |
pack |
versioning, build |
Creates .nupkg / .snupkg, uploads package artifact |
publish-package |
pack |
Pushes package to Azure Artifacts (Development environment) |
generate-assembly-metadata |
versioning, build |
Runs docfx metadata, commits versioned YAML to api-reference/ |
Purpose: Continuous validation of feature branches. Also keeps the api-reference/ directory up-to-date with every successful build.
Trigger: Pull requests targeting preview/** or release/** branches (opened, synchronize, reopened).
Jobs (in order):
| Job | Depends on | Description |
|---|---|---|
workflow-variables |
— | Sets is-release and is-preview flags |
versioning |
workflow-variables |
Extracts version from base branch |
build |
versioning |
Compiles source |
test |
build |
Runs tests, generates reports |
pack |
versioning, build |
Packages binaries |
publish-development-package |
pack |
Pushes to Azure Artifacts (Development environment) |
benchmark |
build |
BenchmarkDotNet run on Ubuntu, Windows, macOS — only when BENCHMARKDOTNET_RUN_OVERRIDE=true or building a release branch |
Purpose: Validates the change before it merges into a stabilization branch. Benchmark results are uploaded as per-OS artifacts and appended to the step summary.
Trigger: Push to preview/** or release/** branches when files under src/ change (i.e., after a PR is merged).
Jobs (in order):
| Job | Depends on | Description |
|---|---|---|
workflow-variables |
— | Sets is-release / is-preview flags |
validate-release |
workflow-variables |
Fails fast if the branch is neither preview/** nor release/** |
versioning |
workflow-variables, validate-release |
Extracts and formats version from the branch name |
build |
versioning |
Compiles source |
test |
build |
Runs tests |
pack |
versioning, build |
Packages binaries |
publish-package |
pack |
Publishes to NuGet.org (Production environment) |
create-release |
versioning, publish-package |
Creates a git tag + GitHub release with auto-generated notes |
update-changelog |
release |
Fetches release notes and prepends a new entry to CHANGELOG.md — stable releases only |
generate-docs |
versioning |
Builds DocFX site |
publish-docs |
generate-docs |
Deploys to GitHub Pages |
Purpose: Full release pipeline. Triggered by merging a PR into preview/** (pre-release) or release/** (stable release).
Trigger: Manual (workflow_dispatch).
Inputs:
| Input | Values | Description |
|---|---|---|
bump-type |
minor / major |
Type of version bump |
What it does:
- Reads the current version from the default branch.
- Increments the
MINORorMAJORcomponent. - Unlocks the target branches (via
branch-protection/unlock), commits the new version number, and re-locks them. - Creates a pull request for the version bump change.
Purpose: Controlled version increment without manual editing of version files.
Trigger: Manual (workflow_dispatch).
Inputs:
| Input | Values | Description |
|---|---|---|
promotion-type |
preview / release |
Target stabilization tier |
base-branch |
string | Branch to branch off from (default: main) |
Validation rules:
previewpromotion requires source to be adevelop/**orsupport/**branch.releasepromotion requires source to be apreview/**branch.- Source and target branches must be different.
- An open PR from source → target must not already exist.
What it does:
- Extracts the version from the current branch name.
- Derives the target branch name (
preview/X.Yorrelease/X.Y). - Creates the target branch if it does not exist, then locks it.
- Opens a pull request from the current branch into the target branch.
Purpose: Promotes code from a development branch into a stabilization branch following the branch strategy.
Trigger: Manual (workflow_dispatch).
Jobs:
| Job | Description |
|---|---|
workflow-variables |
Captures github.run_number |
versioning |
Extracts version from the current branch |
generate-docs |
Runs docfx build from api-reference/api-reference.json, uploads result to api-reference/_docs/, then to github-pages artifact |
publish-docs |
Deploys github-pages artifact to GitHub Pages |
Purpose: Re-publishes the documentation site on demand, without needing a code change. Useful after updating guide articles or fixing doc rendering issues.
All workflows share these top-level env defaults:
| Variable | Value |
|---|---|
dotnet-sdk-version |
10.x |
build-configuration |
Release |
build-platform |
Any CPU |
test-result-directory |
test-results |
nuget-packages-directory |
nuget-packages |
Each workflow uses a concurrency group keyed on the branch or ref to prevent parallel runs from conflicting. Most use cancel-in-progress: false to avoid canceling in-flight releases; only pull-request uses cancel-in-progress: true to discard stale runs quickly.