forked from Azure/azure-sdk-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathazuresdkpartnerdrops-to-nugetfeed.yml
More file actions
106 lines (94 loc) · 3.92 KB
/
azuresdkpartnerdrops-to-nugetfeed.yml
File metadata and controls
106 lines (94 loc) · 3.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
resources:
repositories:
- repository: azure-sdk-build-tools
type: git
name: internal/azure-sdk-build-tools
ref: refs/tags/azure-sdk-build-tools_20240910.2
parameters:
- name: BuildToolsRepoPath
type: string
default: '$(Build.SourcesDirectory)/azure-sdk-build-tools'
- name: ArtifactsPath
type: string
default: '$(System.DefaultWorkingDirectory)/artifacts'
- name: PartnerDropsBlobBase
type: string
default: 'https://azuresdkpartnerdrops.blob.core.windows.net/drops'
- name: PartnerDropsBlobSourceSuffix
type: string
default: ''
- name: NugetVersion
type: string
default: '5.4.x'
- name: DevOpsFeedID
type: string
default: ''
- name: ShouldSign
type: boolean
default: true
- name: ShouldPublish
type: boolean
default: true
variables:
- template: /eng/pipelines/templates/variables/globals.yml
jobs:
- job: AzurePartnerDropsToNuget
pool:
name: azsdk-pool-mms-win-2022-general
vmImage: windows-2022
steps:
- checkout: self
- checkout: azure-sdk-build-tools
- task: AzurePowerShell@5
displayName: 'Copy from azuresdkpartnerdrops'
condition: and(succeeded(), ne(variables['SkipCopyFromPartnerDrops'], 'true'))
inputs:
azureSubscription: 'azuresdkpartnerdrops - Storage Partner Drops'
ScriptType: 'InlineScript'
azurePowerShellVersion: LatestVersion
pwsh: true
Inline: |
echo "azcopy copy '${{ parameters.PartnerDropsBlobBase }}/${{ parameters.PartnerDropsBlobSourceSuffix }}/*' '${{ parameters.ArtifactsPath }}' --recursive=true"
azcopy copy '${{ parameters.PartnerDropsBlobBase }}/${{ parameters.PartnerDropsBlobSourceSuffix }}/*' '${{ parameters.ArtifactsPath }}' --recursive=true
$copiedFiles = (dir '${{ parameters.ArtifactsPath }}' -r | % { $_.FullName })
echo "Copied files: $copiedFiles"
if (!$copiedFiles) {
echo "Failed to copy any files from '${{ parameters.PartnerDropsBlobBase }}/${{ parameters.PartnerDropsBlobSourceSuffix }}/*' please double check they exist"
exit 1
}
env:
AZCOPY_AUTO_LOGIN_TYPE: 'PSCRED'
- ${{ if eq(parameters.ShouldSign, true) }}:
- template: pipelines/steps/net-signing.yml@azure-sdk-build-tools
parameters:
PackagesPath: ${{ parameters.ArtifactsPath }}
BuildToolsPath: ${{ parameters.BuildToolsRepoPath }}
- ${{ if eq(parameters.ShouldPublish, true) }}:
- template: pipelines/steps/publish-symbols.yml@azure-sdk-build-tools
parameters:
BuildToolsRepositoryPath: ${{ parameters.BuildToolsRepoPath }}
PackagesPath: ${{ parameters.ArtifactsPath }}
StagingDirectory: $(Build.ArtifactStagingDirectory)/symbols
- task: NuGetToolInstaller@1
displayName: 'Use NuGet ${{ parameters.NugetVersion }}'
inputs:
versionSpec: ${{ parameters.NugetVersion }}
- ${{ if ne(parameters.DevOpsFeedID, '') }}:
- task: NuGetCommand@2
displayName: 'Publish to DevOps Feed'
inputs:
command: push
packagesToPush: '${{ parameters.ArtifactsPath }}/**/*.nupkg;!${{ parameters.ArtifactsPath }}/**/*.symbols.nupkg'
publishVstsFeed: ${{ parameters.DevOpsFeedID }}
- ${{ if eq(parameters.DevOpsFeedID, '') }}:
- task: NuGetCommand@2
displayName: 'Publish to Nuget'
inputs:
command: push
packagesToPush: '${{ parameters.ArtifactsPath }}/**/*.nupkg;!${{ parameters.ArtifactsPath }}/**/*.symbols.nupkg'
nuGetFeedType: external
publishFeedCredentials: Nuget.org
- publish: '${{ parameters.ArtifactsPath }}'
displayName: Upload Packages to Artifacts
artifact: packages
condition: succeeded()