{"id":15011674,"url":"https://github.com/gabrielweyer/cake-build","last_synced_at":"2026-03-11T22:02:55.793Z","repository":{"id":27566200,"uuid":"114432526","full_name":"gabrielweyer/cake-build","owner":"gabrielweyer","description":"Demonstrates a basic build of a .NET NuGet package using https://cakebuild.net/","archived":false,"fork":false,"pushed_at":"2026-03-07T01:00:55.000Z","size":280,"stargazers_count":23,"open_issues_count":0,"forks_count":8,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-03-07T08:03:39.518Z","etag":null,"topics":["appveyor","azure-devops","azure-devops-pipelines","cake","circle-ci","continuous-integration","dotnet","github-actions","nuget-package","semver"],"latest_commit_sha":null,"homepage":"https://gabrielweyer.net/2018/04/21/cake-build/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gabrielweyer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-12-16T04:12:36.000Z","updated_at":"2026-03-07T01:00:57.000Z","dependencies_parsed_at":"2023-10-15T01:51:36.188Z","dependency_job_id":"c0cd5ef4-85e0-4f18-929c-bf58c40f5484","html_url":"https://github.com/gabrielweyer/cake-build","commit_stats":{"total_commits":316,"total_committers":3,"mean_commits":"105.33333333333333","dds":0.2183544303797469,"last_synced_commit":"4705cf2769f8c6be14b61aaf7ae362cacf0d89ef"},"previous_names":[],"tags_count":142,"template":false,"template_full_name":null,"purl":"pkg:github/gabrielweyer/cake-build","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielweyer%2Fcake-build","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielweyer%2Fcake-build/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielweyer%2Fcake-build/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielweyer%2Fcake-build/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gabrielweyer","download_url":"https://codeload.github.com/gabrielweyer/cake-build/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielweyer%2Fcake-build/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30404103,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T21:51:19.558Z","status":"ssl_error","status_checked_at":"2026-03-11T21:50:57.892Z","response_time":84,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["appveyor","azure-devops","azure-devops-pipelines","cake","circle-ci","continuous-integration","dotnet","github-actions","nuget-package","semver"],"created_at":"2024-09-24T19:41:25.638Z","updated_at":"2026-03-11T22:02:55.775Z","avatar_url":"https://github.com/gabrielweyer.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cake build\n\n| Package | Release | Pre-release |\n| --- | --- | --- |\n| `Contoso.Hello.Logic` | [![MyGet][my-get-logic-r-badge]][my-get-logic-r] | [![MyGet][my-get-logic-pre-badge]][my-get-logic-pre] |\n| `Contoso.Hello.SuperLogic` | [![MyGet][my-get-super-r-badge]][my-get-super-r] | [![MyGet][my-get-super-pre-badge]][my-get-super-pre] |\n\n| CI | Status | Platform(s) | Framework(s) | Test Framework(s) |\n| --- | --- | --- | --- | --- |\n| [AppVeyor](#appveyor) | [![Build Status][app-veyor-shield]][app-veyor] | `Windows` | `netstandard2.0`, `net462` | `net8.0`, `net462` |\n| [Azure DevOps](#azure-devops) | [![Build Status][azure-devops-shield]][azure-devops] | `Linux` | `netstandard2.0` | `net8.0` |\n| [CircleCI](#circleci) | [![Build Status][circle-ci-shield]][circle-ci] | `Docker`: `mcr.microsoft.com/dotnet/sdk:8.0` | `netstandard2.0` | `net8.0` |\n| [GitHub](#github) | [![Build Status][github-actions-shield]][github-actions] | `Windows` | `netstandard2.0`, `net462` | `net8.0`, `net462` |\n\nDemonstrates a basic build of a `.NET` `NuGet` package using [Cake][cake].\n\nI tried to create a *somewhat* realistic scenario without writing too much code:\n\n- The solution contains two projects which will be packed as `NuGet` packages.\n  - The `SuperLogic` project depends from `Logic` and when packing this project reference will be turned into a `NuGet` package reference (handled out of the box by `dotnet pack`).\n  - The `Logic` project references a `NuGet` package from [nuget.org][nuget-org] via a `PackageReference`, `dotnet pack` will turn this into a package reference.\n- The projects target both `netstandard2.0` and `net462` so they can be used with the `.NET Framework` (`net462` and above).\n- The solution contains a test project.\n- Use [`SemVer`][semver] to version the `DLLs` and the `NuGet` packages.\n  - **Note**: `SemVer` is implemented via [`GitVersion`][git-version].\n\nI wrote a [blog post][cake-build-post] about this experiment.\n\n## Table of contents\n\n- [Pinning the version of Cake](#pinning-the-version-of-cake)\n- [Running locally](#running-locally)\n- [Benefits over a nuspec file](#benefits-over-a-nuspec-file)\n- [Referencing a project without turning it into a package reference](#referencing-a-project-without-turning-it-into-a-package-reference)\n- [CI](#ci)\n- [Status checks](#status-checks)\n\n## Pinning the version of Cake\n\nPinning the version of `Cake` guarantees you'll be using the same version of `Cake` on your machine and on the build server.\n\nThis is done by using `Cake` as a `.NET` **local** tool. The version is specified in `.config\\dotnet-tools.json`.\n\n## Running locally\n\n### Pre-requisites\n\n- [.NET SDK 8.0.x][dotnet-sdk] and higher\n\n### Initial setup on Windows\n\n```powershell\n.\\bootstrap.ps1\n```\n\n### Initial setup on Linux / OS X\n\n```bash\n./bootstrap.sh\n```\n\n### Run build script\n\n```bash\ndotnet cake build.cake\n```\n\n## Benefits over a nuspec file\n\n- A single file describing the package and the project instead of two (`*.csproj` and `*.nuspec`)\n- References (projects or `NuGet` packages) are resolved automatically. There is no need to tweak a file manually any more!\n\n## Referencing a project without turning it into a package reference\n\nThe `SuperLogic` project depends on the `ExtraLogic` project but we don't want to ship `ExtraLogic` as a package. Instead we want to include `Contoso.Hello.ExtraLogic.dll` in the `SuperLogic` package directly. Currently this is not supported out of the box but the team is [tracking it][pack-issues].\n\nLuckily [this issue][project-reference-dll-issue] provides a workaround. All the modifications will take place in `SuperLogic.csproj`.\n\n- In the `\u003cPropertyGroup\u003e` section add the following line:\n\n```xml\n\u003cTargetsForTfmSpecificBuildOutput\u003e$(TargetsForTfmSpecificBuildOutput);IncludeReferencedProjectInPackage\u003c/TargetsForTfmSpecificBuildOutput\u003e\n```\n\n- Prevent the project to be added as a package reference by making [all assets private][private-assets].\n\n```xml\n\u003cProjectReference Include=\"..\\ExtraLogic\\ExtraLogic.csproj\"\u003e\n  \u003cPrivateAssets\u003eall\u003c/PrivateAssets\u003e\n\u003c/ProjectReference\u003e\n```\n\n- Finally add the target responsible of copying the `DLL`:\n\n```xml\n\u003cTarget Name=\"IncludeReferencedProjectInPackage\"\u003e\n  \u003cItemGroup\u003e\n    \u003cBuildOutputInPackage Include=\"$(OutputPath)Contoso.Hello.ExtraLogic.dll\" /\u003e\n  \u003c/ItemGroup\u003e\n\u003c/Target\u003e\n```\n\n## CI\n\nEach time a commit is pushed to `main` or `features/*`; `AppVeyor`, `Azure DevOps`, `CircleCI` and `GitHub` will build the changes.\n\nIn case of a successful build `GitHub` will:\n\n- On `main`\n  - [Create][github-release] a `GitHub` **release**\n  - Publish the `NuGet` packages (including symbols) to `gabrielweyer` [feed][my-get-gabrielweyer-feed]\n- On `features/*`\n  - [Create][github-release] a `GitHub` **pre-release**\n  - Publish the `NuGet` packages (including symbols) to `gabrielweyer-pre-release` [feed][my-get-gabrielweyer-pre-release-feed]\n\nWhen running on a platform that is not Windows, we can't target the `.NET` full Framework, hence the build script is calling `IsRunningOnLinuxOrDarwin` to detect the available capabilities.\n\n### AppVeyor\n\nBuild status is visible [here][app-veyor].\n\n- Supports `Linux`, `macOS` and `Windows` hosted agents\n- Can create a `GitHub` release and `tag` the `repository` if required\n- Supports artifacts and test results\n- You can modify `AppVeyor`'s build number programatically\n  - `Cake` integrates with `AppVeyor`: publish test results, upload artifacts, update build number...\n- Partially supports files exclusion (commits are skipped as soon as they contain one file in the excluded\nlist)\n\n### Azure DevOps\n\nAzure DevOps [does not offer a free an unlimited plan for open-source projects any more][azure-devops-public-project-grant].\n\nBuild status is visible [here][azure-devops].\n\n- Supports `Docker`, `Linux`, `macOS` and `Windows` hosted agents\n- Supports artifacts and test results\n- Supports files exclusion\n\n### CircleCI\n\nBuild status is visible [here][circle-ci].\n\n- Supports `Docker`, `Linux`, `macOS` and `Windows` hosted agents\n- Supports artifacts\n\n`CircleCI` has a few limitations:\n\n- Test results have to be in `JUnit` format, you can use the package [JunitXml.TestLogger][junit-xml-test-logger] for a `JUnit` logger\n- Can't exclude files easily\n\n### GitHub\n\nBuild status is visible [here][github-actions].\n\n- Supports `Docker`, `Linux`, `macOS` and `Windows` hosted agents\n- Supports artifacts\n- Supports files exclusion\n\n`GitHub` has a few limitations:\n\n- A third-party / custom Action is required to report test results\n- A third-party / custom Action is required to create a GitHub release\n\n### Travis CI\n\nI decided to remove Travis CI. Travis CI [poorly handled a security vulnerability][travis-ci-vulnerability] and security is of paramount importance when it comes to build systems.\n\n## Status checks\n\nThe `main` branch is [`protected`][github-protected-branch]:\n\n- Force push is disabled on `main`\n- `main` cannot be deleted\n- Non-protected branches (such as `features/*`) cannot be merged into `main` until they satisfy:\n  - An `AppVeyor` passing build\n  - An `Azure DevOps` passing build\n  - A `CircleCI` passing build\n  - A `GitHub` passing build\n\nAfter a branch was configured as `protected`, `GitHub` will suggest available [status checks][github-status-checks].\n\n[cake]: https://cakebuild.net/\n[nuget-org]: https://www.nuget.org/\n[semver]: https://semver.org/\n[git-version]: https://gitversion.net/docs/\n[pack-issues]: https://github.com/NuGet/Home/issues/6285\n[project-reference-dll-issue]: https://github.com/NuGet/Home/issues/3891\n[private-assets]: https://docs.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files#controlling-dependency-assets\n[app-veyor]: https://ci.appveyor.com/project/GabrielWeyer/cake-build\n[app-veyor-shield]: https://ci.appveyor.com/api/projects/status/github/gabrielweyer/cake-build?branch=main\u0026svg=true\n[my-get-gabrielweyer-feed]: https://www.myget.org/feed/Packages/gabrielweyer\n[my-get-gabrielweyer-pre-release-feed]: https://www.myget.org/feed/Packages/gabrielweyer-pre-release\n[github-release]: https://github.com/gabrielweyer/cake-build/releases\n[my-get-logic-r-badge]: https://img.shields.io/myget/gabrielweyer/v/Contoso.Hello.Logic.svg?label=MyGet\n[my-get-logic-r]: https://www.myget.org/feed/gabrielweyer/package/nuget/Contoso.Hello.Logic\n[my-get-logic-pre-badge]: https://img.shields.io/myget/gabrielweyer-pre-release/v/Contoso.Hello.Logic.svg?label=MyGet\n[my-get-logic-pre]: https://www.myget.org/feed/gabrielweyer-pre-release/package/nuget/Contoso.Hello.Logic\n[my-get-super-r-badge]: https://img.shields.io/myget/gabrielweyer/v/Contoso.Hello.SuperLogic.svg?label=MyGet\n[my-get-super-r]: https://www.myget.org/feed/gabrielweyer/package/nuget/Contoso.Hello.SuperLogic\n[my-get-super-pre-badge]: https://img.shields.io/myget/gabrielweyer-pre-release/v/Contoso.Hello.SuperLogic.svg?label=MyGet\n[my-get-super-pre]: https://www.myget.org/feed/gabrielweyer-pre-release/package/nuget/Contoso.Hello.SuperLogic\n[github-protected-branch]: https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/about-protected-branches\n[github-status-checks]: https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/about-protected-branches#require-status-checks-before-merging\n[circle-ci]: https://app.circleci.com/pipelines/github/gabrielweyer/cake-build\n[circle-ci-shield]: https://circleci.com/gh/gabrielweyer/cake-build/tree/main.svg?style=shield\n[dotnet-sdk]: https://dotnet.microsoft.com/download/dotnet/8.0\n[azure-devops-shield]: https://dev.azure.com/gabrielweyer/cake-build/_apis/build/status/Cake?branchName=main\n[azure-devops]: https://dev.azure.com/gabrielweyer/cake-build/_build/latest?definitionId=12\u0026branchName=main\n[cake-build-post]: https://gabrielweyer.net/2018/04/21/cake-build/\n[junit-xml-test-logger]: https://www.nuget.org/packages/JUnitXml.TestLogger/\n[github-actions]: https://github.com/gabrielweyer/cake-build/actions/workflows/build.yml\n[github-actions-shield]: https://github.com/gabrielweyer/cake-build/actions/workflows/build.yml/badge.svg\n[azure-devops-public-project-grant]: https://devblogs.microsoft.com/devops/change-in-azure-pipelines-grant-for-public-projects/\n[travis-ci-vulnerability]: https://arstechnica.com/information-technology/2021/09/travis-ci-flaw-exposed-secrets-for-thousands-of-open-source-projects/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielweyer%2Fcake-build","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgabrielweyer%2Fcake-build","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielweyer%2Fcake-build/lists"}