@@ -32,7 +32,15 @@ steps:
32
32
displayName : ' SBOM Generation Task'
33
33
inputs :
34
34
BuildDropPath : ' $(Build.ArtifactStagingDirectory)'
35
-
35
+
36
+ - task : Bash@3
37
+ inputs :
38
+ targetType : ' inline'
39
+ script : |
40
+ if [[ $(Build.SourceBranch) =~ ^refs/tags/v?[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
41
+ echo "##vso[task.setvariable variable=NUGET_PUBLISH_FLAG;]true"
42
+ fi
43
+
36
44
- task : EsrpCodeSigning@1
37
45
inputs :
38
46
ConnectedServiceName : ' Templates-Azure-IoT-Edge Sign'
@@ -59,6 +67,15 @@ steps:
59
67
SessionTimeout : ' 20'
60
68
MaxConcurrency : ' 50'
61
69
MaxRetryAttempts : ' 5'
70
+
71
+ - task : PowerShell@2
72
+ condition : and(succeeded(), eq(variables['NUGET_PUBLISH_FLAG'], 'true'))
73
+ inputs :
74
+ targetType : ' inline'
75
+ script : |
76
+ $PACKAGEVERSION = $([xml]$(Get-Content Microsoft.Azure.IoT.Edge.Module.nuspec) | ForEach-Object package).metadata.version;
77
+ Write-Host "##vso[task.setvariable variable=PACKAGEVERSION;]$PACKAGEVERSION"
78
+ pwsh : true
62
79
63
80
- task : PublishBuildArtifacts@1
64
81
inputs :
@@ -77,19 +94,24 @@ steps:
77
94
tag : ' $(Build.SourceBranch)'
78
95
releaseNotesSource : ' input'
79
96
assets : ' $(Build.ArtifactStagingDirectory)/*.nupkg'
97
+ isPreRelease : true
80
98
addChangeLog : false
81
99
82
100
- task : Bash@3
83
- condition : and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
84
- displayName : " nuget Publishing"
101
+ condition : and(succeeded(), eq(variables['NUGET_PUBLISH_FLAG'], 'true'))
85
102
inputs :
86
103
targetType : ' inline'
87
104
script : |
88
- echo $(Build.SourceBranch)
89
- if [[ $(Build.SourceBranch) =~ ^refs/tags/v?[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
90
- echo "starting NuGet Push"
91
- nuget push *.nupkg $(apikey) -Source https://api.nuget.org/v3/index.json
92
- else
93
- echo "skipping NuGet Push"
94
- fi
95
- workingDirectory : ' $(Build.ArtifactStagingDirectory)'
105
+ wget https://aka.ms/downloadazcopy-v10-linux
106
+ tar -xvf downloadazcopy-v10-linux
107
+ sudo cp ./azcopy_linux_amd64_*/azcopy /usr/bin/
108
+
109
+ - task : Bash@3
110
+ displayName : ' Upload to Blob'
111
+ condition : and(succeeded(), eq(variables['NUGET_PUBLISH_FLAG'], 'true'))
112
+ inputs :
113
+ targetType : ' inline'
114
+ script : |
115
+ export AZCOPY_SPA_CLIENT_SECRET=$(AZURESDKPARTNERDROPS-SERVICE-PRINCIPAL-KEY)*
116
+ azcopy login --service-principal --application-id $(APPID)
117
+ azcopy copy "$(Build.ArtifactStagingDirectory)/Microsoft.Azure.IoT.Edge.Module.$(PACKAGEVERSION).nupkg" "https://azuresdkpartnerdrops.blob.core.windows.net/drops/azure-iot-edge-tools-templates-module/dotnet/$(PACKAGEVERSION)/Microsoft.Azure.IoT.Edge.Module.$(PACKAGEVERSION).nupkg"
0 commit comments