From 67ce91c8e40d1e0f4416bdb7e72a49441398be01 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 24 Feb 2022 14:53:52 -0500 Subject: [PATCH 01/15] - aligns pipeline definitions on OpenApi.net --- .azure-pipelines/ci-build.yml | 199 +++++++++++++ .../workflows/azure-pipelines_nightly.yml | 281 ------------------ .../workflows/azure-pipelines_release.yml | 259 ---------------- .../workflows/azure-pipelines_rolling.yml | 135 --------- .github/workflows/ci-cd.yml | 139 +++++++++ ...penAPI.OData.Reader.Nightly.Release.nuspec | 29 -- ...rosoft.OpenAPI.OData.Reader.Release.nuspec | 29 -- .../Microsoft.OpenAPI.OData.Reader.csproj | 33 ++ src/Microsoft.OpenApi.OData.Reader/icon.png | Bin 0 -> 393 bytes 9 files changed, 371 insertions(+), 733 deletions(-) create mode 100644 .azure-pipelines/ci-build.yml delete mode 100644 .github/ISSUE_TEMPLATE/workflows/azure-pipelines_nightly.yml delete mode 100644 .github/ISSUE_TEMPLATE/workflows/azure-pipelines_release.yml delete mode 100644 .github/ISSUE_TEMPLATE/workflows/azure-pipelines_rolling.yml create mode 100644 .github/workflows/ci-cd.yml delete mode 100644 src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.Nightly.Release.nuspec delete mode 100644 src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.Release.nuspec create mode 100644 src/Microsoft.OpenApi.OData.Reader/icon.png diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml new file mode 100644 index 00000000..9cd04b9e --- /dev/null +++ b/.azure-pipelines/ci-build.yml @@ -0,0 +1,199 @@ +# 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 + +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' + inputs: + targetType: 'filePath' + filePath: $(System.DefaultWorkingDirectory)\scripts\ValidateProjectVersionUpdated.ps1 + arguments: '-projectVersion "$(VersionFullSemantic)"' #todo if master branch + +- 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: PublishBuildArtifacts@1 + displayName: 'Publish Artifact: Nugets' + inputs: + ArtifactName: Nugets \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/workflows/azure-pipelines_nightly.yml b/.github/ISSUE_TEMPLATE/workflows/azure-pipelines_nightly.yml deleted file mode 100644 index 4e199f41..00000000 --- a/.github/ISSUE_TEMPLATE/workflows/azure-pipelines_nightly.yml +++ /dev/null @@ -1,281 +0,0 @@ -name: $(TeamProject)_$(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r) - -# No trigger for nightly -trigger: none - -# No Pull request (PR) triggers for nightly -pr: none - -# Nightly using schedules -schedules: -- cron: "0 0 * * Mon,Tue,Wed,Thu,Fri" - displayName: midnightly build - branches: - include: - - master - -pool: - vmImage: 'windows-latest' - -variables: - buildPlatform: 'Any CPU' - buildConfiguration: 'Release' - snExe: 'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\sn.exe' - snExe64: 'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\sn.exe' - ProductBinPath: '$(Build.SourcesDirectory)\bin\$(BuildConfiguration)' - mainDll: 'Microsoft.OpenApi.OData.Reader.dll' - testDll: 'Microsoft.OpenApi.OData.Reader.Tests.dll' - skipComponentGovernanceDetection: true - -steps: - -- task: UseDotNet@2 - displayName: 'Use .NET 6' - inputs: - version: 6.x - -- task: PoliCheck@1 - displayName: 'Run PoliCheck "OpenApi.OData-master\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 "OpenApi.OData-master\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 OpenApi.OData-master\tool' - inputs: - inputType: CmdLine - cmdLineArgs: '/F:$(Build.SourcesDirectory)/tool /T:9 /Sev:"1|2" /PE:2 /O:poli_result_tool.xml' - -# Install the nuget tooler. -- 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 Microsoft.OpenAPI.OData.Reader.csproj ' - inputs: - projects: '$(Build.SourcesDirectory)\src\Microsoft.OpenApi.OData.Reader\Microsoft.OpenAPI.OData.Reader.csproj' - arguments: '--configuration $(BuildConfiguration) --no-incremental' - -# Build the Unit test project -- task: DotNetCoreCLI@2 - displayName: 'build Microsoft.OpenAPI.OData.Reader.Tests.csproj' - inputs: - projects: '$(Build.SourcesDirectory)\test\Microsoft.OpenAPI.OData.Reader.Tests\Microsoft.OpenApi.OData.Reader.Tests.csproj' - arguments: '--configuration $(BuildConfiguration) --no-incremental' - -# because the assemblies are delay-signed, we need to disable -# strong name validation so that the tests may run, -# otherwise our assemblies will fail to load -- task: Powershell@2 - displayName: 'Skip strong name validation' - inputs: - targetType: 'inline' - script: | - & "$(snExe)" /Vr $(ProductBinPath)\net472\$(mainDll) - & "$(snExe64)" /Vr $(ProductBinPath)\net472\$(mainDll) - & "$(snExe)" /Vr $(ProductBinPath)\test\net472\$(testDll) - & "$(snExe64)" /Vr $(ProductBinPath)\test\net472\$(testDll) - -# Run the Unit test -- task: DotNetCoreCLI@2 - displayName: 'Run Microsoft.OpenApi.OData.Reader.Tests.csproj' - inputs: - command: test - projects: '$(Build.SourcesDirectory)\test\Microsoft.OpenAPI.OData.Reader.Tests\Microsoft.OpenApi.OData.Reader.Tests.csproj' - 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 - -# Microsoft.CodeAnalysis.FxCopAnalyzers is added into the project. -# Typically, .NET Standard (.NET Core) project doesn't need the FxCop. - -# Needn't the AntiMalware@3 task? -- 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: EsrpCodeSigning@1 - displayName: 'ESRP CodeSigning' - inputs: - ConnectedServiceName: 'microsoftgraph ESRP CodeSign DLL and NuGet (AKV)' - FolderPath: '$(Build.SourcesDirectory)\bin\$(BuildConfiguration)' - Pattern: Microsoft.OpenApi.OData.Reader.dll - signConfigType: inlineSignParams - inlineOperation: | - [ - { - "keyCode": "MSSharedLibSnKey", - "operationSetCode": "StrongNameSign", - "parameters": null, - "toolName": "sn.exe", - "toolVersion": "V4.6.1586.0" - }, - { - "keyCode": "MSSharedLibSnKey", - "operationSetCode": "StrongNameVerify", - "parameters": null, - "toolName": "sn.exe", - "toolVersion": "V4.6.1586.0" - }, - { - "keyCode": "MSSharedLibSnKey", - "operationSetCode": "StrongNameSign", - "parameters": null, - "toolName": "sn.exe", - "toolVersion": "V4.6.1586.0" - }, - { - "keyCode": "MSSharedLibSnKey", - "operationSetCode": "StrongNameVerify", - "parameters": null, - "toolName": "sn.exe", - "toolVersion": "V4.6.1586.0" - }, - { - "keyCode": "CP-230012", - "operationSetCode": "SigntoolSign", - "parameters": [ - { - "parameterName": "OpusName", - "parameterValue": "TestSign" - }, - { - "parameterName": "OpusInfo", - "parameterValue": "http://test" - }, - { - "parameterName": "PageHash", - "parameterValue": "/NPH" - }, - { - "parameterName": "FileDigest", - "parameterValue": "/fd sha256" - }, - { - "parameterName": "TimeStamp", - "parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" - } - ], - "toolName": "signtool.exe", - "toolVersion": "6.2.9304.0" - }, - { - "keyCode": "CP-230012", - "operationSetCode": "SigntoolVerify", - "parameters": [ - { - "parameterName": "VerifyAll", - "parameterValue": "/all" - } - ], - "toolName": "signtool.exe", - "toolVersion": "6.2.9304.0" - } - ] - SessionTimeout: 20 - -- task: MSBuild@1 - displayName: 'Get Nuget Package Metadata' - inputs: - solution: '$(Build.SourcesDirectory)\tool\GetNugetPackageMetadata.proj' - platform: '$(BuildPlatform)' - configuration: '$(BuildConfiguration)' - -- task: NuGetCommand@2 - displayName: 'NuGet pack Nightly.Release.nuspec' - inputs: - command: custom - arguments: 'pack $(Build.SourcesDirectory)\src\Microsoft.OpenApi.OData.Reader\Microsoft.OpenAPI.OData.Reader.Nightly.Release.nuspec -NonInteractive -OutputDirectory $(Build.ArtifactStagingDirectory)\Nuget -Properties Configuration=$(BuildConfiguration);ProductRoot=$(ProductBinPath);SourcesRoot=$(Build.SourcesDirectory);VersionFullSemantic=$(VersionFullSemantic);NightlyBuildVersion=$(VersionNugetNightlyBuild);VersionNuGetSemantic=$(VersionNuGetSemantic);OpenApiCorePackageDependency="$(OpenApiCorePackageDependency)";ODataEdmPackageDependency="$(ODataEdmPackageDependency)"; -Verbosity Detailed -Symbols -SymbolPackageFormat snupkg' - -- task: NuGetCommand@2 - displayName: 'NuGet pack Release.nuspec' - inputs: - command: custom - arguments: 'pack $(Build.SourcesDirectory)\src\Microsoft.OpenApi.OData.Reader\Microsoft.OpenAPI.OData.Reader.Release.nuspec -NonInteractive -OutputDirectory $(Build.ArtifactStagingDirectory)\Nuget -Properties Configuration=$(BuildConfiguration);ProductRoot=$(ProductBinPath);VersionFullSemantic=$(VersionFullSemantic);NightlyBuildVersion=$(VersionNugetNightlyBuild);VersionNuGetSemantic=$(VersionNuGetSemantic);OpenApiCorePackageDependency="$(OpenApiCorePackageDependency)";ODataEdmPackageDependency="$(ODataEdmPackageDependency)"; -Verbosity Detailed -Symbols -SymbolPackageFormat snupkg' - -- task: EsrpCodeSigning@1 - displayName: 'ESRP CodeSigning Nuget Packages' - inputs: - ConnectedServiceName: 'microsoftgraph ESRP CodeSign DLL and NuGet (AKV)' - FolderPath: '$(Build.ArtifactStagingDirectory)\Nuget' - 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: PublishBuildArtifacts@1 - displayName: 'Publish Artifact - Nuget Packages' - inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)\Nuget' - ArtifactName: Nuget - -- task: NuGetCommand@2 - displayName: 'NuGet push - Nightly package to MyGet' - inputs: - command: push - packagesToPush: '$(Build.ArtifactStagingDirectory)\Nuget\*Nightly*.nupkg' - nuGetFeedType: external - publishFeedCredentials: 'MyGet.Org - OpenApi-OData-master Nightly Feed' diff --git a/.github/ISSUE_TEMPLATE/workflows/azure-pipelines_release.yml b/.github/ISSUE_TEMPLATE/workflows/azure-pipelines_release.yml deleted file mode 100644 index 4cd25b9b..00000000 --- a/.github/ISSUE_TEMPLATE/workflows/azure-pipelines_release.yml +++ /dev/null @@ -1,259 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. -name: $(TeamProject)_$(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r) - -# Trigger is on github tags -trigger: - tags: - include: - - '*' - -# No Pull request (PR) triggers for release -pr: none - -pool: - vmImage: 'windows-latest' - -variables: - buildPlatform: 'Any CPU' - buildConfiguration: 'Release' - snExe: 'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\sn.exe' - snExe64: 'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\sn.exe' - ProductBinPath: '$(Build.SourcesDirectory)\bin\$(BuildConfiguration)' - mainDll: 'Microsoft.OpenApi.OData.Reader.dll' - testDll: 'Microsoft.OpenApi.OData.Reader.Tests.dll' - skipComponentGovernanceDetection: true - -steps: - -- task: UseDotNet@2 - displayName: 'Use .NET 6' - inputs: - version: 6.x - -- task: PoliCheck@1 - displayName: 'Run PoliCheck "OpenApi.OData-master\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 "OpenApi.OData-master\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 OpenApi.OData-master\tool' - inputs: - inputType: CmdLine - cmdLineArgs: '/F:$(Build.SourcesDirectory)/tool /T:9 /Sev:"1|2" /PE:2 /O:poli_result_tool.xml' - -# Install the nuget tooler. -- 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 Microsoft.OpenAPI.OData.Reader.csproj ' - inputs: - projects: '$(Build.SourcesDirectory)\src\Microsoft.OpenApi.OData.Reader\Microsoft.OpenAPI.OData.Reader.csproj' - arguments: '--configuration $(BuildConfiguration) --no-incremental' - -# Build the Unit test project -- task: DotNetCoreCLI@2 - displayName: 'build Microsoft.OpenAPI.OData.Reader.Tests.csproj' - inputs: - projects: '$(Build.SourcesDirectory)\test\Microsoft.OpenAPI.OData.Reader.Tests\Microsoft.OpenApi.OData.Reader.Tests.csproj' - arguments: '--configuration $(BuildConfiguration) --no-incremental' - -# because the assemblies are delay-signed, we need to disable -# strong name validation so that the tests may run, -# otherwise our assemblies will fail to load -- task: Powershell@2 - displayName: 'Skip strong name validation' - inputs: - targetType: 'inline' - script: | - & "$(snExe)" /Vr $(ProductBinPath)\net472\$(mainDll) - & "$(snExe64)" /Vr $(ProductBinPath)\net472\$(mainDll) - & "$(snExe)" /Vr $(ProductBinPath)\test\net472\$(testDll) - & "$(snExe64)" /Vr $(ProductBinPath)\test\net472\$(testDll) - -# Run the Unit test -- task: DotNetCoreCLI@2 - displayName: 'Run Microsoft.OpenApi.OData.Reader.Tests.csproj' - inputs: - command: test - projects: '$(Build.SourcesDirectory)\test\Microsoft.OpenAPI.OData.Reader.Tests\Microsoft.OpenApi.OData.Reader.Tests.csproj' - 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 - -# Microsoft.CodeAnalysis.FxCopAnalyzers is added into the project. -# Typically, .NET Standard (.NET Core) project doesn't need the FxCop. - -# Needn't the AntiMalware@3 task? -- 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: EsrpCodeSigning@1 - displayName: 'ESRP CodeSigning' - inputs: - ConnectedServiceName: 'microsoftgraph ESRP CodeSign DLL and NuGet (AKV)' - FolderPath: '$(Build.SourcesDirectory)\bin\$(BuildConfiguration)' - Pattern: Microsoft.OpenApi.OData.Reader.dll - signConfigType: inlineSignParams - inlineOperation: | - [ - { - "keyCode": "CP-230012", - "operationSetCode": "SigntoolSign", - "parameters": [ - { - "parameterName": "OpusName", - "parameterValue": "TestSign" - }, - { - "parameterName": "OpusInfo", - "parameterValue": "http://test" - }, - { - "parameterName": "PageHash", - "parameterValue": "/NPH" - }, - { - "parameterName": "FileDigest", - "parameterValue": "/fd sha256" - }, - { - "parameterName": "TimeStamp", - "parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" - } - ], - "toolName": "signtool.exe", - "toolVersion": "6.2.9304.0" - }, - { - "keyCode": "CP-230012", - "operationSetCode": "SigntoolVerify", - "parameters": [ - { - "parameterName": "VerifyAll", - "parameterValue": "/all" - } - ], - "toolName": "signtool.exe", - "toolVersion": "6.2.9304.0" - } - ] - SessionTimeout: 20 - -- task: MSBuild@1 - displayName: 'Get Nuget Package Metadata' - inputs: - solution: '$(Build.SourcesDirectory)\tool\GetNugetPackageMetadata.proj' - platform: '$(BuildPlatform)' - configuration: '$(BuildConfiguration)' - -- task: PowerShell@2 - displayName: 'Validate project version has been incremented' - inputs: - targetType: 'filePath' - filePath: $(System.DefaultWorkingDirectory)\scripts\ValidateProjectVersionUpdated.ps1 - arguments: '-projectVersion "$(VersionFullSemantic)"' - -- task: NuGetCommand@2 - displayName: 'NuGet pack Release.nuspec' - inputs: - command: custom - arguments: 'pack $(Build.SourcesDirectory)\src\Microsoft.OpenApi.OData.Reader\Microsoft.OpenAPI.OData.Reader.Release.nuspec -NonInteractive -OutputDirectory $(Build.ArtifactStagingDirectory)\Nuget -Properties Configuration=$(BuildConfiguration);ProductRoot=$(ProductBinPath);VersionFullSemantic=$(VersionFullSemantic);NightlyBuildVersion=$(VersionNugetNightlyBuild);VersionNuGetSemantic=$(VersionNuGetSemantic);OpenApiCorePackageDependency="$(OpenApiCorePackageDependency)";ODataEdmPackageDependency="$(ODataEdmPackageDependency)"; -Verbosity Detailed -Symbols -SymbolPackageFormat snupkg' - -- task: EsrpCodeSigning@1 - displayName: 'ESRP CodeSigning Nuget Packages' - inputs: - ConnectedServiceName: 'microsoftgraph ESRP CodeSign DLL and NuGet (AKV)' - FolderPath: '$(Build.ArtifactStagingDirectory)\Nuget' - 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: PublishBuildArtifacts@1 - displayName: 'Publish Artifact - Nuget Packages' - inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)\Nuget' - ArtifactName: Nuget - -- task: NuGetCommand@2 - displayName: 'Push nuget package to nuget.org' - inputs: - command: push - packagesToPush: '$(Build.ArtifactStagingDirectory)\Nuget\*.nupkg' - nuGetFeedType: external - publishFeedCredentials: 'OpenAPI Nuget Connection' - -- task: GithubRelease@1 - displayName: 'Create Github Release (v$(VersionFullSemantic))' - inputs: - githubConnection: 'github - danielmbaluka' - title: 'v$(VersionFullSemantic)' - tagSource: userSpecifiedTag - tag: 'v$(VersionFullSemantic)' diff --git a/.github/ISSUE_TEMPLATE/workflows/azure-pipelines_rolling.yml b/.github/ISSUE_TEMPLATE/workflows/azure-pipelines_rolling.yml deleted file mode 100644 index 6113cfed..00000000 --- a/.github/ISSUE_TEMPLATE/workflows/azure-pipelines_rolling.yml +++ /dev/null @@ -1,135 +0,0 @@ -name: $(TeamProject)_$(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r) - -trigger: -# Set batch to true, it means to let system waits to run until current run is completed, -# Then starts another run with all changes. - batch: true - branches: - include: - - master - -# Pull request (PR) triggers -pr: -- master - -pool: - vmImage: 'windows-latest' - -variables: - buildPlatform: 'Any CPU' - buildConfiguration: 'Release' - snExe: 'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\sn.exe' - snExe64: 'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\sn.exe' - ProductBinPath: '$(Build.SourcesDirectory)\bin\$(BuildConfiguration)' - mainDll: 'Microsoft.OpenApi.OData.Reader.dll' - testDll: 'Microsoft.OpenApi.OData.Reader.Tests.dll' - skipComponentGovernanceDetection: true - -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' - -# Install the nuget tooler. -- 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 Microsoft.OpenAPI.OData.Reader.csproj ' - inputs: - projects: '$(Build.SourcesDirectory)\src\Microsoft.OpenApi.OData.Reader\Microsoft.OpenAPI.OData.Reader.csproj' - arguments: '--configuration $(BuildConfiguration) --no-incremental' - -# Build the Unit test project -- task: DotNetCoreCLI@2 - displayName: 'build Microsoft.OpenAPI.OData.Reader.Tests.csproj' - inputs: - projects: '$(Build.SourcesDirectory)\test\Microsoft.OpenAPI.OData.Reader.Tests\Microsoft.OpenApi.OData.Reader.Tests.csproj' - arguments: '--configuration $(BuildConfiguration) --no-incremental' - -# because the assemblies are delay-signed, we need to disable -# strong name validation so that the tests may run, -# otherwise our assemblies will fail to load -- task: Powershell@2 - displayName: 'Skip strong name validation' - inputs: - targetType: 'inline' - script: | - & "$(snExe)" /Vr $(ProductBinPath)\net472\$(mainDll) - & "$(snExe64)" /Vr $(ProductBinPath)\net472\$(mainDll) - & "$(snExe)" /Vr $(ProductBinPath)\test\net472\$(testDll) - & "$(snExe64)" /Vr $(ProductBinPath)\test\net472\$(testDll) - -# Run the Unit test -- task: DotNetCoreCLI@2 - displayName: 'Run Microsoft.OpenApi.OData.Reader.Tests.csproj' - inputs: - command: test - projects: '$(Build.SourcesDirectory)\test\Microsoft.OpenAPI.OData.Reader.Tests\Microsoft.OpenApi.OData.Reader.Tests.csproj' - 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 - -# Microsoft.CodeAnalysis.FxCopAnalyzers is added into the project. -# Typically, .NET Standard (.NET Core) project doesn't need the FxCop. - -# Needn't the AntiMalware@3 task? -- 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 diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml new file mode 100644 index 00000000..3c5592aa --- /dev/null +++ b/.github/workflows/ci-cd.yml @@ -0,0 +1,139 @@ +name: CI/CD Pipeline + +on: [push, pull_request, workflow_dispatch] + +jobs: + ci: + name: Continuous Integration + runs-on: ubuntu-latest + outputs: + latest_version: ${{ steps.tag_generator.outputs.new_version }} + is_default_branch: ${{ steps.conditionals_handler.outputs.is_default_branch }} + env: + ARTIFACTS_FOLDER: ${{ github.workspace }}/Artifacts + GITHUB_RUN_NUMBER: ${{ github.run_number }} + steps: + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 6.0.x + + - name: Data gatherer + id: data_gatherer + shell: pwsh + run: | + # Get default branch + $repo = 'microsoft/OpenAPI.NET.OData' + $defaultBranch = Invoke-RestMethod -Method GET -Uri https://api.github.com/repos/$repo | Select-Object -ExpandProperty default_branch + Write-Output "::set-output name=default_branch::$(echo $defaultBranch)" + + - name: Conditionals handler + id: conditionals_handler + shell: pwsh + run: | + $defaultBranch = "${{ steps.data_gatherer.outputs.default_branch }}" + $githubRef = "${{ github.ref }}" + $isDefaultBranch = 'false' + if ( $githubRef -like "*$defaultBranch*" ) { + $isDefaultBranch = 'true' + } + Write-Output "::set-output name=is_default_branch::$(echo $isDefaultBranch)" + + - name: Checkout repository + id: checkout_repo + uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 + + - if: steps.conditionals_handler.outputs.is_default_branch == 'true' + name: Bump GH tag + id: tag_generator + uses: mathieudutour/github-tag-action@v6.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + default_bump: false + release_branches: ${{ steps.data_gatherer.outputs.default_branch }} + + - name: Build projects + id: build_projects + shell: pwsh + run: | + $projectsArray = @( + '.\src\Microsoft.OpenApi.OData.Reader\Microsoft.OpenAPI.OData.Reader.csproj' + ) + $gitNewVersion = if ("${{ steps.tag_generator.outputs.new_version }}") {"${{ steps.tag_generator.outputs.new_version }}"} else {$null} + $projectCurrentVersion = ([xml](Get-Content .\src\Microsoft.OpenApi.OData.Reader\Microsoft.OpenAPI.OData.Reader.csproj)).Project.PropertyGroup.Version + $projectNewVersion = $gitNewVersion ?? $projectCurrentVersion + + $projectsArray | ForEach-Object { + dotnet build $PSItem ` + -c Release # ` + # -o $env:ARTIFACTS_FOLDER ` + # /p:Version=$projectNewVersion + } + + # Move NuGet packages to separate folder for pipeline convenience + # New-Item Artifacts/NuGet -ItemType Directory + # Get-ChildItem Artifacts/*.nupkg | Move-Item -Destination "Artifacts/NuGet" + + - name: Run unit tests + id: run_unit_tests + shell: pwsh + run: | + $testProjectsArray = @( + '.\test\Microsoft.OpenAPI.OData.Reader.Tests\Microsoft.OpenAPI.OData.Reader.Tests.csproj' + ) + + $testProjectsArray | ForEach-Object { + dotnet test $PSItem ` + -c Release + } + + # - if: steps.tag_generator.outputs.new_version != '' + # name: Upload NuGet packages as artifacts + # id: ul_packages_artifact + # uses: actions/upload-artifact@v1 + # with: + # name: NuGet packages + # path: Artifacts/NuGet/ + + cd: + if: needs.ci.outputs.is_default_branch == 'true' && needs.ci.outputs.latest_version != '' + name: Continuous Deployment + needs: ci + runs-on: ubuntu-latest + steps: + # - name: Download and extract NuGet packages + # id: dl_packages_artifact + # uses: actions/download-artifact@v2 + # with: + # name: NuGet packages + # path: NuGet/ + + # - name: Push NuGet packages to NuGet.org + # id: push_nuget_packages + # continue-on-error: true + # shell: pwsh + # run: | + # Get-ChildItem NuGet/*.nupkg | ForEach-Object { + # nuget push $PSItem ` + # -ApiKey $env:NUGET_API_KEY ` + # -Source https://api.nuget.org/v3/index.json + # } + # env: + # NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} + + - name: Create and publish release + id: create_release + uses: softprops/action-gh-release@v1 + with: + name: OpenAPI.Net.OData v${{ needs.ci.outputs.latest_version }} + tag_name: v${{ needs.ci.outputs.latest_version }} + # files: | + # NuGet/Microsoft.OpenApi.${{ needs.ci.outputs.latest_version }}.nupkg + # NuGet/Microsoft.OpenApi.Readers.${{ needs.ci.outputs.latest_version }}.nupkg + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +# Built with ❤ by [Pipeline Foundation](https://pipeline.foundation) \ No newline at end of file diff --git a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.Nightly.Release.nuspec b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.Nightly.Release.nuspec deleted file mode 100644 index 357856d1..00000000 --- a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.Nightly.Release.nuspec +++ /dev/null @@ -1,29 +0,0 @@ - - - - Microsoft.OpenApi.OData - Microsoft Open API OData Reader - $VersionFullSemantic$-Nightly$NightlyBuildVersion$ - Microsoft - © Microsoft Corporation. All rights reserved. - This package contains the codes you need to convert OData CSDL to Open API Document of Model. - This package contains the codes you need to convert OData CSDL to Open API Document of Model. - en-US - http://github.com/Microsoft/OpenApi.Net.OData - http://www.microsoft.com/web/webpi/eula/net_library_eula_ENU.htm - true - Microsoft OpenApi OData EDM - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.Release.nuspec b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.Release.nuspec deleted file mode 100644 index d436cd88..00000000 --- a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.Release.nuspec +++ /dev/null @@ -1,29 +0,0 @@ - - - - Microsoft.OpenApi.OData - Microsoft Open API OData Reader - $VersionNuGetSemantic$ - Microsoft - © Microsoft Corporation. All rights reserved. - This package contains the codes you need to convert OData CSDL to Open API Document of Model. - This package contains the codes you need to convert OData CSDL to Open API Document of Model. - en-US - http://github.com/Microsoft/OpenApi.Net.OData - http://www.microsoft.com/web/webpi/eula/net_library_eula_ENU.htm - true - Microsoft OpenApi OData EDM - - - - - - - - - - - - - - diff --git a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj index eebae0ee..8d58bc84 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj +++ b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj @@ -2,17 +2,49 @@ Microsoft.OpenApi.OData.Reader + Latest + true + icon.png + https://github.com/Microsoft/OpenAPI.NET.OData + MIT + true + Microsoft + Microsoft + Microsoft Open API OData Reader Microsoft.OpenApi.OData net472; netstandard2.0 Microsoft.OpenApi.OData.Reader latest latest true + 1.0.10-preview1 + This package contains the codes you need to convert OData CSDL to Open API Document of Model. + © Microsoft Corporation. All rights reserved. + Microsoft OpenApi OData EDM + https://github.com/Microsoft/OpenAPI.NET.OData + +- Adds path items for properties of complex type. #176, #15 +- Describes errors on error response codes instead of default. #172, #165 +- Fixes a bug where reference objects are not created correctly. #171 +- Adds support for enum values descriptions. #164 +- Declares path parameters on path item instead of operation. #159 +- Multiple fixes on navigation properties path items expansion. #151, #123 +- Multiple fixes for descriptions. #154 +- Fixes a bug where URL templates would be missing quotes for string parameters. #140 +- Fixes description of operations of primitive types. #126 +- Adds support for OData cast segments in path items generation. #123 +- Fixes the response descriptions for functions that return a collection. #122 +- Adds support for discriminator property in inheritance. #118 +- Sets deprecated for operations that are generated from deprecated types/singletons/entitysets/properties in the model. #113 + + Microsoft.OpenApi.OData.Reader ..\..\tool\Microsoft.OpenApi.OData.snk ..\..\bin\Debug\ ..\..\bin\Release\ false ..\..\bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml + + true @@ -31,6 +63,7 @@ + True True diff --git a/src/Microsoft.OpenApi.OData.Reader/icon.png b/src/Microsoft.OpenApi.OData.Reader/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..1e58d764e3b2a499f3f2ed11f011688a5f715e1f GIT binary patch literal 393 zcmeAS@N?(olHy`uVBq!ia0vp^0U*r51|<6gKdl8)oCO|{#S9F5M?jcysy3fA0|TSA zr;B4q#jUru4YQaWMH(K~i?4QN`N&qb@r+{9YsMn+gPSWDZa?A5)X@p5Y;|BdJSpi~ zQpmAGS`+ph_#duq*6*LTv4T0RKC-y-N6cBqV~uIvlkXZbuZhoW)H@MV*|4QjOWy6O zc=7{nfd|YV>gwuP?k)PWf%i;<+=8zH|8y8xMFJcceI0=G1r`F#58F@uXWbC@(Ra$$ zTN<*fpF1zOY4qXk&CL?A>n%6@&CtC4A<*iB&0EGcajOKu7aZ?rr&ju3e}ACQBAoNV zw^@gkF63~oxBOubvoFAblaP%U-i7C{NIUf{bxP5No0n`4oPL!x<<)AI-wB()&a>^l a$oXleu8_#$?>m8E%i!ti=d#Wzp$P!^ypzZP literal 0 HcmV?d00001 From 338db55c6b08e53be9a060259b1ffa423b7f4e69 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 24 Feb 2022 14:59:17 -0500 Subject: [PATCH 02/15] - removes net 472 from targets Signed-off-by: Vincent Biret --- .../Microsoft.OpenAPI.OData.Reader.csproj | 3 ++- .../Microsoft.OpenAPI.OData.Reader.Tests.csproj | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj index 8d58bc84..b5a6a65d 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj +++ b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj @@ -12,7 +12,7 @@ Microsoft Microsoft Open API OData Reader Microsoft.OpenApi.OData - net472; netstandard2.0 + netstandard2.0 Microsoft.OpenApi.OData.Reader latest latest @@ -36,6 +36,7 @@ - Fixes the response descriptions for functions that return a collection. #122 - Adds support for discriminator property in inheritance. #118 - Sets deprecated for operations that are generated from deprecated types/singletons/entitysets/properties in the model. #113 +- Aligns target version to netframework2.0. #139 Microsoft.OpenApi.OData.Reader ..\..\tool\Microsoft.OpenApi.OData.snk diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Microsoft.OpenAPI.OData.Reader.Tests.csproj b/test/Microsoft.OpenAPI.OData.Reader.Tests/Microsoft.OpenAPI.OData.Reader.Tests.csproj index 68999991..e246cf23 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Microsoft.OpenAPI.OData.Reader.Tests.csproj +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Microsoft.OpenAPI.OData.Reader.Tests.csproj @@ -3,7 +3,7 @@ Microsoft.OpenApi.OData.Reader.Tests Microsoft.OpenApi.OData.Reader.Tests - net472;net6.0 + net6.0 latest true ..\..\tool\Microsoft.OpenApi.OData.snk From 4b68beb6c9c52baa95c58c96913bef7d8a24750d Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 24 Feb 2022 15:02:13 -0500 Subject: [PATCH 03/15] - fixes casign in test project reference Signed-off-by: Vincent Biret --- .../Microsoft.OpenAPI.OData.Reader.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Microsoft.OpenAPI.OData.Reader.Tests.csproj b/test/Microsoft.OpenAPI.OData.Reader.Tests/Microsoft.OpenAPI.OData.Reader.Tests.csproj index e246cf23..f4efd620 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Microsoft.OpenAPI.OData.Reader.Tests.csproj +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Microsoft.OpenAPI.OData.Reader.Tests.csproj @@ -72,7 +72,7 @@ - + From 16f41ea02abd6864845089d053f5fe1d635fda98 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 24 Feb 2022 15:14:34 -0500 Subject: [PATCH 04/15] - adds missing condition for version incrment check Signed-off-by: Vincent Biret --- .azure-pipelines/ci-build.yml | 4 +++- .../Microsoft.OpenAPI.OData.Reader.csproj | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index 9cd04b9e..b3eecbc7 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -162,10 +162,11 @@ steps: - 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)"' #todo if master branch + arguments: '-projectVersion "$(VersionFullSemantic)"' - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 displayName: 'ESRP CodeSigning Nuget Packages' @@ -194,6 +195,7 @@ steps: SessionTimeout: 20 - task: PublishBuildArtifacts@1 + condition: and(contains(variables['build.sourceBranch'], 'refs/heads/master'), succeeded()) displayName: 'Publish Artifact: Nugets' inputs: ArtifactName: Nugets \ No newline at end of file diff --git a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj index b5a6a65d..fac2227b 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj +++ b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj @@ -14,8 +14,6 @@ Microsoft.OpenApi.OData netstandard2.0 Microsoft.OpenApi.OData.Reader - latest - latest true 1.0.10-preview1 This package contains the codes you need to convert OData CSDL to Open API Document of Model. From c84c5cf161c2989bc983bfb5da3ca961c22ff326 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 24 Feb 2022 15:26:02 -0500 Subject: [PATCH 05/15] - adds missing variable definition for bimskim Signed-off-by: Vincent Biret --- .azure-pipelines/ci-build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index b3eecbc7..41b11824 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -16,6 +16,11 @@ pool: - msbuild - vstest +variables: + buildPlatform: 'Any CPU' + buildConfiguration: 'Release' + ProductBinPath: '$(Build.SourcesDirectory)\bin\$(BuildConfiguration)' + steps: - task: UseDotNet@2 From d725f67b472b36b7ff38be822af673fb5c3bebb1 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 25 Feb 2022 13:14:10 -0500 Subject: [PATCH 06/15] - adds deploy stage to pipeline Signed-off-by: Vincent Biret --- .azure-pipelines/ci-build.yml | 390 ++++++++++++++++++---------------- 1 file changed, 208 insertions(+), 182 deletions(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index 41b11824..5294d9da 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -21,186 +21,212 @@ variables: buildConfiguration: 'Release' ProductBinPath: '$(Build.SourcesDirectory)\bin\$(BuildConfiguration)' -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: PublishBuildArtifacts@1 + +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: PublishBuildArtifacts@1 + displayName: 'Upload Artifact: Nugets' + inputs: + ArtifactName: Nugets + +- stage: deploy condition: and(contains(variables['build.sourceBranch'], 'refs/heads/master'), succeeded()) - displayName: 'Publish Artifact: Nugets' - inputs: - ArtifactName: Nugets \ No newline at end of file + dependsOn: build + environment: nuget-org + jobs: + - deploy: deploy + 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/*.nupkg' + nuGetFeedType: external + publishFeedCredentials: 'OpenAPI Nuget Connection' + \ No newline at end of file From c891e14ace562667cd20a0402c687c46c8de4b89 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 25 Feb 2022 13:17:23 -0500 Subject: [PATCH 07/15] - fixes job definition structure and name for deployment Signed-off-by: Vincent Biret --- .azure-pipelines/ci-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index 5294d9da..df7ea46c 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -213,9 +213,9 @@ stages: - stage: deploy condition: and(contains(variables['build.sourceBranch'], 'refs/heads/master'), succeeded()) dependsOn: build - environment: nuget-org jobs: - - deploy: deploy + - deployment: deploy + environment: nuget-org steps: - task: DownloadPipelineArtifact@2 displayName: Download nupkg from artifacts From c2b317124053798d95a5808d26b3500196085c42 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 25 Feb 2022 13:20:30 -0500 Subject: [PATCH 08/15] - adds missing strategy definition Signed-off-by: Vincent Biret --- .azure-pipelines/ci-build.yml | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index df7ea46c..5da0cd38 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -216,17 +216,22 @@ stages: jobs: - deployment: deploy environment: nuget-org - 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/*.nupkg' - nuGetFeedType: external - publishFeedCredentials: 'OpenAPI Nuget Connection' + strategy: + runOnce: + pool: + vmImage: ubuntu-latest + deploy: + 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/*.nupkg' + nuGetFeedType: external + publishFeedCredentials: 'OpenAPI Nuget Connection' \ No newline at end of file From 43c730ba1859a460ebe7a889b035107c492d2dcf Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 25 Feb 2022 13:21:18 -0500 Subject: [PATCH 09/15] - moves pool to its rightful place Signed-off-by: Vincent Biret --- .azure-pipelines/ci-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index 5da0cd38..e8853c49 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -218,9 +218,9 @@ stages: environment: nuget-org strategy: runOnce: - pool: - vmImage: ubuntu-latest deploy: + pool: + vmImage: ubuntu-latest steps: - task: DownloadPipelineArtifact@2 displayName: Download nupkg from artifacts From 20d9ce5860bda786c5b530cafeeea9032834042b Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 25 Feb 2022 13:42:45 -0500 Subject: [PATCH 10/15] - temp disablement of condition for testing Signed-off-by: Vincent Biret --- .azure-pipelines/ci-build.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index e8853c49..1f8322dd 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -169,7 +169,7 @@ stages: 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' + arguments: '-o $(Build.ArtifactStagingDirectory)/nugets --configuration $(BuildConfiguration) --no-build --include-symbols --include-source /p:SymbolPackageFormat=snupkg' - task: PowerShell@2 displayName: 'Validate project version has been incremented' @@ -205,13 +205,14 @@ stages: ] SessionTimeout: 20 - - task: PublishBuildArtifacts@1 + - task: PublishPipelineArtifact@1 displayName: 'Upload Artifact: Nugets' inputs: - ArtifactName: Nugets + artifactName: Nugets + targetPath: $(Build.ArtifactStagingDirectory)/nugets - stage: deploy - condition: and(contains(variables['build.sourceBranch'], 'refs/heads/master'), succeeded()) + #condition: and(contains(variables['build.sourceBranch'], 'refs/heads/master'), succeeded()) dependsOn: build jobs: - deployment: deploy @@ -231,7 +232,7 @@ stages: displayName: 'NuGet push' inputs: command: push - packagesToPush: '$(Pipeline.Workspace)/Nugets/*.nupkg' + packagesToPush: '$(Pipeline.Workspace)/Nugets/Microsoft.OpenApi.OData.Reader.*.nupkg' nuGetFeedType: external publishFeedCredentials: 'OpenAPI Nuget Connection' \ No newline at end of file From 2c64e76c800727fd9bc871986b34a739d2c9ca6c Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 25 Feb 2022 13:47:05 -0500 Subject: [PATCH 11/15] - locks windows version to workaround https://github.com/github/codeql-action/issues/850 Signed-off-by: Vincent Biret --- .github/workflows/codeql-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index bc2ef1e3..e42a2615 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -23,7 +23,7 @@ on: jobs: analyze: name: Analyze - runs-on: windows-latest + runs-on: windows-2019 permissions: actions: read contents: read From 84ee17596af99de690b7ccbec863064990777e9d Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 25 Feb 2022 14:01:10 -0500 Subject: [PATCH 12/15] - path fix Signed-off-by: Vincent Biret --- .azure-pipelines/ci-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index 1f8322dd..320d27be 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -169,7 +169,7 @@ stages: inputs: command: pack projects: src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj - arguments: '-o $(Build.ArtifactStagingDirectory)/nugets --configuration $(BuildConfiguration) --no-build --include-symbols --include-source /p:SymbolPackageFormat=snupkg' + 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' @@ -209,7 +209,7 @@ stages: displayName: 'Upload Artifact: Nugets' inputs: artifactName: Nugets - targetPath: $(Build.ArtifactStagingDirectory)/nugets + targetPath: $(Build.ArtifactStagingDirectory) - stage: deploy #condition: and(contains(variables['build.sourceBranch'], 'refs/heads/master'), succeeded()) From bf83ccbf2f34159aaece0a5a9ab81f2faafc5039 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 25 Feb 2022 14:59:58 -0500 Subject: [PATCH 13/15] - fixes the pacakge name Signed-off-by: Vincent Biret --- .../Microsoft.OpenAPI.OData.Reader.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj index fac2227b..d11bd7c7 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj +++ b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj @@ -13,7 +13,7 @@ Microsoft Open API OData Reader Microsoft.OpenApi.OData netstandard2.0 - Microsoft.OpenApi.OData.Reader + Microsoft.OpenApi.OData true 1.0.10-preview1 This package contains the codes you need to convert OData CSDL to Open API Document of Model. From 264e220ace307a26938f4f2796df374f259883b6 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 25 Feb 2022 15:18:24 -0500 Subject: [PATCH 14/15] - fixes matching pattern after changing package name Signed-off-by: Vincent Biret --- .azure-pipelines/ci-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index 320d27be..61f3bb0e 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -232,7 +232,7 @@ stages: displayName: 'NuGet push' inputs: command: push - packagesToPush: '$(Pipeline.Workspace)/Nugets/Microsoft.OpenApi.OData.Reader.*.nupkg' + packagesToPush: '$(Pipeline.Workspace)/Nugets/Microsoft.OpenApi.OData.*.nupkg' nuGetFeedType: external publishFeedCredentials: 'OpenAPI Nuget Connection' \ No newline at end of file From 60257253fbb5f91104c6e777d1d397d38cf01c58 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 25 Feb 2022 15:49:09 -0500 Subject: [PATCH 15/15] - restores condition after successful publish Signed-off-by: Vincent Biret --- .azure-pipelines/ci-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index 61f3bb0e..7303a3c6 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -212,7 +212,7 @@ stages: targetPath: $(Build.ArtifactStagingDirectory) - stage: deploy - #condition: and(contains(variables['build.sourceBranch'], 'refs/heads/master'), succeeded()) + condition: and(contains(variables['build.sourceBranch'], 'refs/heads/master'), succeeded()) dependsOn: build jobs: - deployment: deploy