Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
cfa46f8
Add ci-build
peombwa Jul 18, 2022
04f80cc
Set up CI with Azure Pipelines
peombwa Jul 18, 2022
7a19606
Install required tools.
peombwa Jul 18, 2022
5adcc9e
Temorarily skip tests.
peombwa Jul 18, 2022
4de9c40
Merge branch 'features/2.0' into azDo/Pipeline
peombwa Jul 18, 2022
31cd22a
Remove broken API.
peombwa Jul 18, 2022
f9fbcc6
Enable all modules.
peombwa Jul 18, 2022
6222b78
Increate timeout.
peombwa Jul 19, 2022
8d6fff4
Move CI build to a job.
peombwa Jul 19, 2022
f86ea1d
Merge branch 'features/2.0' into azDo/Pipeline
peombwa Jul 19, 2022
5e3299e
Rename ReplyAll commands.
peombwa Jul 19, 2022
a757024
Exclude modules with broken APIs.
peombwa Jul 19, 2022
5ccd9ce
Fix groups module.
peombwa Jul 19, 2022
6adc205
Remove Financials directive.
peombwa Jul 19, 2022
205b32d
Use templates.
peombwa Jul 20, 2022
0a6db3d
Opt-in to test.
peombwa Jul 20, 2022
778fc85
Enable signing.
peombwa Jul 20, 2022
f9632de
Enable test modules.
peombwa Jul 20, 2022
81706a7
Update folder path.
peombwa Jul 20, 2022
981f6e4
Enable signing.
peombwa Jul 20, 2022
d459665
Set signing option for templates.
peombwa Jul 20, 2022
9e70098
Publish module to artifact directory.
peombwa Jul 20, 2022
83065a1
Publish to drop container on pack and sign.
peombwa Jul 20, 2022
03c1c90
Enable all succeeding modules.
peombwa Jul 20, 2022
ecfd884
Publish to feed.
peombwa Jul 21, 2022
6504da7
Enable packing of meta-module.
peombwa Jul 22, 2022
abdda20
Enable meta-module preview version.
peombwa Jul 22, 2022
2271015
Set meta-module preview version.
peombwa Jul 22, 2022
125f21e
Enable auth module preview version.
peombwa Jul 23, 2022
4e9db2d
Read module version from metamodule config.
peombwa Aug 3, 2022
7f86037
Generate prerelease workload modules.
peombwa Aug 3, 2022
bb8c5bb
Merge branch 'features/2.0' into azDo/Pipeline
peombwa Aug 4, 2022
49ba455
Lock meta-module version.
peombwa Aug 4, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .azure-pipelines/ci-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
name: $(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
parameters:
- name: BuildAgent
default: 1es-windows-ps-compute
displayName: Build Agent
- name: Test
type: boolean
default: true
- name: Pack
type: boolean
default: true
- name: Sign
type: boolean
default: true

variables:
BuildAgent: ${{ parameters.BuildAgent }}
GitUserEmail: 'GraphTooling@service.microsoft.com'
GitUserName: 'Microsoft Graph DevX Tooling'

pool: $(BuildAgent)

trigger:
branches:
include:
- main
- features/2.0
pr: none

jobs:
- job: MsGraphPsSdkCiBuild
displayName: Microsoft Graph PowerShell SDK CI Build
timeoutInMinutes: 840
steps:
- template: ./common-templates/install-tools.yml
- template: ./common-templates/security-pre-checks.yml

- template: ./generation-templates/authentication-module.yml
parameters:
Test: ${{ parameters.Test }}
Pack: ${{ parameters.Pack }}
Sign: ${{ parameters.Sign }}

- template: ./generation-templates/workload-modules.yml
parameters:
Test: ${{ parameters.Test }}
Pack: ${{ parameters.Pack }}
Sign: ${{ parameters.Sign }}

- template: ./generation-templates/meta-module.yml
parameters:
Test: ${{ parameters.Test }}
Pack: ${{ parameters.Pack }}
Sign: ${{ parameters.Sign }}

- ${{ if and(eq(parameters.Pack, true), eq(parameters.Sign, true)) }}:
- template: ./common-templates/esrp/codesign-nuget.yml
parameters:
FolderPath: '$(Build.ArtifactStagingDirectory)'
Pattern: 'Microsoft.Graph*.nupkg'

- task: PublishBuildArtifacts@1
displayName: Publish Module Artifacts
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'

- task: NuGetCommand@2
displayName: Publish NuGet to preview feed
inputs:
command: push
packagesToPush: $(Build.ArtifactStagingDirectory)/**/Microsoft.Graph.*.nupkg
publishVstsFeed: $(PROJECT_NAME)/$(PREVIEW_FEED_NAME)
allowPackageConflicts: true

- template: ./common-templates/security-post-checks.yml
38 changes: 38 additions & 0 deletions .azure-pipelines/common-templates/esrp/codesign-nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

parameters:
- name: FolderPath
type: string
default: $(System.DefaultWorkingDirectory)
- name: Pattern
type: string
default: '*.nupkg'

steps:
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: ESRP NuGet CodeSigning
enabled: true
inputs:
ConnectedServiceName: microsoftgraph ESRP CodeSign DLL and NuGet (AKV)
FolderPath: ${{ parameters.FolderPath }}
Pattern: ${{ parameters.Pattern }}
signConfigType: inlineSignParams
inlineOperation: |
[
{
"keyCode": "CP-401405",
"operationSetCode": "NuGetSign",
"parameters": [ ],
"toolName": "sign",
"toolVersion": "1.0"
},
{
"keyCode": "CP-401405",
"operationSetCode": "NuGetVerify",
"parameters": [ ],
"toolName": "sign",
"toolVersion": "1.0"
}
]
SessionTimeout: 20
59 changes: 59 additions & 0 deletions .azure-pipelines/common-templates/esrp/codesign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

parameters:
- name: FolderPath
type: string
default: $(System.DefaultWorkingDirectory)
- name: Pattern
type: string
default: '.*.dll'

steps:
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: ESRP DLL CodeSigning
enabled: true
inputs:
ConnectedServiceName: microsoftgraph ESRP CodeSign DLL and NuGet (AKV)
FolderPath: ${{ parameters.FolderPath }}
Pattern: ${{ parameters.Pattern }}
signConfigType: inlineSignParams
inlineOperation: |
[
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolSign",
"parameters": [
{
"parameterName": "OpusName",
"parameterValue": "Microsoft"
},
{
"parameterName": "OpusInfo",
"parameterValue": "http://www.microsoft.com"
},
{
"parameterName": "FileDigest",
"parameterValue": "/fd \"SHA256\""
},
{
"parameterName": "PageHash",
"parameterValue": "/NPH"
},
{
"parameterName": "TimeStamp",
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
}
],
"toolName": "sign",
"toolVersion": "1.0"
},
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolVerify",
"parameters": [],
"toolName": "sign",
"toolVersion": "1.0"
}
]
SessionTimeout: 160
38 changes: 38 additions & 0 deletions .azure-pipelines/common-templates/esrp/strongname.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

parameters:
- name: FolderPath
type: string
default: $(System.DefaultWorkingDirectory)
- name: Pattern
type: string
default: '.*.dll'

steps:
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: ESRP DLL Strong Name
enabled: true
inputs:
ConnectedServiceName: microsoftgraph ESRP CodeSign DLL and NuGet (AKV)
FolderPath: ${{ parameters.FolderPath }}
Pattern: ${{ parameters.Pattern }}
signConfigType: inlineSignParams
inlineOperation: |
[
{
"keyCode": "CP-233863-SN",
"operationSetCode": "StrongNameSign",
"parameters": [],
"toolName": "sign",
"toolVersion": "1.0"
},
{
"keyCode": "CP-233863-SN",
"operationSetCode": "StrongNameVerify",
"parameters": [],
"toolName": "sign",
"toolVersion": "1.0"
}
]
SessionTimeout: 20
48 changes: 12 additions & 36 deletions .azure-pipelines/common-templates/install-tools-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,66 +3,42 @@

steps:
- task: UseDotNet@2
displayName: 'Use .NET Core SDK 2 LTS'
inputs:
debugMode: false
version: 2.x

- task: UseDotNet@2
displayName: 'Use .NET Core SDK 3 LTS'
inputs:
debugMode: false
version: 3.x

- task: UseDotNet@2
displayName: 'Use .NET Core SDK 6 Current'
displayName: Use .NET SDK
inputs:
debugMode: false
version: 6.x

- task: NuGetToolInstaller@1
displayName: 'Install Nuget 5.7'
inputs:
versionSpec: 5.7.0
checkLatest: false # Optional
displayName: Install Nuget

- task: NuGetAuthenticate@0


- task: PowerShell@2
displayName: 'Version Check'
displayName: Version Check
inputs:
targetType: inline
pwsh: true
script: |
Write-Host $PSVersionTable.PSVersion
Write-Host $host.Version
Write-Host (Get-Host).Version
Write-Output $PSVersionTable

- task: NodeTool@0
displayName: 'Install NodeJs'
inputs:
versionSpec: '14.18.2'
checkLatest: true # Optional

- task: Npm@1
displayName: 'Install AutoRest'
displayName: Install NodeJs
inputs:
command: 'custom'
customCommand: 'install -g autorest@latest'
versionSpec: 16.x

- task: Npm@1
displayName: 'Install Rush'
displayName: Install AutoRest
inputs:
command: 'custom'
customCommand: 'install -g @microsoft/rush'
command: custom
customCommand: install -g autorest@latest

- task: PowerShell@2
displayName: 'Register PS Repository'
displayName: Register PS Repository
enabled: false
inputs:
targetType: inline
pwsh: true
errorActionPreference: 'continue'
errorActionPreference: continue
script: |
$ErrorActionPreference = [System.Management.Automation.ActionPreference]::Continue
Get-PSRepository
Expand Down
55 changes: 55 additions & 0 deletions .azure-pipelines/common-templates/install-tools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

steps:
- task: UseDotNet@2
displayName: Use .NET SDK
inputs:
debugMode: false
version: 6.x

- task: NuGetToolInstaller@1
displayName: Install Nuget

- task: NuGetAuthenticate@0

- task: PowerShell@2
displayName: Version Check
inputs:
targetType: inline
pwsh: true
script: |
Write-Output $PSVersionTable

- task: NodeTool@0
displayName: Install NodeJs
inputs:
versionSpec: 16.x

- task: Npm@1
displayName: Install AutoRest
inputs:
command: custom
customCommand: install -g autorest@latest

- task: PowerShell@2
displayName: Register PS Repository
enabled: false
inputs:
targetType: inline
pwsh: true
errorActionPreference: continue
script: |
$ErrorActionPreference = [System.Management.Automation.ActionPreference]::Continue
Get-PSRepository
$patToken = '$(NUGETFEEDKEY)' | ConvertTo-SecureString -AsPlainText -Force
$nugetFeed = '$(NUGETFEED)'
$user = '$(NUGETBUILDUSER)'
$credsAzureDevopsServices = New-Object System.Management.Automation.PSCredential($user, $patToken)
UnRegister-PackageSource -Name 'LocalNugetPackageSource' -ErrorAction Continue
UnRegister-PSRepository -Name 'LocalNugetFeed' -ErrorAction Continue
Register-PackageSource -Name 'LocalNugetPackageSource' -Location $nugetFeed -SkipValidate -Trusted -Verbose -ProviderName 'Nuget' -ErrorAction Continue
Register-PSRepository -Name 'LocalNugetFeed' -SourceLocation $nugetFeed -PublishLocation $nugetFeed -InstallationPolicy Trusted -Credential $credsAzureDevopsServices -PackageManagementProvider 'Nuget' -ErrorAction Continue
Get-PSRepository
Find-Module -Name Microsoft.Graph.Authentication -AllowPrerelease -Credential $credsAzureDevopsServices -AllVersions -Repository 'LocalNugetFeed'
Find-Module -Name Microsoft.Graph.Authentication -AllowPrerelease -Repository 'LocalNugetFeed'
Loading