Use major + minor from pipeline for assembly versioning (#2012)

This commit is contained in:
Charles Gagnon
2023-04-18 16:34:36 -07:00
committed by GitHub
parent 54bd06ef98
commit d56f2309da
4 changed files with 33 additions and 9 deletions

View File

@@ -12,9 +12,9 @@
<RootDir>$(MSBuildThisFileDirectory)</RootDir>
<!-- Defaults-->
<Major Condition="$(Major) == ''">1</Major>
<Minor Condition="$(Minor) == ''">0</Minor>
<Build_BuildNumber Condition="'$(Build_BuildNumber)' == ''">0.0</Build_BuildNumber>
<Major Condition="$(Major) == ''">99</Major>
<Minor Condition="$(Minor) == ''">99</Minor>
<Build_BuildNumber Condition="'$(Build_BuildNumber)' == ''">99.99</Build_BuildNumber>
<StableRelease Condition="$(StableRelease) == ''">false</StableRelease>
<!-- AssemblyVersion should not change for non-major releases. -->
@@ -30,6 +30,7 @@
<Version>$(VersionPrefix)</Version>
<FileVersion>$(VersionPrefix)</FileVersion>
<InformationalVersion>$(VersionPrefix)</InformationalVersion>
<NuspecProperties>version=$(PackageVersion)</NuspecProperties>
<ToolsServiceTargetRuntimes>win-x64;win-x86;win-arm64;ubuntu.14.04-x64;ubuntu.16.04-x64;centos.7-x64;rhel.7.2-x64;debian.8-x64;fedora.23-x64;opensuse.13.2-x64;osx.10.11-x64;osx-x64;osx-arm64;linux-x64;linux-arm64</ToolsServiceTargetRuntimes>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>

View File

@@ -8,9 +8,13 @@ stages:
value: 'Release'
# Major version number for the release
- name: Major
value: '4'
- name: ManagedBatchParserMajor
value: '3'
# Minor version number for the release (should be incremented post a stable release)
- name: Minor
value: '7'
- name: ManagedBatchParserMinor
value: '0'
# Set to true to build a stable release.
- name: StableRelease

View File

@@ -35,7 +35,7 @@ steps:
displayName: 'Run Automated Release Script'
inputs:
filePath: '$(System.DefaultWorkingDirectory)/CrossPlatBuildScripts/AutomatedReleases/sqltoolsserviceRelease.ps1'
arguments: '-workspace $(Build.SourcesDirectory) -minTag 4.7.0.0 -target $(Build.SourceBranch) -isPrerelease $false -artifactsBuildId $(Build.BuildId)'
arguments: '-workspace $(Build.SourcesDirectory) -minTag $(Major).$(Minor).0.0 -target $(Build.SourceBranch) -isPrerelease $false -artifactsBuildId $(Build.BuildId)'
workingDirectory: '$(Build.SourcesDirectory)'
env:
GITHUB_DISTRO_MIXIN_PASSWORD: $(github-distro-mixin-password)

View File

@@ -1,18 +1,37 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!-- Targeting both net7.0 and net472 so that other things such as PS cmdlets can use this which need to support a wider range of machines -->
<!-- Targeting both net7.0 and net472 so that other things such as PS cmdlets can use this
which need to support a wider range of machines -->
<TargetFrameworks>net7.0;net472</TargetFrameworks>
<LangVersion>9.0</LangVersion>
<Nullable>disable</Nullable>
<AssemblyName>Microsoft.SqlTools.ManagedBatchParser</AssemblyName>
<Guid>82dd9738-2ad3-4eb3-9f80-18b594e03621</Guid>
<DelaySign>True</DelaySign>
<!-- Explicitly disable since it leads to compilation errors. The .NET 6.0 target is used in tests with internalsVisibleTo attribute.-->
<!-- Explicitly disable since it leads to compilation errors. The .NET 6.0 target is used in
tests with internalsVisibleTo attribute.-->
<SignAssembly Condition="$(TargetFramework) == 'net472'">True</SignAssembly>
<AssemblyOriginatorKeyFile>$(RootDir)\SQL2003.snk</AssemblyOriginatorKeyFile>
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
<EmbeddedResourceUseDependentUponConvention>false</EmbeddedResourceUseDependentUponConvention>
<Product>Microsoft SqlTools Managed batch parser</Product>
<!-- Defaults-->
<Major Condition="$(ManagedBatchParserMajor) != ''">$(ManagedBatchParserMajor)</Major>
<Minor Condition="$(ManagedBatchParserMinor) != ''">$(ManagedBatchParserMinor)</Minor>
<!-- AssemblyVersion should not change for non-major releases. -->
<AssemblyVersion>$(Major).0.0.0</AssemblyVersion>
<!-- AssemblyFileVersion should change for every build. -->
<!-- For preview releases, sample Version = 3.0.20221104.1-preview -->
<!-- For stable releases, sample Version = 3.0.0 -->
<VersionPrefix>$(Major).$(Minor).$(Build_BuildNumber)</VersionPrefix>
<VersionPrefix Condition="$(StableRelease.Equals('true'))">$(Major).$(Minor).0</VersionPrefix>
<VersionSuffix Condition="!$(StableRelease.Equals('true'))">preview</VersionSuffix>
<AssemblyFileVersion>$(VersionPrefix)-$(VersionSuffix)</AssemblyFileVersion>
<Version>$(VersionPrefix)</Version>
<FileVersion>$(VersionPrefix)</FileVersion>
<InformationalVersion>$(VersionPrefix)</InformationalVersion>
<!-- TODO FIX THESE WARNINGS ASAP -->
<NoWarn>$(NoWarn);CA1852</NoWarn>
</PropertyGroup>