diff --git a/eng/common/post-build/publish-using-darc.ps1 b/eng/common/post-build/publish-using-darc.ps1 index 6b68ee84728..599a1172419 100644 --- a/eng/common/post-build/publish-using-darc.ps1 +++ b/eng/common/post-build/publish-using-darc.ps1 @@ -16,8 +16,8 @@ param( try { . $PSScriptRoot\post-build-utils.ps1 - # Hard coding darc version till the next arcade-services roll out, cos this version has required API changes for darc add-build-to-channel - $darc = Get-Darc "1.1.0-beta.20418.1" + + $darc = Get-Darc $optionalParams = [System.Collections.ArrayList]::new() diff --git a/eng/promote-build.yml b/eng/promote-build.yml index cfe64e8df5e..49584685e8f 100644 --- a/eng/promote-build.yml +++ b/eng/promote-build.yml @@ -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: $_" } diff --git a/src/Microsoft.DotNet.Build.Tasks.Feed/src/BlobFeedAction.cs b/src/Microsoft.DotNet.Build.Tasks.Feed/src/BlobFeedAction.cs index 0c907bd0c71..77d64e62215 100644 --- a/src/Microsoft.DotNet.Build.Tasks.Feed/src/BlobFeedAction.cs +++ b/src/Microsoft.DotNet.Build.Tasks.Feed/src/BlobFeedAction.cs @@ -190,8 +190,12 @@ public async Task UploadAssetAsync( } else { - Log.LogMessage($"Uploading {item} to {relativeBlobPath}."); - await blobUtils.UploadBlockBlobAsync(item.ItemSpec, relativeBlobPath); + using (FileStream stream = + new FileStream(item.ItemSpec, FileMode.Open, FileAccess.Read, FileShare.Read)) + { + Log.LogMessage($"Uploading {item} to {relativeBlobPath}."); + await blobUtils.UploadBlockBlobAsync(item.ItemSpec, relativeBlobPath, stream); + } } } catch (Exception exc) diff --git a/src/Microsoft.DotNet.Build.Tasks.Feed/src/PublishArtifactsInManifest.cs b/src/Microsoft.DotNet.Build.Tasks.Feed/src/PublishArtifactsInManifest.cs index 24774eb8c93..7559ff755b7 100644 --- a/src/Microsoft.DotNet.Build.Tasks.Feed/src/PublishArtifactsInManifest.cs +++ b/src/Microsoft.DotNet.Build.Tasks.Feed/src/PublishArtifactsInManifest.cs @@ -231,7 +231,7 @@ public async Task 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) { diff --git a/src/Microsoft.DotNet.Build.Tasks.Feed/src/PublishArtifactsInManifestV3.cs b/src/Microsoft.DotNet.Build.Tasks.Feed/src/PublishArtifactsInManifestV3.cs index fa41af41e54..9d56f4438f6 100644 --- a/src/Microsoft.DotNet.Build.Tasks.Feed/src/PublishArtifactsInManifestV3.cs +++ b/src/Microsoft.DotNet.Build.Tasks.Feed/src/PublishArtifactsInManifestV3.cs @@ -69,7 +69,7 @@ public override async Task ExecuteAsync() { List targetChannelsIds = new List(); - foreach (var channelIdStr in TargetChannels.Split(',')) + foreach (var channelIdStr in TargetChannels.Split('-')) { if (!int.TryParse(channelIdStr, out var channelId)) { diff --git a/src/Microsoft.DotNet.Build.Tasks.Feed/src/common/AzureStorageUtils.cs b/src/Microsoft.DotNet.Build.Tasks.Feed/src/common/AzureStorageUtils.cs index d6fae8cd479..40f5b28cc45 100644 --- a/src/Microsoft.DotNet.Build.Tasks.Feed/src/common/AzureStorageUtils.cs +++ b/src/Microsoft.DotNet.Build.Tasks.Feed/src/common/AzureStorageUtils.cs @@ -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); @@ -83,7 +83,7 @@ public async Task UploadBlockBlobAsync(string filePath, string blobPath) try { await blob.UploadAsync( - filePath, + stream, headers) .ConfigureAwait(false); return true;