Skip to content

A programming framework for agentic AI

.NET add document on packaging && disable uploading artifacts folder to pipeline by default (#4299)

Xiaoyun Zhang415d049822f6
diff --git a/.azure/pipelines/build.yaml b/.azure/pipelines/build.yaml
index 6f21e59b0..7ce3f0c1e 100644
--- a/.azure/pipelines/build.yaml
+++ b/.azure/pipelines/build.yaml
@@ -3,8 +3,8 @@ trigger:
include:
- main
paths:
- exclude:
- - samples
+ include:
+ - dotnet
schedules:
- cron: "0 0 * * *"
@@ -12,7 +12,6 @@ schedules:
branches:
include:
- main
- - 3.x
always: true
parameters:
@@ -46,6 +45,10 @@ parameters:
- name: publish_nightly
displayName: Publish to autogen-nightly
type: boolean
+ default: true
+ - name: publish_artifacts
+ displayName: Publish artifacts
+ type: boolean
default: false
- name: runCodeQL3000
default: false
@@ -87,4 +90,5 @@ extends:
skip_test: ${{ parameters.skip_test }}
publish_nightly: ${{ parameters.publish_nightly }}
publish_nuget: ${{ parameters.publish_nuget }}
- runCodeQL3000: ${{ parameters.runCodeQL3000 }}
\ No newline at end of file
+ runCodeQL3000: ${{ parameters.runCodeQL3000 }}
+ publish_artifacts: ${{ parameters.publish_artifacts }}
\ No newline at end of file
diff --git a/.azure/pipelines/templates/build.yaml b/.azure/pipelines/templates/build.yaml
index 7e3d82f4d..0b7dbe990 100644
--- a/.azure/pipelines/templates/build.yaml
+++ b/.azure/pipelines/templates/build.yaml
@@ -30,6 +30,10 @@ parameters:
displayName: Publish to nuget.org
type: boolean
default: false
+ - name: publish_artifacts
+ displayName: Publish artifacts
+ type: boolean
+ default: false
- name: runCodeQL3000
default: false
displayName: Run CodeQL3000 tasks
@@ -49,9 +53,11 @@ jobs:
${{ if ne(variables['System.TeamProject'], 'GitHub - PR Builds') }}:
templateContext:
outputs:
- - output: pipelineArtifact
- targetPath: '$(build.sourcesdirectory)/dotnet/artifacts'
- artifactName: artifacts folder
+ # Publish artifacts if enabled
+ - ${{ if eq(parameters.publish_artifacts, true) }}: # TODO add eq(parameters.codesign, true)
+ - output: pipelineArtifact
+ targetPath: '$(build.sourcesdirectory)/dotnet/artifacts'
+ artifactName: artifacts folder
# Publish packages to nightly
- ${{ if eq(parameters.publish_nightly, true) }}: # TODO add eq(parameters.codesign, true)
- output: nuget
diff --git a/dotnet/PACKAGING.md b/dotnet/PACKAGING.md
new file mode 100644
index 000000000..af03850f7
--- /dev/null
+++ b/dotnet/PACKAGING.md
@@ -0,0 +1,41 @@
+# Packaging AutoGen.NET
+
+This document describes the steps to pack the `AutoGen.NET` project.
+
+## Prerequisites
+
+- .NET SDK
+
+## Create Package
+
+1. **Restore and Build the Project**
+```bash
+dotnet restore
+dotnet build --configuration Release --no-restore
+```
+
+
+2. **Create the NuGet Package**
+```bash
+dotnet pack --configuration Release --no-build
+```
+
+This will generate both the `.nupkg` file and the `.snupkg` file in the `./artifacts/package/release` directory.
+
+For more details, refer to the [official .NET documentation](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-pack).
+
+## Add new project to package list.
+By default, when you add a new project to `AutoGen.sln`, it will not be included in the package list. To include the new project in the package, you need to add the following line to the new project's `.csproj` file
+
+e.g.
+
+```xml
+<Import Project="$(RepoRoot)/nuget/nuget-package.props" />
+```
+
+The `nuget-packages.props` enables `IsPackable` to `true` for the project, it also sets nenecessary metadata for the package.
+
+For more details, refer to the [NuGet folder](./nuget/README.md).
+
+## Package versioning
+The version of the package is defined by `VersionPrefix` and `VersionPrefixForAutoGen0_2` in [MetaInfo.props](./eng/MetaInfo.props). If the name of your project starts with `AutoGen.`, the version will be set to `VersionPrefixForAutoGen0_2`, otherwise it will be set to `VersionPrefix`.
diff --git a/dotnet/nuget/README.md b/dotnet/nuget/README.md
new file mode 100644
index 000000000..c95a97624
--- /dev/null
+++ b/dotnet/nuget/README.md
@@ -0,0 +1,13 @@
+# NuGet Directory
+
+This directory contains resources and metadata for packaging the AutoGen.NET SDK as a NuGet package.
+
+## Files
+
+- **icon.png**: The icon used for the NuGet package.
+- **NUGET.md**: The readme file displayed on the NuGet package page.
+- **NUGET-PACKAGE.PROPS**: The MSBuild properties file that defines the packaging settings for the NuGet package.
+
+## Purpose
+
+The files in this directory are used to configure and build the NuGet package for the AutoGen.NET SDK, ensuring that it includes necessary metadata, documentation, and resources.
\ No newline at end of file