Skip to content

Commit d4dc84b

Browse files
authored
Moved pipelines files into single repo (#106)
* Moved pipelines files into single repo * Fixed binding issue and added method to get token from accesstokencache * Updated global.json version * Added checkout to package signing * fix typo * Trying new dotnet version for code signing * Fixed function headers * added some user agent logic * Fixed user agent header test * Updated packages --------- Co-authored-by: Mikael Weaver <[email protected]>
1 parent c0f25c3 commit d4dc84b

26 files changed

+354
-157
lines changed

.azdo/pipelines/ci-pipeline.yml

+4-10
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44
name: $(SourceBranchName)-$(Date:yyyyMMdd)$(Rev:-r)
55
trigger: none
66

7-
resources:
8-
repositories:
9-
- repository: azure-health-data-services-toolkit-build-tools
10-
type: git
11-
name: AzureHealthDataServicesToolkit/azure-health-data-services-toolkit-build-tools
12-
137
variables:
148
- group: toolkit-test-pack
159
- group: toolkit-build-version-configuration
@@ -41,7 +35,7 @@ stages:
4135
AssemblyVersion: $(ReleaseAssemblyVersion)
4236
FileVersion: $(ReleaseFileVersion)
4337

44-
- ${{if and(in(variables['Build.Reason'], 'Manual', ''), eq(variables['System.TeamProject'], 'AzureHealthDataServicesToolkit'))}}:
38+
- ${{if and(in(variables['Build.Reason'], 'Manual', ''), eq(variables['System.TeamProject'], 'AppliedOpenSourceTools'))}}:
4539
- template: ./steps/pack.yml
4640
parameters:
4741
PackageArtifactName: PrereleasePackages
@@ -50,15 +44,15 @@ stages:
5044
FileVersion: $(PrereleaseFileVersion)
5145

5246
# Run release only on manual build (Build.Reason is sometimes blank here) against the internal project. Run for both release and pre-release
53-
- ${{if and(in(variables['Build.Reason'], 'Manual', ''), eq(variables['System.TeamProject'], 'AzureHealthDataServicesToolkit'))}}:
47+
- ${{if and(in(variables['Build.Reason'], 'Manual', ''), eq(variables['System.TeamProject'], 'AppliedOpenSourceTools'))}}:
5448
- template: ./stages/release.yml
5549
parameters:
5650
PackageArtifactName: PrereleasePackages
57-
DevOpsFeedID: AzureHealthDataServicesToolkit/AzureHealthDataServicesToolkitInternal
51+
DevOpsFeedID: AppliedOpenSourceTools/AzureHealthDataServicesToolkitInternal
5852
IsPrerelease: true
5953

6054
- template: ./stages/release.yml
6155
parameters:
6256
PackageArtifactName: ReleasePackages
63-
DevOpsFeedID: AzureHealthDataServicesToolkit/AzureHealthDataServicesToolkitInternal
57+
DevOpsFeedID: AppliedOpenSourceTools/AzureHealthDataServicesToolkitInternal
6458
IsPrerelease: false
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
param (
2+
$packagePath
3+
)
4+
5+
$packages = Get-ChildItem -Path $packagePath -Filter '*.nupkg'
6+
7+
ForEach ($package in $packages) {
8+
$renamedPath = "{0}/{1}.zip" -f $packagePath, $package.BaseName
9+
Move-Item -Path $package.FullName -Destination $renamedPath
10+
11+
$destPath = Join-Path -Path $packagePath -ChildPath $package.BaseName
12+
Expand-Archive -Path $renamedPath -DestinationPath $destPath
13+
Remove-Item -Path $renamedPath
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
param (
2+
$packageFolderPath,
3+
$signedPath
4+
)
5+
6+
# Create directory for signed packages
7+
New-Item $signedPath -ItemType Directory
8+
9+
# Get directory of expanded packages
10+
$directories = Get-ChildItem -Path $packageFolderPath -Directory
11+
12+
# Repack into nuget packages (and remove folder)
13+
ForEach ($directory in $directories) {
14+
$directoryWithoutRootFolder = "{0}/*" -f $directory.FullName
15+
$zipFileName = "{0}.zip" -f $directory.Name
16+
$zipPath = Join-Path -Path $signedPath -ChildPath $zipFileName
17+
Compress-Archive -Path $directoryWithoutRootFolder -DestinationPath $zipPath
18+
19+
$packageFileName = "{0}.nupkg" -f $directory.Name
20+
$packagePath = Join-Path -Path $signedPath -ChildPath $packageFileName
21+
Move-Item -Path $zipPath -Destination $packagePath
22+
Remove-Item -LiteralPath $directory.FullName -Force -Recurse
23+
}

.azdo/pipelines/stages/release.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ parameters:
99
- name: RepositoryName
1010
default: microsoft/azure-health-data-services-toolkit
1111

12-
1312
stages:
1413
- stage: ${{ format('Signing_{0}', parameters.PackageArtifactName) }}
1514
displayName: 'Sign Code & Packages'
@@ -26,8 +25,8 @@ stages:
2625
- download: current
2726
artifact: ${{ parameters.PackageArtifactName }}
2827
timeoutInMinutes: 5
29-
30-
- template: pipelines/steps/package-signing.yml@azure-health-data-services-toolkit-build-tools
28+
29+
- template: ../steps/package-signing.yml
3130
parameters:
3231
PackagesPath: '$(Pipeline.Workspace)/${{ parameters.PackageArtifactName }}'
3332

@@ -72,7 +71,7 @@ stages:
7271
- download: current
7372
artifact: '${{ parameters.PackageArtifactName }}-signed'
7473

75-
- template: pipelines/steps/package-push-internal.yml@azure-health-data-services-toolkit-build-tools
74+
- template: ../steps/package-push-internal.yml
7675
parameters:
7776
ArtifactPath: '$(Pipeline.Workspace)/${{ parameters.PackageArtifactName }}-signed'
7877
PackageName: ${{ parameters.PackagePrefix }}
@@ -103,7 +102,7 @@ stages:
103102
- download: current
104103
artifact: '${{ parameters.PackageArtifactName }}-signed'
105104

106-
- template: pipelines/steps/package-push-nuget.yml@azure-health-data-services-toolkit-build-tools
105+
- template: ../steps/package-push-nuget.yml
107106
parameters:
108107
ArtifactPath: '$(Pipeline.Workspace)/${{ parameters.PackageArtifactName }}-signed'
109108
PackageName: ${{ parameters.PackagePrefix }}

.azdo/pipelines/steps/build.yml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ steps:
1616
arguments: '--configuration $(buildConfiguration) --no-incremental -p:ContinuousIntegrationBuild=true -warnaserror -f ${{parameters.targetBuildFramework}}'
1717
projects: '**/Microsoft.AzureHealth.DataServices.*.csproj'
1818
displayName: 'Build toolkit projects'
19+
1920
- task: DotNetCoreCLI@2
2021
inputs:
2122
command: 'build'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
parameters:
2+
- name: ArtifactPath
3+
- name: PackageName
4+
- name: DevOpsFeedID
5+
6+
steps:
7+
- pwsh: |
8+
if (Test-Path -Path '${{ parameters.ArtifactPath }}') {
9+
Write-Host "Folder ${{ parameters.ArtifactPath }} containing..."
10+
Get-ChildItem -Path '${{ parameters.ArtifactPath }}'
11+
} else {
12+
Throw 'Provided ArtifactPath does not exist: ${{ parameters.ArtifactPath }}'
13+
}
14+
displayName: 'Ensure provided ArtifactPath exists'
15+
16+
- task: NuGetCommand@2
17+
displayName: 'Publish ${{ parameters.PackageName }} package to DevOps Feed'
18+
inputs:
19+
command: push
20+
packagesToPush: '${{ parameters.ArtifactPath }}/${{ parameters.PackageName }}*.nupkg'
21+
nuGetFeedType: 'internal'
22+
publishVstsFeed: ${{ parameters.DevOpsFeedID }}
23+
allowPackageConflicts: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
parameters:
2+
- name: ArtifactPath
3+
- name: PackageName
4+
5+
steps:
6+
- pwsh: |
7+
if (Test-Path -Path '${{ parameters.ArtifactPath }}') {
8+
Write-Host "Folder ${{ parameters.ArtifactPath }} containing..."
9+
Get-ChildItem -Path '${{ parameters.ArtifactPath }}'
10+
} else {
11+
Throw 'Provided ArtifactPath does not exist: ${{ parameters.ArtifactPath }}'
12+
}
13+
displayName: 'Ensure provided ArtifactPath exists'
14+
15+
- task: NuGetCommand@2
16+
displayName: 'Publish ${{ parameters.PackageName }} package to NuGet.org'
17+
inputs:
18+
command: push
19+
packagesToPush: '${{ parameters.ArtifactPath }}/${{ parameters.PackageName }}*.nupkg'
20+
nuGetFeedType: 'external'
21+
publishFeedCredentials: 'NuGet ${{ parameters.PackageName }} Push'
+118
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
parameters:
2+
- name: PackagesPath
3+
type: string
4+
default: ''
5+
6+
steps:
7+
- checkout: self
8+
clean: true
9+
fetchDepth: 1
10+
11+
- task: UseDotNet@2
12+
displayName: 'Use .NET Core sdk (for code signing)'
13+
inputs:
14+
packageType: sdk
15+
version: 3.1.x
16+
17+
# Expand packages as zip
18+
- task: PowerShell@2
19+
displayName: 'Expand nuget packages'
20+
inputs:
21+
packagePath: filePath
22+
filePath: '$(Build.SourcesDirectory)/.azdo/pipelines/scripts/ExpandNugetPackages.ps1'
23+
arguments: '-packagePath "${{ parameters.PackagesPath }}"'
24+
25+
- task: EsrpCodeSigning@1
26+
displayName: 'Sign Package DLLs'
27+
inputs:
28+
ConnectedServiceName: 'ESRP Code Signing'
29+
FolderPath: '${{ parameters.PackagesPath }}'
30+
Pattern: 'Microsoft.AzureHealth.DataServices.*.dll,Microsoft.Capl.*.dll'
31+
UseMinimatch: false
32+
signConfigType: 'inlineSignParams'
33+
inlineOperation: |
34+
[
35+
{
36+
"keyCode": "CP-230012",
37+
"operationSetCode": "SigntoolSign",
38+
"parameters": [
39+
{
40+
"parameterName": "OpusName",
41+
"parameterValue": "Microsoft"
42+
},
43+
{
44+
"parameterName": "OpusInfo",
45+
"parameterValue": "http://www.microsoft.com"
46+
},
47+
{
48+
"parameterName": "PageHash",
49+
"parameterValue": "/NPH"
50+
},
51+
{
52+
"parameterName": "FileDigest",
53+
"parameterValue": "/fd sha256"
54+
},
55+
{
56+
"parameterName": "TimeStamp",
57+
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
58+
}
59+
],
60+
"toolName": "sign",
61+
"toolVersion": "1.0"
62+
},
63+
{
64+
"keyCode": "CP-230012",
65+
"operationSetCode": "SigntoolVerify",
66+
"parameters": [ ],
67+
"toolName": "sign",
68+
"toolVersion": "1.0"
69+
}
70+
]
71+
SessionTimeout: '60'
72+
MaxConcurrency: '50'
73+
MaxRetryAttempts: '5'
74+
75+
# Repackage with signed dlls
76+
- task: PowerShell@2
77+
displayName: 'Repack nuget packages'
78+
inputs:
79+
packagePath: filePath
80+
filePath: '$(Build.SourcesDirectory)/.azdo/pipelines/scripts/RepackNugetPackages.ps1'
81+
arguments: '-packageFolderPath "${{ parameters.PackagesPath }}" -signedPath "${{ parameters.PackagesPath }}-signed"'
82+
83+
- task: CopyFiles@2
84+
displayName: 'Copy symbols'
85+
inputs:
86+
sourceFolder: ${{ parameters.PackagesPath }}
87+
contents: '*.snupkg'
88+
targetFolder: ${{ parameters.PackagesPath }}-signed
89+
90+
# Sign Packages
91+
- task: EsrpCodeSigning@1
92+
displayName: 'Sign Nuget Packages'
93+
inputs:
94+
ConnectedServiceName: 'ESRP Code Signing'
95+
FolderPath: '${{ parameters.PackagesPath }}-signed/'
96+
Pattern: 'Microsoft.AzureHealth.DataServices*.nupkg,Microsoft.Capl*.nupkg'
97+
UseMinimatch: false
98+
signConfigType: 'inlineSignParams'
99+
inlineOperation: |
100+
[
101+
{
102+
"keyCode": "CP-401405",
103+
"operationSetCode": "NuGetSign",
104+
"parameters": [ ],
105+
"toolName": "sign",
106+
"toolVersion": "1.0"
107+
},
108+
{
109+
"keyCode": "CP-401405",
110+
"operationSetCode": "NuGetVerify",
111+
"parameters": [ ],
112+
"toolName": "sign",
113+
"toolVersion": "1.0"
114+
}
115+
]
116+
SessionTimeout: '60'
117+
MaxConcurrency: '50'
118+
MaxRetryAttempts: '5'

global.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"sdk": {
3-
"version": "7.0.203"
3+
"version": "7.0.302"
44
}
55
}

samples/FeatureSamples/BlobChannel/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
using Newtonsoft.Json;
1313

1414
#pragma warning disable CA1852
15-
internal class Program
15+
internal static class Program
1616
{
1717
private static async Task Main(string[] args)
1818
{

samples/FeatureSamples/CustomHeaders/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#pragma warning disable CA1852
1414

15-
internal class Program
15+
internal static class Program
1616
{
1717
private static void Main(string[] args)
1818
{

samples/FeatureSamples/EventHubChannel/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
using Microsoft.Extensions.Hosting;
1010

1111
#pragma warning disable CA1852
12-
internal class Program
12+
internal static class Program
1313
{
1414
private static async Task Main(string[] args)
1515
{

samples/FeatureSamples/ServiceBusChannel/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
using ServiceBusChannelSample;
1212

1313
#pragma warning disable CA1852
14-
internal class Program
14+
internal static class Program
1515
{
1616
private static async Task Main(string[] args)
1717
{

samples/Quickstart/src/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
using Quickstart.Filters;
1212

1313
#pragma warning disable CA1852
14-
internal class Program
14+
internal static class Program
1515
{
1616
private static async Task Main(string[] args)
1717
{

samples/Quickstart/tests/QuickstartSample.Tests.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />
1111
<PackageReference Include="Moq" Version="4.18.4" />
12-
<PackageReference Include="MSTest.TestAdapter" Version="3.0.2" />
13-
<PackageReference Include="MSTest.TestFramework" Version="3.0.2" />
12+
<PackageReference Include="MSTest.TestAdapter" Version="3.0.4" />
13+
<PackageReference Include="MSTest.TestFramework" Version="3.0.4" />
1414
</ItemGroup>
1515

1616
<!-- Default to version 1.0.0 if SdkVersion is not set -->

src/Microsoft.AzureHealth.DataServices.Channels/Microsoft.AzureHealth.DataServices.Channels.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Azure.Messaging.EventGrid" Version="4.16.0" />
12-
<PackageReference Include="Azure.Messaging.EventHubs" Version="5.9.1" />
13-
<PackageReference Include="Azure.Messaging.EventHubs.Processor" Version="5.9.1" />
14-
<PackageReference Include="Azure.Messaging.ServiceBus" Version="7.14.0" />
11+
<PackageReference Include="Azure.Messaging.EventGrid" Version="4.17.0" />
12+
<PackageReference Include="Azure.Messaging.EventHubs" Version="5.9.2" />
13+
<PackageReference Include="Azure.Messaging.EventHubs.Processor" Version="5.9.2" />
14+
<PackageReference Include="Azure.Messaging.ServiceBus" Version="7.15.0" />
1515
</ItemGroup>
1616

1717
<ItemGroup>

0 commit comments

Comments
 (0)