GiantCroissant.Lunar.Build.NuGet
0.1.1-ci.90
dotnet add package GiantCroissant.Lunar.Build.NuGet --version 0.1.1-ci.90
NuGet\Install-Package GiantCroissant.Lunar.Build.NuGet -Version 0.1.1-ci.90
<PackageReference Include="GiantCroissant.Lunar.Build.NuGet" Version="0.1.1-ci.90" />
<PackageVersion Include="GiantCroissant.Lunar.Build.NuGet" Version="0.1.1-ci.90" />
<PackageReference Include="GiantCroissant.Lunar.Build.NuGet" />
paket add GiantCroissant.Lunar.Build.NuGet --version 0.1.1-ci.90
#r "nuget: GiantCroissant.Lunar.Build.NuGet, 0.1.1-ci.90"
#:package GiantCroissant.Lunar.Build.NuGet@0.1.1-ci.90
#addin nuget:?package=GiantCroissant.Lunar.Build.NuGet&version=0.1.1-ci.90&prerelease
#tool nuget:?package=GiantCroissant.Lunar.Build.NuGet&version=0.1.1-ci.90&prerelease
NuGet Build Components
Streamlined NuGet build automation for the Lunar Build system. This module exposes small, reusable component APIs and thin orchestration workflows you can call from NUKE targets.
What You Get (Current)
INuGetPackager
— Engines forPackComponents
andPackMeta
using NUKEDotNetPack
.IMetaPackWorkflow
— Orchestrates meta packaging (sync built packages → restore meta with packageSourceMapping → pin dependency versions to GitVersion → build/pack meta).IComponentPackWorkflow
— Orchestrates component pre-build (analyzers off) and packing.INuGetPublisher
— Push packages (and symbols) with skip-duplicate and API key support.ILocalFeedSync
— Copy built.nupkg
to one or more local repositories in flat/hierarchical/both layouts.IArtifactLayout
— Compute artifact directory layout (packages, reports, logs) under_artifacts/{version}
.
Quick Start
Call the workflows from thin NUKE targets.
using Lunar.Build.NuGet.Api;
using Nuke.Common;
using Nuke.Common.IO;
partial class Build
{
const string DisableGitVersionProp = "DisableGitVersion";
Target Pack => _ => _
.Executes(() =>
{
// Discover component projects and compute output dir (not shown here)
var projects = /* glob your component csproj files */ Array.Empty<AbsolutePath>();
var output = /* e.g. build/_artifacts/{GitVersion}/nuget-packages */ RootDirectory / "build/_artifacts/local/nuget-packages";
var useLocalNfun = (Environment.GetEnvironmentVariable("UseLocalNfunProjectReferences") ?? "")
.Equals("true", StringComparison.OrdinalIgnoreCase);
var disableGitVersion = Environment.GetEnvironmentVariable(DisableGitVersionProp);
var version = GitVersion?.SemVer;
var props = new Dictionary<string, string>
{
["RunAnalyzersDuringBuild"] = "false",
["RunAnalyzersDuringCompilation"] = "false",
["EnableNETAnalyzers"] = "false",
["EnforceCodeStyleInBuild"] = "false",
["TreatWarningsAsErrors"] = "false",
["ContinuousIntegrationBuild"] = "true",
["UpdateVersionProperties"] = "false",
[useLocalNfun ? "UseLocalNfunProjectReferences" : "ForceNfunPackageReferences"] = "true"
};
var env = new Dictionary<string, string>();
if (!string.IsNullOrWhiteSpace(disableGitVersion)) env[DisableGitVersionProp] = disableGitVersion!;
var workflow = new ComponentPackWorkflow();
workflow.Execute(new ComponentPackRequest
{
Projects = projects,
DisableAnalyzers = true,
BuildProperties = props,
EnvironmentVariables = env,
PackConfig = new PackConfig
{
Configuration = "Release",
OutputDirectory = output,
NoRestore = true,
NoBuild = true,
ContinuousIntegrationBuild = true,
DisableAnalyzers = true,
Version = version,
PackageVersion = version,
AdditionalProperties = props,
EnvironmentVariables = env
}
});
});
}
Pack meta with pinned dependency versions to the current GitVersion and restore from the synced local feed:
using Lunar.Build.NuGet.Api;
partial class Build
{
Target PackMeta => _ => _
.DependsOn(Pack) // ensure components built
.Executes(() =>
{
var metaProject = RootDirectory / "build/nuke/Lunar.Build.csproj";
var builtPackages = RootDirectory / "build/_artifacts/{GitVersion}/nuget-packages"; // resolve as needed
var localRepo = RootDirectory / "packages/nuget-repo"; // workspace feed
var version = GitVersion?.SemVer;
var workflow = new MetaPackWorkflow();
workflow.Execute(new MetaPackRequest
{
MetaProjectFile = metaProject,
BuildPackagesDirectory = builtPackages,
LocalRepositoryDirectory = localRepo,
Configuration = "Release",
Version = version,
DisableAnalyzers = true,
EnvironmentVariables = new Dictionary<string, string>
{
["DisableGitVersion"] = "1"
}
});
});
}
Configuration
- nuget.outputDirectory: where
DotNetPack
writes.nupkg
(typicallybuild/_artifacts/{GitVersion}/nuget-packages
). - nuget.localNugetRepositories (array): local repositories to sync to. The workspace feed
packages/nuget-repo/
is always included to support meta restore. - nuget.syncLayout:
hierarchical | flat | both
for local repo sync topology. - UseLocalNfunProjectReferences:
true
to opt into local project references for Nfun adapter during dev. - ForceNfunPackageReferences:
true
to force package consumption mode even when sibling repos exist locally (keeps CI/local parity). - DisableGitVersion: set to
1
to disable GitVersion during local test runs.
Meta pinning and local feed (per docs/guides/nuget-local-feed-and-meta-pinning.md):
- Meta’s
PackageReference
versions are pinned to$(MetaDependenciesVersion)
, which we set toGitVersion.SemVer
during PackMeta. - We sync freshly built component packages to the workspace local feed
packages/nuget-repo/
and restore meta using a generatednuget.config
with packageSourceMapping soGiantCroissant.*
andLunar.*
resolve from the local feed. NoRestore=true
is used for the meta build/pack phases to avoid re-evaluating sources.
This preserves CI determinism while allowing local dry-runs without CI minutes.
Troubleshooting
- NU1100 / cannot resolve GiantCroissant.*: Ensure the local feed
packages/nuget-repo/
contains the just-built component packages. The meta workflow copies any missing.nupkg
from the build output before restore. - NU1010 (PackageReference has no matching central version): In local CI-like runs we force package mode for the adapter and provide
VersionOverride
metadata to bind a concrete version when CPVM discovery is flaky. - PackageSourceMapping excludes .nuget\packages: The generated
nuget.config
explicitly mapsGiantCroissant.*
/Lunar.*
to the workspacelocal-packages
source, preventing fallbacks.
Legacy (Kept for Reference Only)
The previous service-oriented implementation (services, options, validators, DI extensions, etc.) remains in this folder but is excluded from compilation and packaging. This preserves history and reference material without increasing package surface area.
- Excluded folders:
Services
,Options
,DependencyInjection
,Interfaces
(exceptINuGetRepositoryComponent
),Components
(compiled onlyINuGetLocalRepoSyncComponent
),Common
,NugetPackage
,Validation
,PreBuild
,PostBuild
,_Generated
. IWorkspaceNuGetComponent
is deprecated; still compiled for backward compatibility. PreferINuGetRepositoryComponent
.
If you still need the old behavior, consider copying the relevant code into your build as internal utilities rather than re-enabling it in this package.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- GiantCroissant.Lunar.Build.Configuration (>= 0.1.1-ci.90)
- NuGet.Packaging (>= 6.14.0)
- NuGet.Versioning (>= 6.14.0)
- Nuke.Common (>= 9.0.4)
- Serilog (>= 4.3.0)
- System.Text.Json (>= 9.0.7)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on GiantCroissant.Lunar.Build.NuGet:
Package | Downloads |
---|---|
GiantCroissant.Lunar.Build
Meta-package that depends on the Lunar Build component packages for one-line install. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
0.1.1-ci.90 | 115 | 9/8/2025 |
0.1.1-ci.40 | 95 | 9/6/2025 |
0.1.1-ci.21 | 143 | 9/4/2025 |
0.1.1-ci.20 | 134 | 9/3/2025 |
0.1.1-chore-ci-pack-mobile-... | 27 | 9/4/2025 |
NuGet packaging components with repository management and publishing workflows for Nuke build system.