diff --git a/scripts/publish/publish.ps1 b/scripts/publish/publish.ps1 index f5100480e..328b1b324 100644 --- a/scripts/publish/publish.ps1 +++ b/scripts/publish/publish.ps1 @@ -51,13 +51,18 @@ function CheckRequiredVariables function UploadFile($Blob, $Uploadfile) { - Write-Host "Uploading $Uploadfile to dotnet feed to.." + Write-Host "Uploading $Uploadfile to dotnet feed." + + if([string]::IsNullOrEmpty($env:HOME)) + { + $env:HOME=Get-Location + } # use azure cli to upload to blob storage. We cannot use Invoke-WebRequest to do this becuase azure has a max limit of 64mb that can be uploaded using REST #$statusCode = (Invoke-WebRequest -URI "$Upload_URI" -Method PUT -Headers @{"x-ms-blob-type"="BlockBlob"; "x-ms-date"="2015-10-23";"x-ms-version"="2013-08-15"} -InFile $Uploadfile).StatusCode azure storage blob upload --quiet --container $env:STORAGE_CONTAINER --blob $Blob --blobtype block --connection-string "$env:CONNECTION_STRING" --file $Uploadfile | Out-Host - if($LastExitCode -eq 0) + if($?) { Write-Host "Successfully uploaded $Uploadfile to dotnet feed." return $true @@ -140,10 +145,10 @@ function UploadVersionBadge($badgeFile) $fileName = "windows_$Configuration_$([System.IO.Path]::GetFileName($badgeFile))" Write-Host "Uploading the version badge to Latest" - UploadFile "$env:CHANNEL/Binaries/Latest/$filename" $badgeFile + UploadFile "$env:CHANNEL/Binaries/Latest/$fileName" $badgeFile Write-Host "Uploading the version badge to $env:DOTNET_CLI_VERSION" - UploadFile "$env:CHANNEL/Binaries/$env:DOTNET_CLI_VERSION/$filename" $badgeFile + UploadFile "$env:CHANNEL/Binaries/$env:DOTNET_CLI_VERSION/$fileName" $badgeFile return 0 } diff --git a/scripts/publish/publish.sh b/scripts/publish/publish.sh index 63bec379d..01800ee25 100755 --- a/scripts/publish/publish.sh +++ b/scripts/publish/publish.sh @@ -192,7 +192,7 @@ upload_installers_to_blob_storage(){ upload_version_badge(){ local badgefile=$1 - local filename="$OSNAME_$CONFIGURATION_$(basename $badgefile)" + local filename="${OSNAME}_${CONFIGURATION}_$(basename $badgefile)" echo "Uploading the version badge to Latest" upload_file_to_blob_storage_azure_cli "$CHANNEL/Binaries/Latest/$filename" $badgefile