-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pipelines alignment #184
Merged
Merged
pipelines alignment #184
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
67ce91c
- aligns pipeline definitions on OpenApi.net
baywet 338db55
- removes net 472 from targets
baywet 4b68beb
- fixes casign in test project reference
baywet 16f41ea
- adds missing condition for version incrment check
baywet c84c5cf
- adds missing variable definition for bimskim
baywet d725f67
- adds deploy stage to pipeline
baywet c891e14
- fixes job definition structure and name for deployment
baywet c2b3171
- adds missing strategy definition
baywet 43c730b
- moves pool to its rightful place
baywet 20d9ce5
- temp disablement of condition for testing
baywet 2c64e76
- locks windows version to workaround https://github.com/github/codeq…
baywet 84ee175
- path fix
baywet bf83ccb
- fixes the pacakge name
baywet 264e220
- fixes matching pattern after changing package name
baywet 6025725
- restores condition after successful publish
baywet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,238 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
|
||
name: $(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r) | ||
|
||
trigger: | ||
branches: | ||
include: | ||
- master | ||
pr: none | ||
|
||
pool: | ||
name: Azure Pipelines | ||
vmImage: windows-latest | ||
demands: | ||
- msbuild | ||
- vstest | ||
|
||
variables: | ||
buildPlatform: 'Any CPU' | ||
buildConfiguration: 'Release' | ||
ProductBinPath: '$(Build.SourcesDirectory)\bin\$(BuildConfiguration)' | ||
|
||
|
||
stages: | ||
|
||
- stage: build | ||
jobs: | ||
- job: build | ||
steps: | ||
|
||
- task: UseDotNet@2 | ||
displayName: 'Use .NET 6' | ||
inputs: | ||
version: 6.x | ||
|
||
- task: PoliCheck@1 | ||
displayName: 'Run PoliCheck "/src"' | ||
inputs: | ||
inputType: CmdLine | ||
cmdLineArgs: '/F:$(Build.SourcesDirectory)/src /T:9 /Sev:"1|2" /PE:2 /O:poli_result_src.xml' | ||
|
||
- task: PoliCheck@1 | ||
displayName: 'Run PoliCheck "/test"' | ||
inputs: | ||
inputType: CmdLine | ||
cmdLineArgs: '/F:$(Build.SourcesDirectory)/test /T:9 /Sev:"1|2" /PE:2 /O:poli_result_test.xml' | ||
|
||
- task: PoliCheck@1 | ||
displayName: 'PoliCheck for /tool' | ||
inputs: | ||
inputType: CmdLine | ||
cmdLineArgs: '/F:$(Build.SourcesDirectory)/tool /T:9 /Sev:"1|2" /PE:2 /O:poli_result_tool.xml' | ||
|
||
# Install the nuget tool. | ||
- task: NuGetToolInstaller@0 | ||
displayName: 'Use NuGet >=5.2.0' | ||
inputs: | ||
versionSpec: '>=5.2.0' | ||
checkLatest: true | ||
|
||
# Build the Product project | ||
- task: DotNetCoreCLI@2 | ||
displayName: 'build' | ||
inputs: | ||
projects: '$(Build.SourcesDirectory)\Microsoft.OpenApi.OData.sln' | ||
arguments: '--configuration $(BuildConfiguration) --no-incremental' | ||
|
||
# Run the Unit test | ||
- task: DotNetCoreCLI@2 | ||
displayName: 'test' | ||
inputs: | ||
command: test | ||
projects: '$(Build.SourcesDirectory)\Microsoft.OpenApi.OData.sln' | ||
arguments: '--configuration $(BuildConfiguration) --no-build' | ||
|
||
# CredScan | ||
- task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@2 | ||
displayName: 'Run CredScan - Src' | ||
inputs: | ||
toolMajorVersion: 'V2' | ||
scanFolder: '$(Build.SourcesDirectory)\src' | ||
debugMode: false | ||
|
||
- task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@2 | ||
displayName: 'Run CredScan - Test' | ||
inputs: | ||
toolMajorVersion: 'V2' | ||
scanFolder: '$(Build.SourcesDirectory)\test' | ||
debugMode: false | ||
|
||
- task: AntiMalware@3 | ||
displayName: 'Run MpCmdRun.exe - ProductBinPath' | ||
inputs: | ||
FileDirPath: '$(ProductBinPath)' | ||
enabled: false | ||
|
||
- task: BinSkim@3 | ||
displayName: 'Run BinSkim - Product Binaries' | ||
inputs: | ||
InputType: Basic | ||
AnalyzeTarget: '$(ProductBinPath)\**\Microsoft.OpenApi.OData.Reader.dll' | ||
AnalyzeSymPath: '$(ProductBinPath)' | ||
AnalyzeVerbose: true | ||
AnalyzeHashes: true | ||
AnalyzeEnvironment: true | ||
|
||
- task: PublishSecurityAnalysisLogs@2 | ||
displayName: 'Publish Security Analysis Logs' | ||
inputs: | ||
ArtifactName: SecurityLogs | ||
|
||
- task: PostAnalysis@1 | ||
displayName: 'Post Analysis' | ||
inputs: | ||
BinSkim: true | ||
CredScan: true | ||
PoliCheck: true | ||
|
||
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 | ||
displayName: 'ESRP CodeSigning' | ||
inputs: | ||
ConnectedServiceName: 'microsoftgraph ESRP CodeSign DLL and NuGet (AKV)' | ||
FolderPath: src | ||
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: 20 | ||
|
||
# Pack | ||
- task: DotNetCoreCLI@2 | ||
displayName: 'pack' | ||
inputs: | ||
command: pack | ||
projects: src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj | ||
arguments: '-o $(Build.ArtifactStagingDirectory) --configuration $(BuildConfiguration) --no-build --include-symbols --include-source /p:SymbolPackageFormat=snupkg' | ||
|
||
- task: PowerShell@2 | ||
displayName: 'Validate project version has been incremented' | ||
condition: and(contains(variables['build.sourceBranch'], 'refs/heads/master'), succeeded()) | ||
inputs: | ||
targetType: 'filePath' | ||
filePath: $(System.DefaultWorkingDirectory)\scripts\ValidateProjectVersionUpdated.ps1 | ||
arguments: '-projectVersion "$(VersionFullSemantic)"' | ||
|
||
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 | ||
displayName: 'ESRP CodeSigning Nuget Packages' | ||
inputs: | ||
ConnectedServiceName: 'microsoftgraph ESRP CodeSign DLL and NuGet (AKV)' | ||
FolderPath: '$(Build.ArtifactStagingDirectory)' | ||
Pattern: '*.nupkg' | ||
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 | ||
|
||
- task: PublishPipelineArtifact@1 | ||
displayName: 'Upload Artifact: Nugets' | ||
inputs: | ||
artifactName: Nugets | ||
targetPath: $(Build.ArtifactStagingDirectory) | ||
|
||
- stage: deploy | ||
condition: and(contains(variables['build.sourceBranch'], 'refs/heads/master'), succeeded()) | ||
dependsOn: build | ||
jobs: | ||
- deployment: deploy | ||
environment: nuget-org | ||
strategy: | ||
runOnce: | ||
deploy: | ||
pool: | ||
vmImage: ubuntu-latest | ||
steps: | ||
- task: DownloadPipelineArtifact@2 | ||
displayName: Download nupkg from artifacts | ||
inputs: | ||
artifact: Nugets | ||
source: current | ||
- task: NuGetCommand@2 | ||
displayName: 'NuGet push' | ||
inputs: | ||
command: push | ||
packagesToPush: '$(Pipeline.Workspace)/Nugets/Microsoft.OpenApi.OData.*.nupkg' | ||
nuGetFeedType: external | ||
publishFeedCredentials: 'OpenAPI Nuget Connection' | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OpenAPI.NET uses
vnext
branch as a default branch beforemaster
. We may want to have this flow in this repo as well.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer if we aligned all of them on main like the other repos we have at a later date if you don't mind?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving this as is will mean all merges to
master
will do a release. And this is the main branch for this repo.