Skip to content

Commit 5d9f7c1

Browse files
authored
Updated to upload to azure SDK blob and F# issue of Path cannot be Null.
1 parent b2bce40 commit 5d9f7c1

File tree

2 files changed

+35
-13
lines changed

2 files changed

+35
-13
lines changed

azure-pipelines.yml

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,15 @@ steps:
3232
displayName: 'SBOM Generation Task'
3333
inputs:
3434
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+
3644
- task: EsrpCodeSigning@1
3745
inputs:
3846
ConnectedServiceName: 'Templates-Azure-IoT-Edge Sign'
@@ -59,6 +67,15 @@ steps:
5967
SessionTimeout: '20'
6068
MaxConcurrency: '50'
6169
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
6279

6380
- task: PublishBuildArtifacts@1
6481
inputs:
@@ -77,19 +94,24 @@ steps:
7794
tag: '$(Build.SourceBranch)'
7895
releaseNotesSource: 'input'
7996
assets: '$(Build.ArtifactStagingDirectory)/*.nupkg'
97+
isPreRelease: true
8098
addChangeLog: false
8199

82100
- 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'))
85102
inputs:
86103
targetType: 'inline'
87104
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"

content/dotnet-template-azure-iot-edge-module/FSharp/.template.config/template.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"preferNameDirectory": "true",
1616
"primaryOutputs": [
1717
{
18-
"path": ""
18+
"path": "."
1919
}
2020
],
2121
"symbols": {
@@ -52,4 +52,4 @@
5252
"continueOnError": true
5353
}
5454
]
55-
}
55+
}

0 commit comments

Comments
 (0)