This repository is wired for two remotes: GitHub for public builds, releases, and community visibility; GitLab for self-hosted Linux/Windows runners (internal iteration, private mirrors, or pre-publish validation).
| Platform | Config | Typical use |
|---|---|---|
| GitHub Actions | .github/workflows/build.yml |
PR + main/master + v* tags; matrix Ubuntu / Windows / macOS; artifacts; GitHub Release on tags; GitHub Packages (NuGet); optional NuGet.org |
| GitLab CI/CD | .gitlab-ci.yml |
MR + branches + v*.*.* tags; parallel Linux + Windows builds; GitLab Release; GitLab Package Registry; optional NuGet.org |
| Dependabot | .github/dependabot.yml |
Weekly NuGet + GitHub Actions bumps (GitHub only) |
- Push to
mainormaster - Push tags matching
v*(e.g.v0.1.1) - Pull requests
- Manual Run workflow (
workflow_dispatch)
build(matrix) —dotnet restore,build,test,packthe SDK,publishmonitorctl forlinux-x64,win-x64,osx-arm64. Uploads one artifact per OS.release(tags only, after all matrix jobs succeed) — downloads matrix artifacts, collects one.nupkg+.snupkg(if present), zips eachmonitorctl-*folder, creates a GitHub Release withsoftprops/action-gh-release, pushes the.nupkgto GitHub Packages, then optionally to NuGet.org.
| Item | Purpose |
|---|---|
GITHUB_TOKEN |
Default; release job uses contents: write + packages: write for releases and GitHub Packages |
NUGET_API_KEY |
Optional repository secret — NuGet API key with Push scope for MonitorControl.Sdk. If unset, the NuGet.org step logs a skip and exits successfully |
The root README build badge points at build.yml on master.
- Confirm Packages are enabled for the org/user.
- The feed URL is
https://nuget.pkg.github.com/OWNER/index.jsonwhereOWNERisgithub.repository_owner. - If you do not want GitHub Packages, remove or comment out the Push to GitHub Packages step in
build.yml(NuGet.org-only flow).
Register runners and assign tags (Settings → CI/CD → Runners → edit tags):
| Tag | Role |
|---|---|
gitlab-linux |
Linux jobs (build, pack, most release jobs) |
gitlab-windows |
Windows build + win-x64 monitorctl |
Install .NET 8 SDK on each runner. For Docker executors instead, uncomment the image: mcr.microsoft.com/dotnet/sdk:8.0 block documented at the top of .gitlab-ci.yml and adjust jobs to use it (you can drop host SDK installs).
build:linux/build:windows— restore, build, test, publish monitorctl forlinux-x64/win-x64; artifacts per job.package:nupkg— packsMonitorControl.Sdkintopublish/nupkg/(runs on Linux afterbuild:linuxwithout needing its artifacts).release:gitlab— GitLab Release record for semver tags (vMAJOR.MINOR.PATCH).publish:gitlab-nuget—dotnet nuget pushto this project’s GitLab NuGet Package Registry (usesCI_JOB_TOKEN). Requires GitLab 15.1+ and project setting allowing the job token to access the registry (see GitLab docs “Job token permissions”).release:nuget-org— pushes to NuGet.org when the masked variableNUGET_API_KEYis set; otherwise prints a skip message.
If you cannot use gitlab-linux / gitlab-windows, search-replace those strings in .gitlab-ci.yml to match your tags.
Use annotated tags matching vMAJOR.MINOR.PATCH (e.g. v0.1.2) so both pipelines run release stages consistently.
git tag -a v0.1.2 -m "Release v0.1.2"
git push origin v0.1.2
git push github v0.1.2 # if you use a second remoteBump <Version> in src/MonitorControlSDK/MonitorControlSDK.csproj before tagging.
- Day-to-day: push branches / MRs to GitLab for fast feedback on your runners.
- When stable: merge to
master, push to GitHub, tagv*, let Actions attach release assets and (if configured) publish to NuGet.org + GitHub Packages. - Keep GitLab’s NuGet.org job disabled by omitting
NUGET_API_KEYthere if GitHub is the single source of public publishes — or set the key on both for redundancy.
| Symptom | Check |
|---|---|
| GitLab: no runners | Tags on jobs match runner tags; runner not paused |
| GitLab: JOB_TOKEN push 403 | Project → Settings → CI/CD → Job token allowlist / package registry permissions |
| GitHub: release job missing zips | Matrix artifacts must include monitorctl-* dirs; find in workflow lists three RIDs |
| GitHub: NuGet.org 401 | Rotate NUGET_API_KEY; ensure key includes the correct package ID scope |
| Dependabot PR noise | Tweak .github/dependabot.yml ignore / groups / open-pull-requests-limit |