Skip to content
Merged
2 changes: 1 addition & 1 deletion eng/promote-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ stages:
exit 1
}

$channels = ${Env:PromoteToChannelIds} -split ","
$channels = ${Env:PromoteToChannelIds} -split "-"
foreach ($channelId in $channels) {
$channelApiEndpoint = "$(MaestroApiEndPoint)/api/channels/${channelId}?api-version=$(MaestroApiVersion)"
$channelInfo = try { Invoke-WebRequest -Method Get -Uri $channelApiEndpoint -Headers $apiHeaders | ConvertFrom-Json } catch { Write-Host "Error: $_" }
Expand Down
3 changes: 2 additions & 1 deletion src/Microsoft.DotNet.Build.Tasks.Feed/src/BlobFeedAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,9 @@ public async Task UploadAssetAsync(
}
else
{
FileStream stream = new FileStream(item.ItemSpec, FileMode.Open, FileAccess.Read, FileShare.Read);
Comment thread
epananth marked this conversation as resolved.
Outdated
Log.LogMessage($"Uploading {item} to {relativeBlobPath}.");
await blobUtils.UploadBlockBlobAsync(item.ItemSpec, relativeBlobPath);
await blobUtils.UploadBlockBlobAsync(item.ItemSpec, relativeBlobPath, stream);
}
}
catch (Exception exc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public async Task<bool> ExecuteAsync()
IMaestroApi client = ApiFactory.GetAuthenticated(MaestroApiEndpoint, BuildAssetRegistryToken);
Maestro.Client.Models.Build buildInformation = await client.Builds.GetBuildAsync(BARBuildId);

var targetChannelsIds = TargetChannels.Split(',').Select(ci => int.Parse(ci));
var targetChannelsIds = TargetChannels.Split('-').Select(ci => int.Parse(ci));

foreach (var targetChannelId in targetChannelsIds)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public override async Task<bool> ExecuteAsync()
{
List<int> targetChannelsIds = new List<int>();

foreach (var channelIdStr in TargetChannels.Split(','))
foreach (var channelIdStr in TargetChannels.Split('-'))
{
if (!int.TryParse(channelIdStr, out var channelId))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static string CalculateMD5(string filename)
}
}

public async Task UploadBlockBlobAsync(string filePath, string blobPath)
public async Task UploadBlockBlobAsync(string filePath, string blobPath, Stream stream)
{
BlobClient blob = GetBlob(blobPath.Replace("\\", "/"));
BlobHttpHeaders headers = GetBlobHeadersByExtension(filePath);
Expand All @@ -83,7 +83,7 @@ public async Task UploadBlockBlobAsync(string filePath, string blobPath)
try
{
await blob.UploadAsync(
filePath,
stream,
headers)
.ConfigureAwait(false);
return true;
Expand Down