Skip to content

Commit 492af2b

Browse files
gavinbarronCopilot
andauthored
ci: publish Graph core NuGet packages through ESRP (#1092)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 30294714-1b26-4b8b-bff8-a52b233a5709
1 parent cfea2e5 commit 492af2b

2 files changed

Lines changed: 38 additions & 12 deletions

File tree

‎CONTRIBUTING.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ All pull requests should be submitted against the **main** branch or a specific
1313

1414
Some things to note about this project:
1515

16+
## Publishing NuGet packages
17+
18+
The release pipeline in `pipelines/productionBuild.yml` builds and signs `Microsoft.Graph.Core`.
19+
Publishing runs only for tags after approval through the `nuget-org` environment. It stages only
20+
the package and symbol files for an ESRP submission using `NuGetOrganizationName`, then waits for
21+
release completion before updating the GitHub release assets. The NuGet publishing identity
22+
[`microsoftgraph`](https://www.nuget.org/profiles/microsoftgraph) is an owner listed on the
23+
[package page](https://www.nuget.org/packages/Microsoft.Graph.Core); do not derive it from the
24+
GitHub organization or package authors.
25+
1626
## Commit message format
1727
To support our automated release process, pull requests are required to follow the [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/)
1828
format.

‎pipelines/productionBuild.yml‎

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pr: none
1313
variables:
1414
PACKAGE_NAME: 'microsoft.graph.core'
1515
PROJECT_PATH: '.\src\Microsoft.Graph.Core\Microsoft.Graph.Core.csproj'
16+
NuGetOrganizationName: 'microsoftgraph'
1617
resources:
1718
repositories:
1819
- repository: 1ESPipelineTemplates
@@ -253,11 +254,6 @@ extends:
253254
runOnce:
254255
deploy:
255256
steps:
256-
- task: NuGetToolInstaller@1
257-
displayName: 'Use NuGet >=5.2.0'
258-
inputs:
259-
versionSpec: '>=5.2.0'
260-
checkLatest: true
261257
- task: PowerShell@2
262258
displayName: 'Get Latest Commit SHA from repo'
263259
inputs:
@@ -272,14 +268,34 @@ extends:
272268
filePath: $(Pipeline.Workspace)\scripts\GetNugetPackageVersion.ps1
273269
pwsh: true
274270
arguments: '-packageDirPath "$(Pipeline.Workspace)/"'
275-
- task: 1ES.PublishNuget@1
276-
displayName: 'Push release to NuGet.org'
271+
- task: CopyFiles@2
272+
displayName: 'Stage NuGet packages for ESRP release'
273+
inputs:
274+
SourceFolder: '$(Pipeline.Workspace)'
275+
Contents: |
276+
Microsoft.Graph.Core.*.nupkg
277+
Microsoft.Graph.Core.*.snupkg
278+
TargetFolder: '$(Pipeline.Workspace)\nuget-packages\$(NuGetOrganizationName)'
279+
- task: EsrpRelease@14
280+
displayName: 'ESRP Release - NuGet'
277281
inputs:
278-
command: push
279-
packageParentPath: '$(Pipeline.Workspace)'
280-
packagesToPush: '$(Pipeline.Workspace)\Microsoft.Graph.Core.*.nupkg'
281-
nuGetFeedType: external
282-
publishFeedCredentials: 'microsoftgraph NuGet connection'
282+
connectedservicename: 'Federated DevX ESRP Managed Identity Connection'
283+
usemanagedidentity: false
284+
keyvaultname: 'akv-prod-eastus'
285+
authcertname: 'ReferenceLibraryPrivateCert'
286+
signcertname: 'ReferencePackagePublisherCertificate'
287+
clientid: '65035b7f-7357-4f29-bf25-c5ee5c3949f8'
288+
intent: 'packagedistribution'
289+
contenttype: 'NuGet'
290+
organizationname: '$(NuGetOrganizationName)'
291+
contentsource: 'Folder'
292+
folderlocation: '$(Pipeline.Workspace)\nuget-packages\$(NuGetOrganizationName)'
293+
waitforreleasecompletion: true
294+
owners: 'christiano@microsoft.com,ramsess@microsoft.com,gavinbarron@microsoft.com,jingjingjia@microsoft.com,peombwa@microsoft.com,treicys@microsoft.com'
295+
approvers: 'christiano@microsoft.com,ramsess@microsoft.com,gavinbarron@microsoft.com,jingjingjia@microsoft.com,peombwa@microsoft.com,treicys@microsoft.com'
296+
serviceendpointurl: 'https://api.esrp.microsoft.com/'
297+
mainpublisher: 'ESRPRELPACMAN'
298+
domaintenantid: 'cdc5aeea-15c5-4db6-b079-fcadd2505dc2'
283299
- task: GitHubRelease@1
284300
displayName: 'GitHub release (create)'
285301
inputs:

0 commit comments

Comments
 (0)