Skip to content

Commit

Permalink
automatically generate version suffixes (#2709)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmrdavid authored Jan 9, 2024
1 parent 86da162 commit 5d0219d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
4 changes: 4 additions & 0 deletions azure-pipelines-release-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ pool:
demands:
- ImageOverride -equals MMS2022TLS

variables:

- name: PackageSuffix
value: 'ci.$(Build.BuildNumber)' # the "ci" section is to denote this payload is automatically released by the CI
steps:

# Configure all the .NET SDK versions we need
Expand Down
11 changes: 11 additions & 0 deletions azure-pipelines-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ pool:
demands:
- ImageOverride -equals MMS2022TLS

variables:

- name: PackageSuffix
# if source branch is not `dev` then we're generating a release based on a feature branch
# In that case, we populate the environment variable "PackageSuffix" accordingly
${{ if ne(variables['Build.SourceBranchName'], 'dev') }}:
value: 'pr.$(Build.BuildNumber)' # the "pr" section is to denote this code is a candidate to be PR'ed
${{ else }}:
value: ''


steps:

# Configure all the .NET SDK versions we need
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<MajorVersion>2</MajorVersion>
<MinorVersion>13</MinorVersion>
<PatchVersion>1</PatchVersion>
<Version>$(MajorVersion).$(MinorVersion).$(PatchVersion)</Version>
<VersionSuffix>$(PackageSuffix)</VersionSuffix>
<FileVersion>$(MajorVersion).$(MinorVersion).$(PatchVersion)</FileVersion>
<AssemblyVersion>$(MajorVersion).0.0.0</AssemblyVersion>
<Company>Microsoft Corporation</Company>
Expand All @@ -21,6 +21,14 @@
<NoWarn>NU5125;SA0001</NoWarn>
</PropertyGroup>

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


<!-- NuGet Publishing Metadata -->
<PropertyGroup>
<Title>Azure Functions Durable Task Extension</Title>
Expand Down

0 comments on commit 5d0219d

Please sign in to comment.