Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
41bb040
swtich to test source
VeryEarly Mar 1, 2021
e8d44c7
swtich to test source (#249)
VeryEarly Mar 1, 2021
6a3a137
update config
VeryEarly Mar 1, 2021
25b1f5c
Azure artifact (#250)
VeryEarly Mar 1, 2021
905208c
update comments
VeryEarly Mar 1, 2021
9fea6da
Azure artifact (#251)
VeryEarly Mar 1, 2021
ee21626
Merge branch 'azure-artifact' of https://github.com/Azure/azure-power…
VeryEarly Mar 1, 2021
29e02c9
update config
VeryEarly Mar 2, 2021
07d8e3d
update config
VeryEarly Mar 2, 2021
3389bda
update config
VeryEarly Mar 2, 2021
c13e146
update config
VeryEarly Mar 3, 2021
1d5722a
update config
VeryEarly Mar 3, 2021
7893b46
update config
VeryEarly Mar 3, 2021
1bc875a
update config
VeryEarly Mar 3, 2021
d57f10c
update config
VeryEarly Mar 3, 2021
561947f
remove parameter check no longer needed
VeryEarly Mar 4, 2021
26843ef
Set up CI with Azure Pipelines for YAML azure-powershell-common
VeryEarly Mar 4, 2021
86c97fc
test random apikey
VeryEarly Mar 8, 2021
c065eae
test random apikey
VeryEarly Mar 8, 2021
87cf0aa
try access key
VeryEarly Mar 9, 2021
230b4ed
try nuget authentication
VeryEarly Mar 10, 2021
ef496ee
try apikey
VeryEarly Mar 10, 2021
73b5481
remove apikey
VeryEarly Mar 10, 2021
4748029
use az as api key
VeryEarly Mar 10, 2021
0a3ae28
remove publish to nuget from publish.proj
VeryEarly Mar 12, 2021
efba363
Update Azure-PowerShell-Common-Publish.yml for Azure Pipelines
VeryEarly Mar 12, 2021
17eb8fa
Update Azure-PowerShell-Common-Publish.yml for Azure Pipelines
VeryEarly Mar 12, 2021
38e7ae0
Update Azure-PowerShell-Common-Publish.yml for Azure Pipelines
VeryEarly Mar 12, 2021
f95e685
Merge branch 'master' into azure-artifact
VeryEarly Mar 12, 2021
e9cc1bb
Update NuGet.config
VeryEarly Mar 15, 2021
d875e3c
Update Azure-PowerShell-Common-Publish.yml
VeryEarly Mar 15, 2021
a6ca658
Update Azure-PowerShell-Common-Publish.yml
VeryEarly Mar 15, 2021
42754dd
Update Azure-PowerShell-Common-Publish.yml
VeryEarly Mar 15, 2021
b82f5fe
specify nupkg pattern
VeryEarly Mar 16, 2021
9dac50d
fix pattern
VeryEarly Mar 16, 2021
bde286e
fix
VeryEarly Mar 16, 2021
e005040
add condition for publish
VeryEarly Mar 16, 2021
a5a675c
Merge branch 'master' into azure-artifact
VeryEarly Mar 17, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions .azure-pipelines/Azure-PowerShell-Common-Publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml

trigger:
- master

pool:
name: Hosted VS2017

variables:
- group: GitHub Release Variables

steps:
- powershell: |
# Write your PowerShell commands here.
if (-not ($env:VERSION -match "\d+\.\d+\.\d+"))
{
throw "The value of Version $env:VERSION must be format of X.X.X"
}

displayName: 'Check Version'

- task: UseDotNet@2
displayName: 'Use dotnet sdk 2.1.302'
inputs:
version: 2.1.302

- powershell: '$(Agent.ToolsDirectory)/dotnet/dotnet msbuild build.proj /t:Build /p:Configuration=Release /p:FileVersion=$env:VERSION /NoLogo'
displayName: build

- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: 'dll Signing'
inputs:
ConnectedServiceName: 'ESRP Signing Service'
FolderPath: artifacts
Pattern: |
Release\netstandard2.0\Microsoft.Azure.PowerShell*.dll
!Release\netstandard2.0\Microsoft.Azure.PowerShell*.Test.dll
UseMinimatch: true
signConfigType: inlineSignParams
inlineOperation: |
[
{
"KeyCode": "CP-233863-SN",
"OperationCode": "StrongNameSign",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
},
{
"KeyCode": "CP-233863-SN",
"OperationCode": "StrongNameVerify",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
},
{
"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"
}
]

- powershell: |
$(Agent.ToolsDirectory)/dotnet/dotnet msbuild build.proj /t:Pack /p:Configuration=Release /p:PackageVersion=$env:VERSION /NoLogo
displayName: pack

- task: NuGetAuthenticate@0
displayName: 'NuGet Authenticate'
condition: and(succeeded(), ne(variables['publish'], 'false'))

- task: NuGetCommand@2
displayName: 'NuGet push'
condition: and(succeeded(), ne(variables['publish'], 'false'))
inputs:
command: push
packagesToPush: 'artifacts/Package/Release/Microsoft.Azure.PowerShell.*.nupkg; !artifacts/Package/Release/*.symbols.nupkg'
publishVstsFeed: public/azure-powershell

- powershell: |
dotnet msbuild build\publish.proj /p:Configuration=Release /p:ReleaseVersion=$env:VERSION /p:CommitId=$env:Build_SourceVersion /p:GitHubAccessToken=$(Github-azuresdkci-personalaccesstoken) /NoLogo
displayName: 'publish package github'
condition: and(succeeded(), ne(variables['publish'], 'false'))

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact'
inputs:
PathtoPublish: artifacts/Package/Release/
ArtifactName: aitifacts
4 changes: 4 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
<configuration>
<packageSources>
<clear />
<add key="azure-powershell" value="https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-powershell/nuget/v3/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
<disabledPackageSources>
<clear />
</disabledPackageSources>
</configuration>
8 changes: 1 addition & 7 deletions build/publish.proj
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,12 @@
</PropertyGroup>

<Target Name="CheckRequiredParameters">
<Error Text="NuGetApiKey is not assigned a value!" Condition="'$(NuGetApiKey)' == ''" />
<Error Text="GitHubAccessToken is not assigned a value!" Condition="'$(GitHubAccessToken)' == ''" />
<Error Text="GitHubAccessToken is not assigned a value!" Condition="'$(GitHubAccessToken)' == ''" />
<Error Text="ReleaseVersion is not assigned a value!" Condition="'$(ReleaseVersion)' == ''" />
<Error Text="CommitId is not assigned a value!" Condition="'$(CommitId)' == ''" />
</Target>

<Target Name="All">
<Message Importance="high" Text="Publish: All started" />
<ItemGroup>
<PackagePaths Include="$(PackDir)*.nupkg" Exclude="$(PackDir)*symbols.nupkg" />
</ItemGroup>
<Exec Command="$(NuGet) push %(PackagePaths.FullPath) -ApiKey $(NuGetApiKey) -Source https://www.myget.org/F/azure-powershell/api/v2/package -SymbolSource https://www.myget.org/F/azure-powershell/symbols/api/v2/package -SymbolApiKey $(NuGetApiKey)" />
<PropertyGroup>
<!-- https://stackoverflow.com/a/41618979/294804 -->
<!-- https://stackoverflow.com/a/38054505/294804 -->
Expand Down