Skip to content

Commit

Permalink
add automatic suffix generation
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmrdavid committed Jan 5, 2024
1 parent da8a47a commit 805b7f8
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
12 changes: 12 additions & 0 deletions azure-pipelines-release-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,20 @@ pool:
demands:
- ImageOverride -equals MMS2022TLS

variables:
PackageSuffix: ''

steps:

- task: PowerShell@2
displayName: 'Populate PackageSuffix'
inputs:
targetType: 'inline'
script: |
# the "ci" section is to denote this payload is automatically released by the CI
$versionSuffix = ".ci.$(Build.BuildNumber)""
Write-Host "##vso[task.setvariable variable=PackageSuffix;]$versionSuffix"
# Configure all the .NET SDK versions we need
- task: UseDotNet@2
displayName: 'Use the .NET Core 2.1 SDK (required for build signing)'
Expand Down
16 changes: 16 additions & 0 deletions azure-pipelines-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,24 @@ pool:
demands:
- ImageOverride -equals MMS2022TLS

variables:
PackageSuffix: ''

steps:

- task: PowerShell@2
displayName: 'Populate PackageSuffix iff source branch is not dev'
inputs:
targetType: 'inline'
script: |
# 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($Env:BUILD_SOURCEBRANCHNAME -ne 'dev'){
# the "pr" section is to denote this code is a candidate to be PR'ed
$versionSuffix = "pr.$(Build.BuildNumber)"
Write-Host "##vso[task.setvariable variable=PackageSuffix;]$versionSuffix"
}
# Configure all the .NET SDK versions we need
- task: UseDotNet@2
displayName: 'Use the .NET Core 2.1 SDK (required for build signing)'
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,13 @@
<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 805b7f8

Please sign in to comment.