Skip to content

Commit 332a835

Browse files
committed
Merge remote-tracking branch 'origin/main' into ags_save_sessions
2 parents 6a10acd + b94abb2 commit 332a835

File tree

179 files changed

+4955
-2166
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+4955
-2166
lines changed

.azure/pipelines/build.yaml

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
trigger:
2+
branches:
3+
include:
4+
- main
5+
paths:
6+
include:
7+
- dotnet
8+
9+
schedules:
10+
- cron: "0 0 * * *"
11+
displayName: 'Daily midnight build (including CodeQL)'
12+
branches:
13+
include:
14+
- main
15+
always: true
16+
17+
parameters:
18+
- name: build_configuration
19+
displayName: Build configuration
20+
type: string
21+
default: Release
22+
values:
23+
- Release
24+
- Debug
25+
- name: include_suffix
26+
displayName: Append version suffix
27+
type: boolean
28+
default: true
29+
- name: version_suffix
30+
displayName: Version suffix
31+
type: string
32+
default: dev.$(Build.BuildNumber)
33+
- name: codesign
34+
displayName: Enable code signing
35+
type: boolean
36+
default: false
37+
- name: skip_test
38+
displayName: Skip tests
39+
type: boolean
40+
default: false
41+
- name: publish_nuget
42+
displayName: Publish to nuget.org
43+
type: boolean
44+
default: false
45+
- name: publish_nightly
46+
displayName: Publish to autogen-nightly
47+
type: boolean
48+
default: true
49+
- name: publish_artifacts
50+
displayName: Publish artifacts
51+
type: boolean
52+
default: false
53+
- name: runCodeQL3000
54+
default: false
55+
displayName: Run CodeQL3000 tasks
56+
type: boolean
57+
58+
variables:
59+
- template: templates/vars.yaml
60+
61+
resources:
62+
repositories:
63+
- repository: 1ESPipelineTemplates
64+
type: git
65+
name: 1ESPipelineTemplates/1ESPipelineTemplates
66+
ref: refs/tags/release
67+
68+
extends:
69+
${{ if eq(variables['System.TeamProject'], 'GitHub - PR Builds') }}:
70+
template: v1/1ES.Unofficial.PipelineTemplate.yml@1ESPipelineTemplates
71+
${{ else }}:
72+
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
73+
parameters:
74+
settings:
75+
skipBuildTagsForGitHubPullRequests: true
76+
pool:
77+
name: $(pool_name)
78+
image: $(pool_image)
79+
os: windows
80+
stages:
81+
- stage: build_test
82+
displayName: Build and Tests
83+
jobs:
84+
- template: /.azure/pipelines/templates/build.yaml@self
85+
parameters:
86+
build_configuration: ${{ parameters.build_configuration }}
87+
include_suffix: ${{ parameters.include_suffix }}
88+
version_suffix: ${{ parameters.version_suffix }}
89+
codesign: ${{ parameters.codesign }}
90+
skip_test: ${{ parameters.skip_test }}
91+
publish_nightly: ${{ parameters.publish_nightly }}
92+
publish_nuget: ${{ parameters.publish_nuget }}
93+
runCodeQL3000: ${{ parameters.runCodeQL3000 }}
94+
publish_artifacts: ${{ parameters.publish_artifacts }}

.azure/pipelines/templates/build.yaml

+228
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,228 @@
1+
parameters:
2+
- name: build_configuration
3+
displayName: Build configuration
4+
type: string
5+
default: Release
6+
values:
7+
- Release
8+
- Debug
9+
- name: include_suffix
10+
displayName: Append version suffix
11+
type: boolean
12+
default: true
13+
- name: version_suffix
14+
displayName: Version suffix
15+
type: string
16+
default: ci.$(Build.BuildNumber)
17+
- name: codesign
18+
displayName: Enable code signing
19+
type: boolean
20+
default: false
21+
- name: skip_test
22+
displayName: Skip tests
23+
type: boolean
24+
default: false
25+
- name: publish_nightly
26+
displayName: Publish to autogen-nightly
27+
type: boolean
28+
default: false
29+
- name: publish_nuget
30+
displayName: Publish to nuget.org
31+
type: boolean
32+
default: false
33+
- name: publish_artifacts
34+
displayName: Publish artifacts
35+
type: boolean
36+
default: false
37+
- name: runCodeQL3000
38+
default: false
39+
displayName: Run CodeQL3000 tasks
40+
type: boolean
41+
42+
jobs:
43+
44+
# Build, sign dlls, build nuget pkgs, then sign them
45+
- job: Build
46+
displayName: Build and create NuGet packages
47+
variables:
48+
publishVstsFeed: 'AGPublic/AutoGen-Nightly'
49+
${{ if eq(parameters.codesign, true) }}:
50+
esrp_signing: true
51+
${{ else }}:
52+
esrp_signing: false
53+
${{ if ne(variables['System.TeamProject'], 'GitHub - PR Builds') }}:
54+
templateContext:
55+
outputs:
56+
# Publish artifacts if enabled
57+
- ${{ if eq(parameters.publish_artifacts, true) }}: # TODO add eq(parameters.codesign, true)
58+
- output: pipelineArtifact
59+
targetPath: '$(build.sourcesdirectory)/dotnet/artifacts'
60+
artifactName: artifacts folder
61+
# Publish packages to nightly
62+
- ${{ if eq(parameters.publish_nightly, true) }}: # TODO add eq(parameters.codesign, true)
63+
- output: nuget
64+
useDotNetTask: false
65+
packageParentPath: $(Pipeline.Workspace)
66+
packagesToPush: $(build.sourcesdirectory)/dotnet/artifacts/**/*.nupkg;$(build.sourcesdirectory)/dotnet/artifacts/**/*.snupkg
67+
nuGetFeedType: internal
68+
publishVstsFeed: $(publishVstsFeed)
69+
allowPackageConflicts: true
70+
- ${{ if and(eq(parameters.codesign, true), eq(parameters.publish_nuget, true)) }}:
71+
- output: nuget
72+
condition: succeeded()
73+
useDotNetTask: false
74+
packageParentPath: $(Pipeline.Workspace)
75+
packagesToPush: $(build.sourcesdirectory)/dotnet/artifacts/**/*.nupkg;$(build.sourcesdirectory)/dotnet/artifacts/**/*.snupkg
76+
nuGetFeedType: external
77+
publishFeedCredentials: dotnet-orleans-nuget
78+
publishPackageMetadata: true
79+
allowPackageConflicts: true
80+
steps:
81+
- checkout: self
82+
- task: UseDotNet@2
83+
displayName: 'Use .NET Core sdk'
84+
inputs:
85+
useGlobalJson: true
86+
workingDirectory: $(Build.SourcesDirectory)/dotnet
87+
- task: Bash@3
88+
displayName: Install .NET Aspire workload
89+
inputs:
90+
targetType: 'inline'
91+
script: |
92+
dotnet nuget locals all --clear
93+
dotnet workload install aspire
94+
- ${{ if eq(variables.runCodeQL3000, 'true') }}:
95+
- task: CodeQL3000Init@0
96+
displayName: CodeQL Initialize
97+
# This task only tags a build if it actually does CodeQL3000 work.
98+
# Those tasks no-op while the analysis is considered up to date i.e. for runs w/in a few days of each other.
99+
- script: "echo ##vso[build.addbuildtag]CodeQL3000"
100+
displayName: 'Set CI CodeQL3000 tag'
101+
condition: ne(variables.CODEQL_DIST,'')
102+
- task: DotNetCoreCLI@2
103+
displayName: Build
104+
inputs:
105+
command: build
106+
arguments: '$(build_flags) /bl:${{parameters.build_configuration}}-Build.binlog /p:Configuration=${{parameters.build_configuration}} $(solution)'
107+
workingDirectory: $(Build.SourcesDirectory)/dotnet
108+
env:
109+
${{ if and(eq(parameters.include_suffix, true), eq(parameters.publish_nuget, false)) }}:
110+
VersionSuffix: ${{parameters.version_suffix}}
111+
OfficialBuild: $(official_build)
112+
113+
- ${{ if eq(variables.runCodeQL3000, 'true') }}:
114+
- task: CodeQL3000Finalize@0
115+
displayName: CodeQL Finalize
116+
# DLL code signing
117+
- ${{ if eq(variables.esrp_signing, true) }}:
118+
- task: UseDotNet@2
119+
displayName: 'Codesign: Use .NET Core'
120+
inputs:
121+
packageType: runtime
122+
version: $(codesign_runtime)
123+
- task: CopyFiles@2
124+
displayName: 'Codesign: Copy Files for signing'
125+
inputs:
126+
SourceFolder: '$(build.sourcesdirectory)'
127+
Contents: |
128+
src/**/bin/${{parameters.build_configuration}}/**/AutoGen*.dll
129+
src/**/bin/${{parameters.build_configuration}}/**/Microsoft.AutoGen.*.dll
130+
TargetFolder: '$(build.artifactstagingdirectory)\codesign'
131+
CleanTargetFolder: true
132+
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
133+
displayName: 'Codesign: ESRP CodeSigning'
134+
inputs:
135+
ConnectedServiceName: 'CodeSign Service (NuGet)'
136+
FolderPath: '$(build.artifactstagingdirectory)\codesign'
137+
Pattern: '*'
138+
signConfigType: inlineSignParams
139+
inlineOperation: |
140+
[
141+
{
142+
"keyCode": "CP-230012",
143+
"operationSetCode": "SigntoolSign",
144+
"parameters": [
145+
{
146+
"parameterName": "OpusName",
147+
"parameterValue": "Microsoft"
148+
},
149+
{
150+
"parameterName": "OpusInfo",
151+
"parameterValue": "http://www.microsoft.com"
152+
},
153+
{
154+
"parameterName": "FileDigest",
155+
"parameterValue": "/fd \"SHA256\""
156+
},
157+
{
158+
"parameterName": "PageHash",
159+
"parameterValue": "/NPH"
160+
},
161+
{
162+
"parameterName": "TimeStamp",
163+
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
164+
}
165+
],
166+
"toolName": "sign",
167+
"toolVersion": "1.0"
168+
},
169+
{
170+
"keyCode": "CP-230012",
171+
"operationSetCode": "SigntoolVerify",
172+
"parameters": [ ],
173+
"toolName": "sign",
174+
"toolVersion": "1.0"
175+
}
176+
]
177+
SessionTimeout: 180
178+
VerboseLogin: true
179+
- task: CopyFiles@2
180+
displayName: 'Codesign: Copy Signed Files Back'
181+
inputs:
182+
SourceFolder: '$(build.artifactstagingdirectory)\codesign'
183+
Contents: '**\*'
184+
TargetFolder: '$(build.sourcesdirectory)'
185+
OverWrite: true
186+
# End DLL code signing
187+
- task: CmdLine@2
188+
displayName: Pack
189+
inputs:
190+
script: 'dotnet pack --no-build --no-restore $(build_flags) /bl:${{parameters.build_configuration}}-Pack.binlog /p:Configuration=${{parameters.build_configuration}} $(solution)'
191+
workingDirectory: $(Build.SourcesDirectory)/dotnet
192+
env:
193+
${{ if and(eq(parameters.include_suffix, true), eq(parameters.publish_nuget, false)) }}:
194+
VersionSuffix: ${{parameters.version_suffix}}
195+
OfficialBuild: $(official_build)
196+
# NuGet code signing
197+
- ${{ if eq(variables.esrp_signing, true) }}:
198+
- task: UseDotNet@2
199+
displayName: 'Codesign: Use .NET Core'
200+
inputs:
201+
packageType: runtime
202+
version: $(codesign_runtime)
203+
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
204+
displayName: 'Codesign: ESRP CodeSigning (nuget)'
205+
inputs:
206+
ConnectedServiceName: 'CodeSign Service (NuGet)'
207+
FolderPath: '$(build.sourcesdirectory)/Artifacts/${{parameters.build_configuration}}'
208+
Pattern: '*.nupkg'
209+
signConfigType: inlineSignParams
210+
inlineOperation: |
211+
[
212+
{
213+
"keyCode": "CP-401405",
214+
"operationSetCode": "NuGetSign",
215+
"parameters": [],
216+
"toolName": "sign",
217+
"toolVersion": "1.0"
218+
},
219+
{
220+
"keyCode": "CP-401405",
221+
"operationSetCode": "NuGetVerify",
222+
"parameters": [ ],
223+
"toolName": "sign",
224+
"toolVersion": "1.0"
225+
}
226+
]
227+
SessionTimeout: 180
228+
VerboseLogin: true

.azure/pipelines/templates/vars.yaml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# It seems that variables must be defined in their own file when using templates
2+
3+
variables:
4+
build_flags: ' /m /v:m'
5+
solution: 'AutoGen.sln'
6+
codesign_runtime: '2.1.x'
7+
GDN_SUPPRESS_FORKED_BUILD_WARNING: true # Avoid warning "Guardian is not supported for builds from forked GitHub repositories"
8+
MicroBuildOutputFolderOverride: '$(Agent.TempDirectory)'
9+
# Auto-injection is not necessary because the tasks are explicitly included where they're enabled.
10+
Codeql.SkipTaskAutoInjection: true
11+
${{ if eq(variables['System.TeamProject'], 'GitHub - PR Builds') }}:
12+
pool_name: '1es-agpublish-pool'
13+
pool_image: 'agpublish-agent-image'
14+
official_build: false
15+
${{ else }}:
16+
${{ if eq(variables['System.TeamProject'], 'internal') }}:
17+
pool_name: '1es-agpublish-pool'
18+
pool_image: 'agpublish-agent-image'
19+
${{ else }}:
20+
pool_name: '1es-agpublish-pool'
21+
pool_image: 'agpublish-agent-image'
22+
official_build: true
23+
# Do not let CodeQL3000 Extension gate scan frequency.
24+
Codeql.Cadence: 0
25+
# Enable CodeQL3000 unconditionally so it may be run on any branch.
26+
Codeql.Enabled: true
27+
# Ignore test and infrastructure code.
28+
Codeql.SourceRoot: src
29+
# CodeQL3000 needs this plumbed along as a variable to enable TSA. Don't use TSA in manual builds.
30+
Codeql.TSAEnabled: ${{ eq(variables['Build.Reason'], 'Schedule') }}
31+
# Default expects tsaoptions.json under SourceRoot.
32+
Codeql.TSAOptionsPath: '$(Build.SourcesDirectory)/.config/tsaoptions.json'
33+
# Do not slow builds down w/ the CodeQL3000 tasks unless this is a nightly build or it's requested.
34+
runCodeQL3000: ${{ or(eq(variables['Build.Reason'], 'Schedule'), and(eq(variables['Build.Reason'], 'Manual'), eq(parameters.runCodeQL3000, 'true'))) }}

.github/workflows/checks.yml

+21
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,27 @@ jobs:
153153
poe --directory ${{ matrix.package }} docs-check
154154
working-directory: ./python
155155

156+
docs-example-check:
157+
runs-on: ubuntu-latest
158+
strategy:
159+
matrix:
160+
package: ["./packages/autogen-core"]
161+
steps:
162+
- uses: actions/checkout@v4
163+
- uses: astral-sh/setup-uv@v3
164+
with:
165+
enable-cache: true
166+
- uses: actions/setup-python@v5
167+
with:
168+
python-version: "3.11"
169+
- run: uv sync --locked --all-extras
170+
working-directory: ./python
171+
- name: Run task
172+
run: |
173+
source ${{ github.workspace }}/python/.venv/bin/activate
174+
poe --directory ${{ matrix.package }} docs-check-examples
175+
working-directory: ./python
176+
156177
check-proto-changes-python:
157178
runs-on: ubuntu-latest
158179
steps:

.github/workflows/docs.yml

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
{ ref: "v0.4.0.dev4", dest-dir: "0.4.0.dev4" },
4040
{ ref: "v0.4.0.dev5", dest-dir: "0.4.0.dev5" },
4141
{ ref: "v0.4.0.dev6", dest-dir: "0.4.0.dev6" },
42+
{ ref: "v0.4.0.dev7", dest-dir: "0.4.0.dev7" },
4243
]
4344
steps:
4445
- name: Checkout

0 commit comments

Comments
 (0)