Dagger
Search

dagger-pipelines

Provides composable pipeline steps for .NET projects: restore, build, test,
pack, and NuGet publish. Each function can be called individually or chained
together via the `ci` function for a complete pipeline run.

Installation

dagger install github.com/vpetkovic/dagger-pipelines@ae123d0a42796dfeabe612212557d10fb7dd50fe

Entrypoint

Return Type
DaggerPipelines
Example
dagger -m github.com/vpetkovic/dagger-pipelines@ae123d0a42796dfeabe612212557d10fb7dd50fe call \
func (m *MyModule) Example() *dagger.DaggerPipelines  {
	return dag.
			DaggerPipelines()
}
@function
def example() -> dagger.DaggerPipelines:
	return (
		dag.dagger_pipelines()
	)
@func()
example(): DaggerPipelines {
	return dag
		.daggerPipelines()
}

Types

DaggerPipelines 🔗

restore() 🔗

Base .NET SDK container with source mounted and restored

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-No description provided
solutionString !-No description provided
dotnetVersionString !"8.0"No description provided
Example
dagger -m github.com/vpetkovic/dagger-pipelines@ae123d0a42796dfeabe612212557d10fb7dd50fe call \
 restore --source DIR_PATH --solution string --dotnet-version string
func (m *MyModule) Example(source *dagger.Directory, solution string, dotnetVersion string) *dagger.Container  {
	return dag.
			DaggerPipelines().
			Restore(source, solution, dotnetVersion)
}
@function
def example(source: dagger.Directory, solution: str, dotnet_version: str) -> dagger.Container:
	return (
		dag.dagger_pipelines()
		.restore(source, solution, dotnet_version)
	)
@func()
example(source: Directory, solution: string, dotnetVersion: string): Container {
	return dag
		.daggerPipelines()
		.restore(source, solution, dotnetVersion)
}

build() 🔗

Build in Release configuration

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-No description provided
solutionString !-No description provided
dotnetVersionString !"8.0"No description provided
configurationString !"Release"No description provided
Example
dagger -m github.com/vpetkovic/dagger-pipelines@ae123d0a42796dfeabe612212557d10fb7dd50fe call \
 build --source DIR_PATH --solution string --dotnet-version string --configuration string
func (m *MyModule) Example(source *dagger.Directory, solution string, dotnetVersion string, configuration string) *dagger.Container  {
	return dag.
			DaggerPipelines().
			Build(source, solution, dotnetVersion, configuration)
}
@function
def example(source: dagger.Directory, solution: str, dotnet_version: str, configuration: str) -> dagger.Container:
	return (
		dag.dagger_pipelines()
		.build(source, solution, dotnet_version, configuration)
	)
@func()
example(source: Directory, solution: string, dotnetVersion: string, configuration: string): Container {
	return dag
		.daggerPipelines()
		.build(source, solution, dotnetVersion, configuration)
}

test() 🔗

Run tests for a specific test project or the full solution

Return Type
String !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-No description provided
solutionString !-No description provided
dotnetVersionString !"8.0"No description provided
configurationString !"Release"No description provided
testProjectString !""No description provided
Example
dagger -m github.com/vpetkovic/dagger-pipelines@ae123d0a42796dfeabe612212557d10fb7dd50fe call \
 test --source DIR_PATH --solution string --dotnet-version string --configuration string --test-project string
func (m *MyModule) Example(ctx context.Context, source *dagger.Directory, solution string, dotnetVersion string, configuration string, testProject string) string  {
	return dag.
			DaggerPipelines().
			Test(ctx, source, solution, dotnetVersion, configuration, testProject)
}
@function
async def example(source: dagger.Directory, solution: str, dotnet_version: str, configuration: str, test_project: str) -> str:
	return await (
		dag.dagger_pipelines()
		.test(source, solution, dotnet_version, configuration, test_project)
	)
@func()
async example(source: Directory, solution: string, dotnetVersion: string, configuration: string, testProject: string): Promise<string> {
	return dag
		.daggerPipelines()
		.test(source, solution, dotnetVersion, configuration, testProject)
}

pack() 🔗

Pack one or more projects into NuGet packages

Pass a single .csproj path or comma-separated list for multi-package solutions. Example: “src/Lib/Lib.csproj” or “src/A/A.csproj,src/B/B.csproj”

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-No description provided
solutionString !-No description provided
projectsString !-No description provided
versionString !"1.0.0"No description provided
dotnetVersionString !"8.0"No description provided
configurationString !"Release"No description provided
Example
dagger -m github.com/vpetkovic/dagger-pipelines@ae123d0a42796dfeabe612212557d10fb7dd50fe call \
 pack --source DIR_PATH --solution string --projects string --version string --dotnet-version string --configuration string
func (m *MyModule) Example(source *dagger.Directory, solution string, projects string, version string, dotnetVersion string, configuration string) *dagger.Container  {
	return dag.
			DaggerPipelines().
			Pack(source, solution, projects, version, dotnetVersion, configuration)
}
@function
def example(source: dagger.Directory, solution: str, projects: str, version: str, dotnet_version: str, configuration: str) -> dagger.Container:
	return (
		dag.dagger_pipelines()
		.pack(source, solution, projects, version, dotnet_version, configuration)
	)
@func()
example(source: Directory, solution: string, projects: string, version: string, dotnetVersion: string, configuration: string): Container {
	return dag
		.daggerPipelines()
		.pack(source, solution, projects, version, dotnetVersion, configuration)
}

publish() 🔗

Push all .nupkg files from /packages to NuGet.org

Return Type
String !
Arguments
NameTypeDefault ValueDescription
containerContainer !-No description provided
nugetApiKeySecret !-No description provided
nugetSourceString !"https://api.nuget.org/v3/index.json"No description provided
Example
dagger -m github.com/vpetkovic/dagger-pipelines@ae123d0a42796dfeabe612212557d10fb7dd50fe call \
 publish --container IMAGE:TAG --nuget-api-key env:MYSECRET --nuget-source string
func (m *MyModule) Example(ctx context.Context, container *dagger.Container, nugetApiKey *dagger.Secret, nugetSource string) string  {
	return dag.
			DaggerPipelines().
			Publish(ctx, container, nugetApiKey, nugetSource)
}
@function
async def example(container: dagger.Container, nuget_api_key: dagger.Secret, nuget_source: str) -> str:
	return await (
		dag.dagger_pipelines()
		.publish(container, nuget_api_key, nuget_source)
	)
@func()
async example(container: Container, nugetApiKey: Secret, nugetSource: string): Promise<string> {
	return dag
		.daggerPipelines()
		.publish(container, nugetApiKey, nugetSource)
}

ci() 🔗

Full CI pipeline: restore → build → test → pack

Returns the container with .nupkg files in /packages ready for publish.

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-No description provided
solutionString !-No description provided
projectsString !-No description provided
versionString !"1.0.0"No description provided
dotnetVersionString !"8.0"No description provided
configurationString !"Release"No description provided
testProjectString !""No description provided
Example
dagger -m github.com/vpetkovic/dagger-pipelines@ae123d0a42796dfeabe612212557d10fb7dd50fe call \
 ci --source DIR_PATH --solution string --projects string --version string --dotnet-version string --configuration string --test-project string
func (m *MyModule) Example(source *dagger.Directory, solution string, projects string, version string, dotnetVersion string, configuration string, testProject string) *dagger.Container  {
	return dag.
			DaggerPipelines().
			Ci(source, solution, projects, version, dotnetVersion, configuration, testProject)
}
@function
def example(source: dagger.Directory, solution: str, projects: str, version: str, dotnet_version: str, configuration: str, test_project: str) -> dagger.Container:
	return (
		dag.dagger_pipelines()
		.ci(source, solution, projects, version, dotnet_version, configuration, test_project)
	)
@func()
example(source: Directory, solution: string, projects: string, version: string, dotnetVersion: string, configuration: string, testProject: string): Container {
	return dag
		.daggerPipelines()
		.ci(source, solution, projects, version, dotnetVersion, configuration, testProject)
}

release() 🔗

Full release pipeline: ci (build → test → pack) → publish to NuGet

CLI-friendly function that combines ci + publish in one call. Use this from GitHub Actions or local CLI when you want to build, test, pack, and push to NuGet in a single command.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-No description provided
solutionString !-No description provided
projectsString !-No description provided
nugetApiKeySecret !-No description provided
versionString !"1.0.0"No description provided
dotnetVersionString !"8.0"No description provided
configurationString !"Release"No description provided
testProjectString !""No description provided
nugetSourceString !"https://api.nuget.org/v3/index.json"No description provided
Example
dagger -m github.com/vpetkovic/dagger-pipelines@ae123d0a42796dfeabe612212557d10fb7dd50fe call \
 release --source DIR_PATH --solution string --projects string --nuget-api-key env:MYSECRET --version string --dotnet-version string --configuration string --test-project string --nuget-source string
func (m *MyModule) Example(ctx context.Context, source *dagger.Directory, solution string, projects string, nugetApiKey *dagger.Secret, version string, dotnetVersion string, configuration string, testProject string, nugetSource string) string  {
	return dag.
			DaggerPipelines().
			Release(ctx, source, solution, projects, nugetApiKey, version, dotnetVersion, configuration, testProject, nugetSource)
}
@function
async def example(source: dagger.Directory, solution: str, projects: str, nuget_api_key: dagger.Secret, version: str, dotnet_version: str, configuration: str, test_project: str, nuget_source: str) -> str:
	return await (
		dag.dagger_pipelines()
		.release(source, solution, projects, nuget_api_key, version, dotnet_version, configuration, test_project, nuget_source)
	)
@func()
async example(source: Directory, solution: string, projects: string, nugetApiKey: Secret, version: string, dotnetVersion: string, configuration: string, testProject: string, nugetSource: string): Promise<string> {
	return dag
		.daggerPipelines()
		.release(source, solution, projects, nugetApiKey, version, dotnetVersion, configuration, testProject, nugetSource)
}

testRestore() 🔗

Verify NuGet restore succeeds against the test fixture

Return Type
String !
Example
dagger -m github.com/vpetkovic/dagger-pipelines@ae123d0a42796dfeabe612212557d10fb7dd50fe call \
 test-restore
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			DaggerPipelines().
			TestRestore(ctx)
}
@function
async def example() -> str:
	return await (
		dag.dagger_pipelines()
		.test_restore()
	)
@func()
async example(): Promise<string> {
	return dag
		.daggerPipelines()
		.testRestore()
}

testBuild() 🔗

Verify build succeeds against the test fixture

Return Type
String !
Example
dagger -m github.com/vpetkovic/dagger-pipelines@ae123d0a42796dfeabe612212557d10fb7dd50fe call \
 test-build
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			DaggerPipelines().
			TestBuild(ctx)
}
@function
async def example() -> str:
	return await (
		dag.dagger_pipelines()
		.test_build()
	)
@func()
async example(): Promise<string> {
	return dag
		.daggerPipelines()
		.testBuild()
}

testTest() 🔗

Verify tests pass against the test fixture

Return Type
String !
Example
dagger -m github.com/vpetkovic/dagger-pipelines@ae123d0a42796dfeabe612212557d10fb7dd50fe call \
 test-test
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			DaggerPipelines().
			TestTest(ctx)
}
@function
async def example() -> str:
	return await (
		dag.dagger_pipelines()
		.test_test()
	)
@func()
async example(): Promise<string> {
	return dag
		.daggerPipelines()
		.testTest()
}

testPack() 🔗

Verify pack produces .nupkg files in /packages

Return Type
String !
Example
dagger -m github.com/vpetkovic/dagger-pipelines@ae123d0a42796dfeabe612212557d10fb7dd50fe call \
 test-pack
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			DaggerPipelines().
			TestPack(ctx)
}
@function
async def example() -> str:
	return await (
		dag.dagger_pipelines()
		.test_pack()
	)
@func()
async example(): Promise<string> {
	return dag
		.daggerPipelines()
		.testPack()
}

testCi() 🔗

Verify the full CI pipeline (restore → build → test → pack) end-to-end

Return Type
String !
Example
dagger -m github.com/vpetkovic/dagger-pipelines@ae123d0a42796dfeabe612212557d10fb7dd50fe call \
 test-ci
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			DaggerPipelines().
			TestCi(ctx)
}
@function
async def example() -> str:
	return await (
		dag.dagger_pipelines()
		.test_ci()
	)
@func()
async example(): Promise<string> {
	return dag
		.daggerPipelines()
		.testCi()
}