Skip to content

Commit

Permalink
Merge branch 'hotfix/0.24.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
matkoch committed Apr 12, 2020
2 parents 1285837 + e289cf2 commit f0b63ae
Show file tree
Hide file tree
Showing 18 changed files with 178 additions and 31 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 13 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [vNext]

## [0.24.8] / 2020-04-12
- Fixed publishing of global tool for `netcoreapp3.1`
- Fixed .NET Core SDK install script URL
- Fixed trap error output in PowerShell bootstrapping
- Fixed AzurePipelines push triggers
- Fixed AzurePipelines configuration to allow overriding configuration directory
- Fixed previous constructor usages for `AzurePipelinesAttribute`
- Fixed PowerShell downloads to use TLS 1.2 security protocol
- Fixed unrecognized `Visible` attribute for `PackageDownload` item group

## [0.24.7] / 2020-03-26
- Fixed MSBuild targets for .NET Core
- Fixed `GitRepository.GetGitHubMilestone` to retrieve milestone independent of state
Expand Down Expand Up @@ -103,7 +113,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [0.23.5] / 2020-01-10
- Fixed CI integrations to use correct warning/error reporting infrastructure
- Fixed TeamCity configuration to use `UTF-8` encoding
- Fixed TeamCity configuration to use `UTF-8` encoding
- Fixed process encoding by setting `StandardOutputEncoding` and `StandardErrorEncoding` to `UTF-8`
- Fixed solution deserialization for missing configuration section
- Fixed logo spacing
Expand Down Expand Up @@ -558,7 +568,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Added CLT tasks for Git
- Fixed background color in console output

[vNext]: https://github.com/nuke-build/nuke/compare/0.24.7...HEAD
[vNext]: https://github.com/nuke-build/nuke/compare/0.24.8...HEAD
[0.24.8]: https://github.com/nuke-build/nuke/compare/0.24.7...0.24.8
[0.24.7]: https://github.com/nuke-build/nuke/compare/0.24.6...0.24.7
[0.24.6]: https://github.com/nuke-build/nuke/compare/0.24.5...0.24.6
[0.24.5]: https://github.com/nuke-build/nuke/compare/0.24.4...0.24.5
Expand Down
5 changes: 3 additions & 2 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Param(

Write-Output "PowerShell $($PSVersionTable.PSEdition) version $($PSVersionTable.PSVersion)"

Set-StrictMode -Version 2.0; $ErrorActionPreference = "Stop"; $ConfirmPreference = "None"; trap { exit 1 }
Set-StrictMode -Version 2.0; $ErrorActionPreference = "Stop"; $ConfirmPreference = "None"; trap { Write-Error $_ -ErrorAction Continue; exit 1 }
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent

###########################################################################
Expand All @@ -17,7 +17,7 @@ $BuildProjectFile = "$PSScriptRoot\build\_build.csproj"
$TempDirectory = "$PSScriptRoot\.tmp"

$DotNetGlobalFile = "$PSScriptRoot\global.json"
$DotNetInstallUrl = "https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.ps1"
$DotNetInstallUrl = "https://dot.net/v1/dotnet-install.ps1"
$DotNetChannel = "Current"

$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1
Expand Down Expand Up @@ -61,6 +61,7 @@ if (Test-Path $DotNetGlobalFile) {
# Download install script
$DotNetInstallFile = "$TempDirectory\dotnet-install.ps1"
New-Item -ItemType Directory -Path $TempDirectory -Force | Out-Null
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
(New-Object System.Net.WebClient).DownloadFile($DotNetInstallUrl, $DotNetInstallFile)

# Install by channel or version
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ BUILD_PROJECT_FILE="$SCRIPT_DIR/build/_build.csproj"
TEMP_DIRECTORY="$SCRIPT_DIR/.tmp"

DOTNET_GLOBAL_FILE="$SCRIPT_DIR/global.json"
DOTNET_INSTALL_URL="https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.sh"
DOTNET_INSTALL_URL="https://dot.net/v1/dotnet-install.sh"
DOTNET_CHANNEL="Current"

export DOTNET_CLI_TELEMETRY_OPTOUT=1
Expand Down
2 changes: 1 addition & 1 deletion build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ from framework in project.GetTargetFrameworks()
.When(InvokedTargets.Contains(Coverage) || IsServerBuild, _ => _
.SetCoverletOutput(TestResultDirectory / $"{v.Name}.xml"))));
OutputDirectory.GlobFiles("*.trx").ForEach(x =>
TestResultDirectory.GlobFiles("*.trx").ForEach(x =>
AzurePipelines?.PublishTestResults(
type: AzurePipelinesTestResultsType.VSTest,
title: $"{Path.GetFileNameWithoutExtension(x)} ({AzurePipelines.StageDisplayName})",
Expand Down
42 changes: 39 additions & 3 deletions source/Nuke.Common/CI/AzurePipelines/AzurePipelinesAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Maintainers of NUKE.
// Copyright 2020 Maintainers of NUKE.
// Distributed under the MIT License.
// https://github.com/nuke-build/nuke/blob/master/LICENSE

Expand All @@ -22,6 +22,13 @@ public class AzurePipelinesAttribute : ChainedConfigurationAttributeBase
private readonly string _suffix;
private readonly AzurePipelinesImage[] _images;

public AzurePipelinesAttribute(
AzurePipelinesImage image,
params AzurePipelinesImage[] images)
: this(suffix: null, image, images)
{
}

public AzurePipelinesAttribute(
[CanBeNull] string suffix,
AzurePipelinesImage image,
Expand All @@ -31,8 +38,9 @@ public AzurePipelinesAttribute(
_images = new[] { image }.Concat(images).ToArray();
}

protected virtual AbsolutePath ConfigurationDirectory => NukeBuild.RootDirectory;
private string ConfigurationFileName => _suffix != null ? $"azure-pipelines.{_suffix}.yml" : "azure-pipelines.yml";
private string ConfigurationFile => NukeBuild.RootDirectory / ConfigurationFileName;
private string ConfigurationFile => ConfigurationDirectory / ConfigurationFileName;

public override string IdPostfix => _suffix;
public override HostType HostType => HostType.AzurePipelines;
Expand All @@ -41,7 +49,8 @@ public AzurePipelinesAttribute(

public string[] InvokedTargets { get; set; } = new string[0];

public bool TriggerBatch { get; set; }
public bool TriggerDisabled { get; set; }
public bool? TriggerBatch { get; set; }
public string[] TriggerBranchesInclude { get; set; } = new string[0];
public string[] TriggerBranchesExclude { get; set; } = new string[0];
public string[] TriggerTagsInclude { get; set; } = new string[0];
Expand All @@ -64,10 +73,37 @@ public override ConfigurationEntity GetConfiguration(NukeBuild build, IReadOnlyC
{
return new AzurePipelinesConfiguration
{
VcsPushTrigger = GetVcsPushTrigger(),
Stages = _images.Select(x => GetStage(x, relevantTargets)).ToArray()
};
}

[CanBeNull]
protected AzurePipelinesVcsPushTrigger GetVcsPushTrigger()
{
if (!TriggerDisabled &&
!TriggerBatch.HasValue &&
TriggerBranchesInclude.Length == 0 &&
TriggerBranchesExclude.Length == 0 &&
TriggerTagsInclude.Length == 0 &&
TriggerTagsExclude.Length == 0 &&
TriggerPathsInclude.Length == 0 &&
TriggerPathsExclude.Length == 0)
return null;

return new AzurePipelinesVcsPushTrigger
{
Disabled = TriggerDisabled,
Batch = TriggerBatch,
BranchesInclude = TriggerBranchesInclude,
BranchesExclude = TriggerBranchesExclude,
TagsInclude = TriggerTagsInclude,
TagsExclude = TriggerTagsExclude,
PathsInclude = TriggerPathsInclude,
PathsExclude = TriggerPathsExclude,
};
}

protected virtual AzurePipelinesStage GetStage(
AzurePipelinesImage image,
IReadOnlyCollection<ExecutableTarget> relevantTargets)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
// Copyright 2020 Maintainers of NUKE.
// Distributed under the MIT License.
// https://github.com/nuke-build/nuke/blob/master/LICENSE

using JetBrains.Annotations;
using Nuke.Common.Utilities;
using Nuke.Common.Utilities.Collections;

namespace Nuke.Common.CI.AzurePipelines.Configuration
{
public class AzurePipelinesConfiguration : ConfigurationEntity
{
[CanBeNull]
public AzurePipelinesVcsPushTrigger VcsPushTrigger { get; set; }

public AzurePipelinesStage[] Stages { get; set; }

public override void Write(CustomFileWriter writer)
{
if (VcsPushTrigger != null)
{
using (writer.WriteBlock("trigger:"))
{
VcsPushTrigger.Write(writer);
writer.WriteLine();
}
}

using (writer.WriteBlock("stages:"))
{
Stages.ForEach(x => x.Write(writer));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
// Copyright 2020 Maintainers of NUKE.
// Distributed under the MIT License.
// https://github.com/nuke-build/nuke/blob/master/LICENSE

using System.Collections.Generic;
using Nuke.Common.Utilities;
using Nuke.Common.Utilities.Collections;

namespace Nuke.Common.CI.AzurePipelines.Configuration
{
public class AzurePipelinesVcsPushTrigger : ConfigurationEntity
{
public bool Disabled { get; set; }
public bool? Batch { get; set; }
public string[] BranchesInclude { get; set; }
public string[] BranchesExclude { get; set; }
public string[] TagsInclude { get; set; }
public string[] TagsExclude { get; set; }
public string[] PathsInclude { get; set; }
public string[] PathsExclude { get; set; }

public override void Write(CustomFileWriter writer)
{
if (Disabled)
{
writer.WriteLine("none");
return;
}

if (Batch.HasValue)
writer.WriteLine($"batch: {Batch.ToString().ToLowerInvariant()}");

if (BranchesInclude.Length > 0 || BranchesExclude.Length > 0)
{
using (writer.WriteBlock("branches:"))
{
WriteInclusionsAndExclusions(writer, BranchesInclude, BranchesExclude);
}
}

if (TagsInclude.Length > 0 || TagsExclude.Length > 0)
{
using (writer.WriteBlock("tags:"))
{
WriteInclusionsAndExclusions(writer, TagsInclude, TagsExclude);
}
}

if (PathsInclude.Length > 0 || PathsExclude.Length > 0)
{
using (writer.WriteBlock("paths:"))
{
WriteInclusionsAndExclusions(writer, PathsInclude, PathsExclude);
}
}
}

private static void WriteInclusionsAndExclusions(
CustomFileWriter writer,
IReadOnlyCollection<string> inclusions,
IReadOnlyCollection<string> exclusions)
{
if (inclusions.Count > 0)
{
using (writer.WriteBlock("include:"))
{
inclusions.ForEach(x => writer.WriteLine($"- {x}"));
}
}

if (exclusions.Count > 0)
{
using (writer.WriteBlock("exclude:"))
{
exclusions.ForEach(x => writer.WriteLine($"- {x}"));
}
}
}
}
}
6 changes: 4 additions & 2 deletions source/Nuke.Common/Nuke.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == ''">
<None Include="$(MSBuildProjectName).props" PackagePath="build" Pack="true" />
<None Include="$(MSBuildProjectName).targets" PackagePath="build" Pack="true" />
<None Include="$(MSBuildProjectName).props" PackagePath="build\netcore" Pack="true" />
<None Include="$(MSBuildProjectName).props" PackagePath="build\netfx" Pack="true" />
<None Include="$(MSBuildProjectName).targets" PackagePath="build\netcore" Pack="true" />
<None Include="$(MSBuildProjectName).targets" PackagePath="build\netfx" Pack="true" />
<None Include="..\Nuke.MSBuildTasks\Nuke.MSBuildTasks.targets" PackagePath="build\netcore" Pack="true" />
<None Include="..\Nuke.MSBuildTasks\Nuke.MSBuildTasks.targets" PackagePath="build\netfx" Pack="true" />
<None Include="..\Nuke.MSBuildTasks\bin\$(Configuration)\netcoreapp2.1\publish\**\*.*" PackagePath="build\netcore" Pack="true" />
Expand Down
1 change: 0 additions & 1 deletion source/Nuke.Common/Nuke.Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
</PropertyGroup>

<ItemDefinitionGroup>
<PackageDownload Visible="false" />
<NukeExternalFiles Visible="false" />
</ItemDefinitionGroup>

Expand Down
9 changes: 4 additions & 5 deletions source/Nuke.Common/Nuke.Common.targets
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup Condition="'$(NukeMSBuildIntegration)' != 'False' and '$(NukeMSBuildTasks)' == ''">
<NukeMSBuildTasks Condition="'$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)\netcore</NukeMSBuildTasks>
<NukeMSBuildTasks Condition="'$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)\netfx</NukeMSBuildTasks>
</PropertyGroup>

<PropertyGroup Condition="'$(PackAsTool)' != 'True'">
<IsPackable>False</IsPackable>
</PropertyGroup>

<PropertyGroup Condition="'$(NukeMSBuildIntegration)' != 'False' and '$(NukeMSBuildTasks)' == ''">
<NukeMSBuildTasks>$(MSBuildThisFileDirectory)</NukeMSBuildTasks>
</PropertyGroup>

<Import Project="$(NukeMSBuildTasks)\Nuke.MSBuildTasks.targets" Condition="'$(NukeMSBuildTasks)' != ''" />

<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion source/Nuke.GlobalTool/Nuke.GlobalTool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFrameworks>netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
<PackAsTool>true</PackAsTool>
<ToolCommandName>nuke</ToolCommandName>
<EmbeddedResourceUseDependentUponConvention>false</EmbeddedResourceUseDependentUponConvention>
Expand Down
Loading

0 comments on commit f0b63ae

Please sign in to comment.