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

Switching to Arcade versioning #1012

Merged
merged 1 commit into from
Nov 23, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
Binary file not shown.
4 changes: 2 additions & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<Project>
<PropertyGroup>
<!-- This repo version -->
<VersionPrefix>6.0.0</VersionPrefix>
<PreReleaseVersionLabel>beta</PreReleaseVersionLabel>
<VersionPrefix>2.2.9</VersionPrefix>
<PreReleaseVersionLabel>preview</PreReleaseVersionLabel>
<!-- Opt-out repo features -->
<UsingToolXliff>false</UsingToolXliff>
<MicrosoftNETTestSdkVersion>17.1.0-preview-20211118-01</MicrosoftNETTestSdkVersion>
Expand Down
21 changes: 19 additions & 2 deletions scripts/Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,23 @@ $TFB_Full = $Full
$TFB_Official = $Official
$TFB_UpdateXlf = $UpdateXlf
$TFB_IsLocalizedBuild = $IsLocalizedBuild -or $TFB_Official
$TPB_BRANCH = "LOCALBRANCH"
$TPB_COMMIT = "LOCALBUILD"
try {
$TPB_BRANCH = $env:BUILD_SOURCEBRANCH -replace "^refs/heads/"
if ([string]::IsNullOrWhiteSpace($TPB_BRANCH)) {
$TPB_BRANCH = git -C "." rev-parse --abbrev-ref HEAD
}
}
catch { }

try {
$TPB_COMMIT = $env:BUILD_SOURCEVERSION
if ([string]::IsNullOrWhiteSpace($TPB_COMMIT)) {
$TPB_COMMIT = git -C "." rev-parse HEAD
}
}
catch { }

$TFB_Solutions = @(
"TestFx.sln"
Expand Down Expand Up @@ -272,8 +289,8 @@ function Create-NugetPackages {
$version = $version + "-" + $versionSuffix
}

Write-Verbose "$nugetExe pack $stagingDir\$file -OutputDirectory $packageOutDir -Version $version -Properties Version=$version``;Srcroot=$env:TF_SRC_DIR``;Packagesroot=$env:TF_PACKAGES_DIR``;TestPlatformVersion=$TestPlatformVersion``;NOWARN=`"NU5127,NU5128,NU5129`""
& $nugetExe pack $stagingDir\$file -OutputDirectory $packageOutDir -Version $version -Properties Version=$version`;Srcroot=$env:TF_SRC_DIR`;Packagesroot=$env:TF_PACKAGES_DIR`;TestPlatformVersion=$TestPlatformVersion`;NOWARN="NU5127,NU5128,NU5129"
Write-Verbose "$nugetExe pack $stagingDir\$file -OutputDirectory $packageOutDir -Version $version -Properties Version=$version``;Srcroot=$env:TF_SRC_DIR``;Packagesroot=$env:TF_PACKAGES_DIR``;TestPlatformVersion=$TestPlatformVersion``;NOWARN=`"NU5127,NU5128,NU5129`"``;BranchName=$TPB_BRANCH``;CommitId=$TPB_COMMIT"
& $nugetExe pack $stagingDir\$file -OutputDirectory $packageOutDir -Version $version -Properties Version=$version`;Srcroot=$env:TF_SRC_DIR`;Packagesroot=$env:TF_PACKAGES_DIR`;TestPlatformVersion=$TestPlatformVersion`;NOWARN="NU5127,NU5128,NU5129"`;BranchName=$TPB_BRANCH`;CommitId=$TPB_COMMIT
if ($lastExitCode -ne 0) {
throw "Nuget pack failed with an exit code of '$lastExitCode'."
}
Expand Down
36 changes: 0 additions & 36 deletions scripts/SetBuildNumber.ps1

This file was deleted.

66 changes: 66 additions & 0 deletions scripts/vsts-prebuild.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.

# Sets variables which are used across the build tasks.

param (
[Parameter(Mandatory)]
[string] $IsRtmBuild
)

$TPB_ROOT_DIR = (Get-Item (Split-Path $MyInvocation.MyCommand.Path)).Parent.FullName
$TPB_ENG_DIR = Join-Path $TPB_ROOT_DIR "eng"
$TPB_VERSION_PREFIX = ([xml](Get-Content $TPB_ENG_DIR\Versions.props)).Project.PropertyGroup.VersionPrefix
$TPB_RELEASE_VERSION_LABEL = ([xml](Get-Content $TPB_ENG_DIR\Versions.props)).Project.PropertyGroup.PreReleaseVersionLabel
$TPB_BUILD_NUMBER = IF ($env:BUILD_BUILDNUMBER -ne $null) { $env:BUILD_BUILDNUMBER -replace "\.", "-" } ELSE { "LOCAL" }
$TPB_NUGET_VERSION_SUFFIX = "$TPB_RELEASE_VERSION_LABEL-$TPB_BUILD_NUMBER"
$TPB_PACKAGE_VERSION = "$TPB_VERSION_PREFIX-$TPB_NUGET_VERSION_SUFFIX"
$TPB_BUILD_VERSION_SUFFIX = "0.0"
$TFB_FIRST_RELEASE_DATE = [DateTime](Get-Date -Year 2016 -Month 05 -Day 01)
$TPB_BRANCH = "LOCALBRANCH"
try {
$TPB_BRANCH = $env:BUILD_SOURCEBRANCH -replace "^refs/heads/"
if ([string]::IsNullOrWhiteSpace($TPB_BRANCH)) {
$TPB_BRANCH = git -C "." rev-parse --abbrev-ref HEAD
}
}
catch { }

# Set TPB_BUILD_VERSION_SUFFIX
if($TPB_BUILD_NUMBER -ne "LOCAL")
{
$currentDate = [System.DateTime]::UTCNow

# The default build number would be of the format $(date:yyyymmdd)$(rev:-rr)
$revisionNumber = $TPB_BUILD_NUMBER.Split("-")[1]

$monthDiff = ($currentDate.Month - $TFB_FIRST_RELEASE_DATE.Month) + 12*($currentDate.Year - $TFB_FIRST_RELEASE_DATE.Year)
$TPB_BUILD_VERSION_SUFFIX = $monthDiff.ToString() + $currentDate.ToString("dd") + "." + $revisionNumber
}

# Set RTM configuration
if ($IsRtmBuild -eq "true") {
$TPB_PACKAGE_VERSION = "$TPB_VERSION_PREFIX"
$TPB_NUGET_VERSION_SUFFIX = "''"
}

# Dump variables
Get-ChildItem variable:TP* | Format-Table

# Validate RTM config
if ($IsRtmBuild -eq "true" -and (-not $TPB_BRANCH.StartsWith("rel/"))) {
throw "An RTM build can only be started from a release branch, ``$TPB_BRANCH`` is invalid!"
}

if ($IsRtmBuild -eq "true" -and ($TPB_RELEASE_VERSION_LABEL -ne "release" -and $TPB_RELEASE_VERSION_LABEL -ne "servicing")) {
throw "An RTM build cannot be based on a ``$TPB_RELEASE_VERSION_LABEL`` build!"
}

# Publish CI variables
Write-Host "##vso[task.setvariable variable=TestAdapterNugetVersion;]$TPB_VERSION_PREFIX"
Write-Host "##vso[task.setvariable variable=TestFrameworkNugetVersion;]$TPB_VERSION_PREFIX"
Write-Host "##vso[task.setvariable variable=NugetVersionSuffix;]$TPB_NUGET_VERSION_SUFFIX"

Write-Host "##vso[task.setvariable variable=BuildVersionPrefix;]14.0"
Write-Host("##vso[task.setvariable variable=BuildVersionSuffix]$TPB_BUILD_VERSION_SUFFIX")
Write-Host "##vso[task.setvariable variable=PackageVersion;]$TPB_PACKAGE_VERSION"
4 changes: 4 additions & 0 deletions src/Package/MSTest.Internal.TestFx.Documentation.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
<icon>Icon.png</icon>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
<tags>MSTest TestFramework MSTestV2</tags>
<repository type="git"
url="https://github.com/microsoft/testfx"
branch="$BranchName$"
commit="$CommitId$" />
</metadata>
<files>
<!--DotNet-->
Expand Down
4 changes: 4 additions & 0 deletions src/Package/MSTest.TestAdapter.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
<icon>Icon.png</icon>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
<tags>MSTest TestFramework TestAdapter VisualStudio Unittest MSTestV2 Microsoft</tags>
<repository type="git"
url="https://github.com/microsoft/testfx"
branch="$BranchName$"
commit="$CommitId$" />

<dependencies>
<group targetFramework="netcoreapp1.0">
Expand Down
5 changes: 5 additions & 0 deletions src/Package/MSTest.TestAdapter.symbols.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
<icon>Icon.png</icon>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
<tags>MSTest TestFramework TestAdapter VisualStudio Unittest MSTestV2 Microsoft</tags>
<repository type="git"
url="https://github.com/microsoft/testfx"
branch="$BranchName$"
commit="$CommitId$" />

<dependencies>
<group targetFramework="netcoreapp1.0">
<dependency id="NETStandard.Library" version="1.6.1" />
Expand Down
4 changes: 4 additions & 0 deletions src/Package/MSTest.TestFramework.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
<icon>Icon.png</icon>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
<tags>MSTest TestFramework Unittest MSTestV2 Microsoft Test Testing TDD Framework </tags>
<repository type="git"
url="https://github.com/microsoft/testfx"
branch="$BranchName$"
commit="$CommitId$" />

<dependencies>
<group targetFramework="netstandard1.0">
Expand Down
4 changes: 4 additions & 0 deletions src/Package/MSTest.TestFramework.symbols.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
<icon>Icon.png</icon>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
<tags>MSTest TestFramework Unittest MSTestV2 Microsoft Test Testing TDD Framework </tags>
<repository type="git"
url="https://github.com/microsoft/testfx"
branch="$BranchName$"
commit="$CommitId$" />

<dependencies>
<group targetFramework="netstandard1.0">
Expand Down