Skip to content

Commit

Permalink
Stable version file and link (#4551) (#4552)
Browse files Browse the repository at this point in the history
Co-authored-by: Justin Anderson <[email protected]>
  • Loading branch information
github-actions[bot] and jander-msft authored Jun 7, 2023
1 parent c87dafc commit ff6a79b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/generate-release-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
if [[ "$TEST_RUN" == "true" ]]; then
qualified_release_version="test-$release_version"
else
version_url="https://aka.ms/dotnet/diagnostics/monitor${major_minor_version}/release/dotnet-monitor-win-x64.zip.version"
version_url="https://aka.ms/dotnet/diagnostics/monitor${major_minor_version}/release/dotnet-monitor.version"
qualified_release_version=$(curl -sL $version_url)
# Check if the aka.ms url existed
if [[ "$qualified_release_version" =~ "<html" || -z "$qualified_release_version" ]]; then
Expand Down
28 changes: 27 additions & 1 deletion eng/Publishing.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<PropertyGroup>
<PublishDependsOnTargets>$(PublishDependsOnTargets);CollectPackageArtifactFiles</PublishDependsOnTargets>
<PublishDependsOnTargets>$(PublishDependsOnTargets);CollectPackageArtifactFiles;CollectVersionArtifactFiles</PublishDependsOnTargets>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -200,5 +200,31 @@
</ItemGroup>
</Target>

<Target Name="CollectVersionArtifactFiles"
DependsOnTargets="CalculateBlobGroupAndBuildVersion">
<PropertyGroup>
<VersionFileName>dotnet-monitor-$(_BuildVersion).version</VersionFileName>
<VersionFilePath>$(ArtifactsTmpDir)$(VersionFileName)</VersionFilePath>
<VersionValue Condition="'$(DotnetFinalVersionKind)' == 'release'">$(_OriginalVersionPrefix)</VersionValue>
<VersionValue Condition="'$(DotnetFinalVersionKind)' != 'release'">$(_BuildVersion)</VersionValue>
</PropertyGroup>

<!-- Write three-part version number -->
<WriteLinesToFile File="$(VersionFilePath)"
Lines="$(VersionValue)" />

<!--
Place product version files into versioned container; this will cause the auto aka.ms link generation
to be something like aka.ms/dotnet/diagnostics/monitor{Major.Minor}/release/dotnet-monitor.version; this
is used to provide a stable production version file and link regardless of the actual product packages.
-->
<ItemGroup>
<ItemsToPushToBlobFeed Include="$(VersionFilePath)" Condition="'$(_BlobGroupName)' != ''">
<RelativeBlobPath>diagnostics/monitor$(_BlobGroupName)/$(VersionFileName)</RelativeBlobPath>
<PublishFlatContainer>true</PublishFlatContainer>
</ItemsToPushToBlobFeed>
</ItemGroup>
</Target>

<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />
</Project>

0 comments on commit ff6a79b

Please sign in to comment.