|
| 1 | +# Starter pipeline |
| 2 | +# Start with a minimal pipeline that you can customize to build and deploy your code. |
| 3 | +# Add steps that build, run tests, deploy, and more: |
| 4 | +# https://aka.ms/yaml |
| 5 | + |
| 6 | +trigger: |
| 7 | +- master |
| 8 | + |
| 9 | +pool: |
| 10 | + name: Hosted VS2017 |
| 11 | + |
| 12 | +variables: |
| 13 | +- group: GitHub Release Variables |
| 14 | + |
| 15 | +steps: |
| 16 | +- powershell: | |
| 17 | + # Write your PowerShell commands here. |
| 18 | + if (-not ($env:VERSION -match "\d+\.\d+\.\d+")) |
| 19 | + { |
| 20 | + throw "The value of Version $env:VERSION must be format of X.X.X" |
| 21 | + } |
| 22 | + |
| 23 | + displayName: 'Check Version' |
| 24 | + |
| 25 | +- task: UseDotNet@2 |
| 26 | + displayName: 'Use dotnet sdk 2.1.302' |
| 27 | + inputs: |
| 28 | + version: 2.1.302 |
| 29 | + |
| 30 | +- powershell: '$(Agent.ToolsDirectory)/dotnet/dotnet msbuild build.proj /t:Build /p:Configuration=Release /p:FileVersion=$env:VERSION /NoLogo' |
| 31 | + displayName: build |
| 32 | + |
| 33 | +- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 |
| 34 | + displayName: 'dll Signing' |
| 35 | + inputs: |
| 36 | + ConnectedServiceName: 'ESRP Signing Service' |
| 37 | + FolderPath: artifacts |
| 38 | + Pattern: | |
| 39 | + Release\netstandard2.0\Microsoft.Azure.PowerShell*.dll |
| 40 | + !Release\netstandard2.0\Microsoft.Azure.PowerShell*.Test.dll |
| 41 | + UseMinimatch: true |
| 42 | + signConfigType: inlineSignParams |
| 43 | + inlineOperation: | |
| 44 | + [ |
| 45 | + { |
| 46 | + "KeyCode": "CP-233863-SN", |
| 47 | + "OperationCode": "StrongNameSign", |
| 48 | + "Parameters": {}, |
| 49 | + "ToolName": "sign", |
| 50 | + "ToolVersion": "1.0" |
| 51 | + }, |
| 52 | + { |
| 53 | + "KeyCode": "CP-233863-SN", |
| 54 | + "OperationCode": "StrongNameVerify", |
| 55 | + "Parameters": {}, |
| 56 | + "ToolName": "sign", |
| 57 | + "ToolVersion": "1.0" |
| 58 | + }, |
| 59 | + { |
| 60 | + "KeyCode": "CP-230012", |
| 61 | + "OperationCode": "SigntoolSign", |
| 62 | + "Parameters": { |
| 63 | + "OpusName": "Microsoft", |
| 64 | + "OpusInfo": "http://www.microsoft.com", |
| 65 | + "FileDigest": "/fd \"SHA256\"", |
| 66 | + "PageHash": "/NPH", |
| 67 | + "TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" |
| 68 | + }, |
| 69 | + "ToolName": "sign", |
| 70 | + "ToolVersion": "1.0" |
| 71 | + }, |
| 72 | + { |
| 73 | + "KeyCode": "CP-230012", |
| 74 | + "OperationCode": "SigntoolVerify", |
| 75 | + "Parameters": {}, |
| 76 | + "ToolName": "sign", |
| 77 | + "ToolVersion": "1.0" |
| 78 | + } |
| 79 | + ] |
| 80 | +
|
| 81 | +- powershell: | |
| 82 | + $(Agent.ToolsDirectory)/dotnet/dotnet msbuild build.proj /t:Pack /p:Configuration=Release /p:PackageVersion=$env:VERSION /NoLogo |
| 83 | + displayName: pack |
| 84 | + |
| 85 | +- task: NuGetAuthenticate@0 |
| 86 | + displayName: 'NuGet Authenticate' |
| 87 | + condition: and(succeeded(), ne(variables['publish'], 'false')) |
| 88 | + |
| 89 | +- task: NuGetCommand@2 |
| 90 | + displayName: 'NuGet push' |
| 91 | + condition: and(succeeded(), ne(variables['publish'], 'false')) |
| 92 | + inputs: |
| 93 | + command: push |
| 94 | + packagesToPush: 'artifacts/Package/Release/Microsoft.Azure.PowerShell.*.nupkg; !artifacts/Package/Release/*.symbols.nupkg' |
| 95 | + publishVstsFeed: public/azure-powershell |
| 96 | + |
| 97 | +- powershell: | |
| 98 | + dotnet msbuild build\publish.proj /p:Configuration=Release /p:ReleaseVersion=$env:VERSION /p:CommitId=$env:Build_SourceVersion /p:GitHubAccessToken=$(Github-azuresdkci-personalaccesstoken) /NoLogo |
| 99 | + displayName: 'publish package github' |
| 100 | + condition: and(succeeded(), ne(variables['publish'], 'false')) |
| 101 | + |
| 102 | +- task: PublishBuildArtifacts@1 |
| 103 | + displayName: 'Publish Artifact' |
| 104 | + inputs: |
| 105 | + PathtoPublish: artifacts/Package/Release/ |
| 106 | + ArtifactName: aitifacts |
0 commit comments