forked from microsoft/winget-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Azure pipeline to generate and publish Microsoft.WindowsPackageManage…
…r.Utils nuget package (microsoft#741)
- Loading branch information
Showing
6 changed files
with
201 additions
and
9 deletions.
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
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
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,20 @@ | ||
<?xml version="1.0"?> | ||
<package > | ||
<metadata> | ||
<id>Microsoft.WindowsPackageManager.Utils</id> | ||
<version>$version$</version> | ||
<title></title> | ||
<authors>Microsoft</authors> | ||
<owners></owners> | ||
<projectUrl>https://github.com/microsoft/winget-cli</projectUrl> | ||
<license type="expression">MIT</license> | ||
<requireLicenseAcceptance>true</requireLicenseAcceptance> | ||
<description>The utility binary for use with the WinGet CLI.</description> | ||
<copyright>© Microsoft Corporation. All rights reserved.</copyright> | ||
<tags>winget</tags> | ||
</metadata> | ||
<files> | ||
<file src="src\x64\Release\WinGetUtil\WinGetUtil.dll" target="runtimes\win-x64\native\WinGetUtil.dll"/> | ||
<file src="src\x86\Release\WinGetUtil\WinGetUtil.dll" target="runtimes\win-x86\native\WinGetUtil.dll"/> | ||
</files> | ||
</package> |
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,143 @@ | ||
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.Utils | ||
|
||
jobs: | ||
- job: "Build" | ||
variables: | ||
BuildVer: $[counter(${{ parameters.version }}, 1)] | ||
version: ${{ parameters.version }}.$(BuildVer) | ||
steps: | ||
- script: echo $(version) | ||
|
||
- task: NuGetToolInstaller@1 | ||
displayName: Install Nuget | ||
|
||
# Restores all projects, including native (vcxproj) projects | ||
- task: NuGetCommand@2 | ||
displayName: Restore Packages | ||
inputs: | ||
restoreSolution: "$(solution)" | ||
|
||
# Restores only .NET core projects, but is still necessary, as without this the IndexCreationTool and LocalhostWebServer projects fail to build | ||
- task: DotNetCoreCLI@2 | ||
displayName: DotNet Restore | ||
inputs: | ||
command: "restore" | ||
projects: "**/*.csproj" | ||
|
||
- task: PowerShell@2 | ||
displayName: Update Binary Version | ||
condition: not(eq(variables['Build.Reason'], 'PullRequest')) | ||
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)" | ||
|
||
- task: VSBuild@1 | ||
displayName: Build Solution x64 | ||
inputs: | ||
platform: "x64" | ||
solution: "$(solution)" | ||
configuration: "$(buildConfiguration)" | ||
|
||
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 | ||
displayName: "ESRP CodeSigning - Package contents" | ||
inputs: | ||
ConnectedServiceName: "WindowsPackageManager ESRP CodeSigning" | ||
FolderPath: src | ||
Pattern: | | ||
*\$(buildConfiguration)\WinGetUtil\WinGetUtil.dll | ||
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 WingetUtil nuget package | ||
inputs: | ||
command: pack | ||
packagesToPack: WinGetUtil.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: "Microsoft.Packaging.WinGetUtil.$(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 WingetUtil nuget package to nuget.org | ||
inputs: | ||
command: push | ||
nuGetFeedType: external | ||
includeNugetOrg: true | ||
packagesToPush: '$(Build.ArtifactStagingDirectory)\$(packageName).$(version).nupkg' | ||
publishFeedCredentials: "WindowsPackageManagerAzurePipelineNuget - NuGet.org" |
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
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