Skip to content

Commit 47b420d

Browse files
authored
AzDo Private Preview Pipeline (#1435)
* Add ci-build * Set up CI with Azure Pipelines [skip ci] * Install required tools. * Temorarily skip tests. * Remove broken API. * Enable all modules. * Increate timeout. * Move CI build to a job. * Rename ReplyAll commands. * Exclude modules with broken APIs. * Fix groups module. * Remove Financials directive. * Use templates. * Opt-in to test. * Enable signing. * Enable test modules. * Update folder path. * Enable signing. * Set signing option for templates. * Publish module to artifact directory. * Publish to drop container on pack and sign. * Enable all succeeding modules. * Publish to feed. * Enable packing of meta-module. * Enable meta-module preview version. * Set meta-module preview version. * Enable auth module preview version. * Read module version from metamodule config. * Generate prerelease workload modules. * Lock meta-module version.
1 parent 628d8fc commit 47b420d

35 files changed

Lines changed: 1164 additions & 229 deletions

.azure-pipelines/ci-build.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
name: $(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
4+
parameters:
5+
- name: BuildAgent
6+
default: 1es-windows-ps-compute
7+
displayName: Build Agent
8+
- name: Test
9+
type: boolean
10+
default: true
11+
- name: Pack
12+
type: boolean
13+
default: true
14+
- name: Sign
15+
type: boolean
16+
default: true
17+
18+
variables:
19+
BuildAgent: ${{ parameters.BuildAgent }}
20+
GitUserEmail: 'GraphTooling@service.microsoft.com'
21+
GitUserName: 'Microsoft Graph DevX Tooling'
22+
23+
pool: $(BuildAgent)
24+
25+
trigger:
26+
branches:
27+
include:
28+
- main
29+
- features/2.0
30+
pr: none
31+
32+
jobs:
33+
- job: MsGraphPsSdkCiBuild
34+
displayName: Microsoft Graph PowerShell SDK CI Build
35+
timeoutInMinutes: 840
36+
steps:
37+
- template: ./common-templates/install-tools.yml
38+
- template: ./common-templates/security-pre-checks.yml
39+
40+
- template: ./generation-templates/authentication-module.yml
41+
parameters:
42+
Test: ${{ parameters.Test }}
43+
Pack: ${{ parameters.Pack }}
44+
Sign: ${{ parameters.Sign }}
45+
46+
- template: ./generation-templates/workload-modules.yml
47+
parameters:
48+
Test: ${{ parameters.Test }}
49+
Pack: ${{ parameters.Pack }}
50+
Sign: ${{ parameters.Sign }}
51+
52+
- template: ./generation-templates/meta-module.yml
53+
parameters:
54+
Test: ${{ parameters.Test }}
55+
Pack: ${{ parameters.Pack }}
56+
Sign: ${{ parameters.Sign }}
57+
58+
- ${{ if and(eq(parameters.Pack, true), eq(parameters.Sign, true)) }}:
59+
- template: ./common-templates/esrp/codesign-nuget.yml
60+
parameters:
61+
FolderPath: '$(Build.ArtifactStagingDirectory)'
62+
Pattern: 'Microsoft.Graph*.nupkg'
63+
64+
- task: PublishBuildArtifacts@1
65+
displayName: Publish Module Artifacts
66+
inputs:
67+
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
68+
ArtifactName: 'drop'
69+
publishLocation: 'Container'
70+
71+
- task: NuGetCommand@2
72+
displayName: Publish NuGet to preview feed
73+
inputs:
74+
command: push
75+
packagesToPush: $(Build.ArtifactStagingDirectory)/**/Microsoft.Graph.*.nupkg
76+
publishVstsFeed: $(PROJECT_NAME)/$(PREVIEW_FEED_NAME)
77+
allowPackageConflicts: true
78+
79+
- template: ./common-templates/security-post-checks.yml
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
4+
parameters:
5+
- name: FolderPath
6+
type: string
7+
default: $(System.DefaultWorkingDirectory)
8+
- name: Pattern
9+
type: string
10+
default: '*.nupkg'
11+
12+
steps:
13+
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
14+
displayName: ESRP NuGet CodeSigning
15+
enabled: true
16+
inputs:
17+
ConnectedServiceName: microsoftgraph ESRP CodeSign DLL and NuGet (AKV)
18+
FolderPath: ${{ parameters.FolderPath }}
19+
Pattern: ${{ parameters.Pattern }}
20+
signConfigType: inlineSignParams
21+
inlineOperation: |
22+
[
23+
{
24+
"keyCode": "CP-401405",
25+
"operationSetCode": "NuGetSign",
26+
"parameters": [ ],
27+
"toolName": "sign",
28+
"toolVersion": "1.0"
29+
},
30+
{
31+
"keyCode": "CP-401405",
32+
"operationSetCode": "NuGetVerify",
33+
"parameters": [ ],
34+
"toolName": "sign",
35+
"toolVersion": "1.0"
36+
}
37+
]
38+
SessionTimeout: 20
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
4+
parameters:
5+
- name: FolderPath
6+
type: string
7+
default: $(System.DefaultWorkingDirectory)
8+
- name: Pattern
9+
type: string
10+
default: '.*.dll'
11+
12+
steps:
13+
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
14+
displayName: ESRP DLL CodeSigning
15+
enabled: true
16+
inputs:
17+
ConnectedServiceName: microsoftgraph ESRP CodeSign DLL and NuGet (AKV)
18+
FolderPath: ${{ parameters.FolderPath }}
19+
Pattern: ${{ parameters.Pattern }}
20+
signConfigType: inlineSignParams
21+
inlineOperation: |
22+
[
23+
{
24+
"keyCode": "CP-230012",
25+
"operationSetCode": "SigntoolSign",
26+
"parameters": [
27+
{
28+
"parameterName": "OpusName",
29+
"parameterValue": "Microsoft"
30+
},
31+
{
32+
"parameterName": "OpusInfo",
33+
"parameterValue": "http://www.microsoft.com"
34+
},
35+
{
36+
"parameterName": "FileDigest",
37+
"parameterValue": "/fd \"SHA256\""
38+
},
39+
{
40+
"parameterName": "PageHash",
41+
"parameterValue": "/NPH"
42+
},
43+
{
44+
"parameterName": "TimeStamp",
45+
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
46+
}
47+
],
48+
"toolName": "sign",
49+
"toolVersion": "1.0"
50+
},
51+
{
52+
"keyCode": "CP-230012",
53+
"operationSetCode": "SigntoolVerify",
54+
"parameters": [],
55+
"toolName": "sign",
56+
"toolVersion": "1.0"
57+
}
58+
]
59+
SessionTimeout: 160
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
4+
parameters:
5+
- name: FolderPath
6+
type: string
7+
default: $(System.DefaultWorkingDirectory)
8+
- name: Pattern
9+
type: string
10+
default: '.*.dll'
11+
12+
steps:
13+
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
14+
displayName: ESRP DLL Strong Name
15+
enabled: true
16+
inputs:
17+
ConnectedServiceName: microsoftgraph ESRP CodeSign DLL and NuGet (AKV)
18+
FolderPath: ${{ parameters.FolderPath }}
19+
Pattern: ${{ parameters.Pattern }}
20+
signConfigType: inlineSignParams
21+
inlineOperation: |
22+
[
23+
{
24+
"keyCode": "CP-233863-SN",
25+
"operationSetCode": "StrongNameSign",
26+
"parameters": [],
27+
"toolName": "sign",
28+
"toolVersion": "1.0"
29+
},
30+
{
31+
"keyCode": "CP-233863-SN",
32+
"operationSetCode": "StrongNameVerify",
33+
"parameters": [],
34+
"toolName": "sign",
35+
"toolVersion": "1.0"
36+
}
37+
]
38+
SessionTimeout: 20

.azure-pipelines/common-templates/install-tools-template.yml

Lines changed: 12 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,66 +3,42 @@
33

44
steps:
55
- task: UseDotNet@2
6-
displayName: 'Use .NET Core SDK 2 LTS'
7-
inputs:
8-
debugMode: false
9-
version: 2.x
10-
11-
- task: UseDotNet@2
12-
displayName: 'Use .NET Core SDK 3 LTS'
13-
inputs:
14-
debugMode: false
15-
version: 3.x
16-
17-
- task: UseDotNet@2
18-
displayName: 'Use .NET Core SDK 6 Current'
6+
displayName: Use .NET SDK
197
inputs:
208
debugMode: false
219
version: 6.x
2210

2311
- task: NuGetToolInstaller@1
24-
displayName: 'Install Nuget 5.7'
25-
inputs:
26-
versionSpec: 5.7.0
27-
checkLatest: false # Optional
12+
displayName: Install Nuget
2813

2914
- task: NuGetAuthenticate@0
3015

31-
3216
- task: PowerShell@2
33-
displayName: 'Version Check'
17+
displayName: Version Check
3418
inputs:
3519
targetType: inline
3620
pwsh: true
3721
script: |
38-
Write-Host $PSVersionTable.PSVersion
39-
Write-Host $host.Version
40-
Write-Host (Get-Host).Version
22+
Write-Output $PSVersionTable
4123
4224
- task: NodeTool@0
43-
displayName: 'Install NodeJs'
44-
inputs:
45-
versionSpec: '14.18.2'
46-
checkLatest: true # Optional
47-
48-
- task: Npm@1
49-
displayName: 'Install AutoRest'
25+
displayName: Install NodeJs
5026
inputs:
51-
command: 'custom'
52-
customCommand: 'install -g autorest@latest'
27+
versionSpec: 16.x
5328

5429
- task: Npm@1
55-
displayName: 'Install Rush'
30+
displayName: Install AutoRest
5631
inputs:
57-
command: 'custom'
58-
customCommand: 'install -g @microsoft/rush'
32+
command: custom
33+
customCommand: install -g autorest@latest
5934

6035
- task: PowerShell@2
61-
displayName: 'Register PS Repository'
36+
displayName: Register PS Repository
37+
enabled: false
6238
inputs:
6339
targetType: inline
6440
pwsh: true
65-
errorActionPreference: 'continue'
41+
errorActionPreference: continue
6642
script: |
6743
$ErrorActionPreference = [System.Management.Automation.ActionPreference]::Continue
6844
Get-PSRepository
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
4+
steps:
5+
- task: UseDotNet@2
6+
displayName: Use .NET SDK
7+
inputs:
8+
debugMode: false
9+
version: 6.x
10+
11+
- task: NuGetToolInstaller@1
12+
displayName: Install Nuget
13+
14+
- task: NuGetAuthenticate@0
15+
16+
- task: PowerShell@2
17+
displayName: Version Check
18+
inputs:
19+
targetType: inline
20+
pwsh: true
21+
script: |
22+
Write-Output $PSVersionTable
23+
24+
- task: NodeTool@0
25+
displayName: Install NodeJs
26+
inputs:
27+
versionSpec: 16.x
28+
29+
- task: Npm@1
30+
displayName: Install AutoRest
31+
inputs:
32+
command: custom
33+
customCommand: install -g autorest@latest
34+
35+
- task: PowerShell@2
36+
displayName: Register PS Repository
37+
enabled: false
38+
inputs:
39+
targetType: inline
40+
pwsh: true
41+
errorActionPreference: continue
42+
script: |
43+
$ErrorActionPreference = [System.Management.Automation.ActionPreference]::Continue
44+
Get-PSRepository
45+
$patToken = '$(NUGETFEEDKEY)' | ConvertTo-SecureString -AsPlainText -Force
46+
$nugetFeed = '$(NUGETFEED)'
47+
$user = '$(NUGETBUILDUSER)'
48+
$credsAzureDevopsServices = New-Object System.Management.Automation.PSCredential($user, $patToken)
49+
UnRegister-PackageSource -Name 'LocalNugetPackageSource' -ErrorAction Continue
50+
UnRegister-PSRepository -Name 'LocalNugetFeed' -ErrorAction Continue
51+
Register-PackageSource -Name 'LocalNugetPackageSource' -Location $nugetFeed -SkipValidate -Trusted -Verbose -ProviderName 'Nuget' -ErrorAction Continue
52+
Register-PSRepository -Name 'LocalNugetFeed' -SourceLocation $nugetFeed -PublishLocation $nugetFeed -InstallationPolicy Trusted -Credential $credsAzureDevopsServices -PackageManagementProvider 'Nuget' -ErrorAction Continue
53+
Get-PSRepository
54+
Find-Module -Name Microsoft.Graph.Authentication -AllowPrerelease -Credential $credsAzureDevopsServices -AllVersions -Repository 'LocalNugetFeed'
55+
Find-Module -Name Microsoft.Graph.Authentication -AllowPrerelease -Repository 'LocalNugetFeed'

0 commit comments

Comments
 (0)