Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Automatic suffix generation for DTFx.Core and DTFx.AzureStorage #1025

Merged
merged 9 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion azure-pipelines-release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
trigger: none
trigger:
- main
- dajusto/patch-nightly-build
davidmrdavid marked this conversation as resolved.
Show resolved Hide resolved

pr: none

pool:
name: '1ES-Hosted-DurableTaskFramework'
demands:
- ImageOverride -equals MMS2022TLS

variables:

- name: PackageSuffix
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems PackageSuffix serves the same purpose as VersionSuffix. Was there a reason not to simply assign VersionSuffix directly as an alternative to creating a new build variable?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've unified them in VersionSuffix. I think I had made them differently because I wasn't sure to what extend I could just continue reading env variables in the .csproj. So far, it seems like I can do that with no restrictions, so I've removed the VersionSuffix xml variable I introduced and replaced it with this env var.

${{ if eq(variables['Build.Reason'], 'IndividualCI') }}:
cgillum marked this conversation as resolved.
Show resolved Hide resolved
value: 'ci.$(Build.BuildNumber)'
${{ else }}:
value: ''

steps:
# Start by restoring all the dependencies. This needs to be its own task
# from what I can tell. We specifically only target DurableTask.AzureStorage
Expand Down
12 changes: 9 additions & 3 deletions src/DurableTask.AzureStorage/DurableTask.AzureStorage.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,21 @@
<MajorVersion>1</MajorVersion>
<MinorVersion>17</MinorVersion>
<PatchVersion>1</PatchVersion>

<VersionSuffix>$(PackageSuffix)</VersionSuffix>
<VersionPrefix>$(MajorVersion).$(MinorVersion).$(PatchVersion)</VersionPrefix>
<FileVersion>$(VersionPrefix).0</FileVersion>
<!-- FileVersionRevision is expected to be set by the CI. This is useful for distinguishing between multiple builds of the same version. -->
<FileVersion Condition="'$(FileVersionRevision)' != ''">$(VersionPrefix).$(FileVersionRevision)</FileVersion>
<!-- The assembly version is only the major/minor pair, making it easier to do in-place upgrades -->
<AssemblyVersion>$(MajorVersion).$(MinorVersion).0.0</AssemblyVersion>
<!-- This version is used as the nuget package version -->
<Version>$(VersionPrefix)</Version>
</PropertyGroup>

<!-- This version is used as the nuget package version -->
<PropertyGroup Condition="$(VersionSuffix) == ''">
<Version>$(MajorVersion).$(MinorVersion).$(PatchVersion)</Version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we continue to use $(VersionPrefix) like we were before, or did you have a reason to remove it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've re-added it. I can't recall exactly why I removed it (a local version of this PR has been sitting on my devbox for a while).

</PropertyGroup>
<PropertyGroup Condition="$(VersionSuffix) != ''">
<Version>$(MajorVersion).$(MinorVersion).$(PatchVersion)-$(VersionSuffix)</Version>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
Expand Down
12 changes: 9 additions & 3 deletions src/DurableTask.Core/DurableTask.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,21 @@
<MajorVersion>2</MajorVersion>
<MinorVersion>16</MinorVersion>
<PatchVersion>2</PatchVersion>

<VersionSuffix>$(PackageSuffix)</VersionSuffix>
<VersionPrefix>$(MajorVersion).$(MinorVersion).$(PatchVersion)</VersionPrefix>
<FileVersion>$(VersionPrefix).0</FileVersion>
<!-- FileVersionRevision is expected to be set by the CI. This is useful for distinguishing between multiple builds of the same version. -->
<FileVersion Condition="'$(FileVersionRevision)' != ''">$(VersionPrefix).$(FileVersionRevision)</FileVersion>
<!-- The assembly version is only the major/minor pair, making it easier to do in-place upgrades -->
<AssemblyVersion>$(MajorVersion).$(MinorVersion).0.0</AssemblyVersion>
<!-- This version is used as the nuget package version -->
<Version>$(VersionPrefix)</Version>
</PropertyGroup>

<!-- This version is used as the nuget package version -->
<PropertyGroup Condition="$(VersionSuffix) == ''">
<Version>$(MajorVersion).$(MinorVersion).$(PatchVersion)</Version>
</PropertyGroup>
<PropertyGroup Condition="$(VersionSuffix) != ''">
<Version>$(MajorVersion).$(MinorVersion).$(PatchVersion)-$(VersionSuffix)</Version>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
Expand Down