winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit c63f1d81cf3be8bc08466189dd59b0262c1daed5
parent c9c78e9c224b70771350fb98475d2c59dc5096be
Author: yao-msft <50888816+yao-msft@users.noreply.github.com>
Date:   Fri,  8 Apr 2022 12:29:18 -0700

Add nuget publish pipeline for in-proc Com binaries (#2077)


Diffstat:
M.github/actions/spelling/allow.txt | 1+
AWinGetInProcCom.nuspec | 29+++++++++++++++++++++++++++++
Aazure-pipelines.nuget.in-proc-com.yml | 140+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mazure-pipelines.nuget.yml | 2+-
Msrc/AppInstallerCLI.sln | 2++
5 files changed, 173 insertions(+), 1 deletion(-)

diff --git a/.github/actions/spelling/allow.txt b/.github/actions/spelling/allow.txt @@ -629,6 +629,7 @@ WINAPI WINEVENT winget wininet +winmd winmeta winres winrt diff --git a/WinGetInProcCom.nuspec b/WinGetInProcCom.nuspec @@ -0,0 +1,28 @@ +<?xml version="1.0"?> +<package > + <metadata> + <id>Microsoft.WindowsPackageManager.InProcCom</id> + <version>$version$</version> + <authors>Microsoft</authors> + <projectUrl>https://github.com/microsoft/winget-cli</projectUrl> + <license type="expression">MIT</license> + <requireLicenseAcceptance>true</requireLicenseAcceptance> + <description>Windows Package Manager In-Proc Com Binaries.</description> + <copyright>© Microsoft Corporation. All rights reserved.</copyright> + <tags>winget</tags> + </metadata> + <files> + <file src="src\x64\Release\WindowsPackageManager\WindowsPackageManager.dll" target="runtimes\win-x64\native\WindowsPackageManager.dll"/> + <file src="src\x64\Release\WindowsPackageManager\WindowsPackageManager.pdb" target="runtimes\win-x64\native\WindowsPackageManager.pdb"/> + <file src="src\x64\Release\Microsoft.Management.Deployment.InProc\Microsoft.Management.Deployment.InProc.dll" target="runtimes\win-x64\native\Microsoft.Management.Deployment.InProc.dll"/> + <file src="src\x64\Release\Microsoft.Management.Deployment.InProc\Microsoft.Management.Deployment.InProc.pdb" target="runtimes\win-x64\native\Microsoft.Management.Deployment.InProc.pdb"/> + <file src="src\x64\Release\Microsoft.Management.Deployment.InProc\Microsoft.Management.Deployment.InProc.dll.manifest" target="runtimes\win-x64\native\Microsoft.Management.Deployment.InProc.dll.manifest"/> + <file src="src\x64\Release\Microsoft.Management.Deployment\Microsoft.Management.Deployment.winmd" target="runtimes\win-x64\native\Microsoft.Management.Deployment.winmd"/> + <file src="src\x86\Release\WindowsPackageManager\WindowsPackageManager.dll" target="runtimes\win-x86\native\WindowsPackageManager.dll"/> + <file src="src\x86\Release\WindowsPackageManager\WindowsPackageManager.pdb" target="runtimes\win-x86\native\WindowsPackageManager.pdb"/> + <file src="src\x86\Release\Microsoft.Management.Deployment.InProc\Microsoft.Management.Deployment.InProc.dll" target="runtimes\win-x86\native\Microsoft.Management.Deployment.InProc.dll"/> + <file src="src\x86\Release\Microsoft.Management.Deployment.InProc\Microsoft.Management.Deployment.InProc.pdb" target="runtimes\win-x86\native\Microsoft.Management.Deployment.InProc.pdb"/> + <file src="src\x86\Release\Microsoft.Management.Deployment.InProc\Microsoft.Management.Deployment.InProc.dll.manifest" target="runtimes\win-x86\native\Microsoft.Management.Deployment.InProc.dll.manifest"/> + <file src="src\x86\Release\Microsoft.Management.Deployment\Microsoft.Management.Deployment.winmd" target="runtimes\win-x86\native\Microsoft.Management.Deployment.winmd"/> + </files> +</package>+ \ No newline at end of file diff --git a/azure-pipelines.nuget.in-proc-com.yml b/azure-pipelines.nuget.in-proc-com.yml @@ -0,0 +1,140 @@ +trigger: none + +parameters: + - name: version + displayName: Version to stamp on binaries and nuget package. Should be in form of "major.minor", for example "1.0" + type: string + +pool: + vmImage: "windows-latest" + +variables: + solution: "src/AppInstallerCLI.sln" + buildConfiguration: "Release" + packageName: Microsoft.WindowsPackageManager.InProcCom + BuildVer: $[counter(${{ parameters.version }}, 1)] + version: ${{ parameters.version }}.$(BuildVer) + msbuildArgs: '/t:WindowsPackageManager;Microsoft_Management_Deployment_InProc' + +jobs: + - job: "Build" + timeoutInMinutes: 120 + steps: + - script: echo $(version) + + - task: NuGetToolInstaller@1 + displayName: Install Nuget + + # Restores all projects, including native (vcxproj) projects + - task: NuGetCommand@2 + displayName: Restore Solution + inputs: + restoreSolution: "$(solution)" + + - task: PowerShell@2 + displayName: Update Binary Version + inputs: + filePath: 'src\binver\Update-BinVer.ps1' + arguments: '-TargetFile binver\binver\version.h -BuildVersion $(BuildVer) -MajorMinorOverride ${{ parameters.version }}' + workingDirectory: "src" + + - task: VSBuild@1 + displayName: Build Solution x86 + inputs: + platform: "x86" + solution: "$(solution)" + configuration: "$(buildConfiguration)" + msbuildArgs: "$(msbuildArgs)" + + - task: VSBuild@1 + displayName: Build Solution x64 + inputs: + platform: "x64" + solution: "$(solution)" + configuration: "$(buildConfiguration)" + msbuildArgs: "$(msbuildArgs)" + + - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 + displayName: "ESRP CodeSigning - Package contents" + inputs: + ConnectedServiceName: "WindowsPackageManager ESRP CodeSigning" + FolderPath: src + Pattern: | + *\$(buildConfiguration)\WindowsPackageManager\WindowsPackageManager.dll + *\$(buildConfiguration)\Microsoft.Management.Deployment.InProc\Microsoft.Management.Deployment.InProc.dll + *\$(buildConfiguration)\Microsoft.Management.Deployment\Microsoft.Management.Deployment.winmd + UseMinimatch: true + signConfigType: inlineSignParams + inlineOperation: | + [ + { + "KeyCode" : "CP-230012", + "OperationCode" : "SigntoolSign", + "Parameters" : { + "OpusName" : "Microsoft", + "OpusInfo" : "http://www.microsoft.com", + "FileDigest" : "/fd \"SHA256\"", + "PageHash" : "/NPH", + "TimeStamp" : "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" + }, + "ToolName" : "sign", + "ToolVersion" : "1.0" + }, + { + "KeyCode" : "CP-230012", + "OperationCode" : "SigntoolVerify", + "Parameters" : {}, + "ToolName" : "sign", + "ToolVersion" : "1.0" + } + ] + + - task: NuGetCommand@2 + displayName: Pack WingetInProcCom nuget package + inputs: + command: pack + packagesToPack: WinGetInProcCom.nuspec + versioningScheme: byEnvVar + versionEnvVar: version + packDestination: "$(Build.ArtifactStagingDirectory)" + + - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 + displayName: "ESRP CodeSigning - NuGet package" + inputs: + ConnectedServiceName: "WindowsPackageManager ESRP CodeSigning" + FolderPath: "$(Build.ArtifactStagingDirectory)" + Pattern: "$(packageName).$(version).nupkg" + signConfigType: inlineSignParams + inlineOperation: | + [ + { + "KeyCode" : "CP-401405", + "OperationCode" : "NuGetSign", + "Parameters" : {}, + "ToolName" : "sign", + "ToolVersion" : "1.0" + }, + { + "KeyCode" : "CP-401405", + "OperationCode" : "NuGetVerify", + "Parameters" : {}, + "ToolName" : "sign", + "ToolVersion" : "1.0" + } + ] + + - task: PublishBuildArtifacts@1 + displayName: Publish nuget package to artifacts + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)\$(packageName).$(version).nupkg' + ArtifactName: $(packageName) + publishLocation: Container + + - task: NuGetCommand@2 + displayName: Push WingetInProcCom nuget package to nuget.org + inputs: + command: push + nuGetFeedType: external + includeNugetOrg: true + packagesToPush: '$(Build.ArtifactStagingDirectory)\$(packageName).$(version).nupkg' + publishFeedCredentials: "WindowsPackageManagerAzurePipelineNuget - NuGet.org" diff --git a/azure-pipelines.nuget.yml b/azure-pipelines.nuget.yml @@ -120,7 +120,7 @@ jobs: inputs: ConnectedServiceName: "WindowsPackageManager ESRP CodeSigning" FolderPath: "$(Build.ArtifactStagingDirectory)" - Pattern: "Microsoft.Packaging.WinGetUtil.$(version).nupkg" + Pattern: "$(packageName).$(version).nupkg" signConfigType: inlineSignParams inlineOperation: | [ diff --git a/src/AppInstallerCLI.sln b/src/AppInstallerCLI.sln @@ -21,11 +21,13 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Project", "Project", "{8D53D749-D51C-46F8-A162-9371AAA6C2E7}" ProjectSection(SolutionItems) = preProject ..\azure-pipelines.loc.yml = ..\azure-pipelines.loc.yml + ..\azure-pipelines.nuget.in-proc-com.yml = ..\azure-pipelines.nuget.in-proc-com.yml ..\azure-pipelines.nuget.yml = ..\azure-pipelines.nuget.yml ..\azure-pipelines.yml = ..\azure-pipelines.yml ..\cgmanifest.json = ..\cgmanifest.json ..\README.md = ..\README.md ..\doc\Settings.md = ..\doc\Settings.md + ..\WinGetInProcCom.nuspec = ..\WinGetInProcCom.nuspec ..\WinGetUtil.nuspec = ..\WinGetUtil.nuspec EndProjectSection EndProject