Skip to content

Commit

Permalink
Merge branch 'release/3.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalberger committed Oct 10, 2023
2 parents 158b3cb + 7fe66d7 commit cba1d28
Show file tree
Hide file tree
Showing 10 changed files with 112 additions and 36 deletions.
7 changes: 3 additions & 4 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ install:
- ps: $env:DOTNET_INSTALL_DIR = "$pwd\.dotnetsdk"
- ps: mkdir $env:DOTNET_INSTALL_DIR -Force | Out-Null
- ps: Invoke-WebRequest -Uri "https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.ps1" -OutFile "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1"
- ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Version 2.1.818 -InstallDir $env:DOTNET_INSTALL_DIR'
- ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Version 3.1.414 -InstallDir $env:DOTNET_INSTALL_DIR'
- ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Version 5.0.402 -InstallDir $env:DOTNET_INSTALL_DIR'
- ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Version 6.0.100 -InstallDir $env:DOTNET_INSTALL_DIR'
- ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Version 5.0.408 -InstallDir $env:DOTNET_INSTALL_DIR'
- ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Version 6.0.413 -InstallDir $env:DOTNET_INSTALL_DIR'
- ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Version 7.0.401 -InstallDir $env:DOTNET_INSTALL_DIR'
- ps: $env:Path = "$env:DOTNET_INSTALL_DIR;$env:Path"
- ps: dotnet --info

Expand Down
18 changes: 0 additions & 18 deletions .github/dependabot.yml

This file was deleted.

18 changes: 18 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"github>cake-contrib/renovate-presets"
],
"packageRules": [
{
"description": "Group Azure DevOps packages together",
"matchManagers": [
"nuget"
],
"matchPackagePatterns": [
"Microsoft.TeamFoundationServer.Client|Microsoft.VisualStudio.Services.InteractiveClient"
],
"groupName": "Azure DevOps Client"
}
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"dotnet.defaultSolution": "src\\Cake.AzureDevOps.sln"
}
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"sdk": {
"allowPrerelease": true,
"version": "7.0.100",
"version": "7.0.401",
"rollForward": "latestFeature"
}
}
2 changes: 1 addition & 1 deletion recipe.cake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#load nuget:?package=Cake.Recipe&version=3.0.1
#load nuget:?package=Cake.Recipe&version=3.1.1

Environment.SetVariableNames();

Expand Down
13 changes: 7 additions & 6 deletions src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
Expand All @@ -14,15 +14,16 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="Cake.Common" Version="3.0.0" />
<PackageReference Include="Cake.Core" Version="3.0.0" />
<PackageReference Include="Cake.Testing" Version="3.0.0" />
<PackageReference Include="Microsoft.TeamFoundationServer.Client" Version="16.170.0" />
<PackageReference Include="Microsoft.TeamFoundationServer.Client" Version="16.205.1" />
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="Shouldly" Version="4.1.0" />
<PackageReference Include="Shouldly" Version="4.2.1" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageReference Include="xunit" Version="2.5.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
namespace Cake.AzureDevOps.Tests.Pipelines
{
using System.Collections.Generic;
using System.Linq;
using Cake.AzureDevOps.Pipelines;
using Cake.Common.Build.AzurePipelines.Data;
using Microsoft.TeamFoundation.Build.WebApi;
using Shouldly;
using Xunit;

// ReSharper disable once ClassNeverInstantiated.Global
public sealed class ArtifactResourceExtensionsTests
{
public sealed class TheToAzureDevOpsArtifactResourceExtensionMethod
{
[Fact]
public void Should_Return_The_Correct_AzureDevOpsArtifactResource_For_ArtifactResource()
{
// Given
var artifactResource = new ArtifactResource()
{
Data = "data",
DownloadUrl = "downloadUrl",
Url = "url",
Type = "FilePath",
Properties = new Dictionary<string, string>()
{
{ "foo", "bar" },
},
};

// When
var result = artifactResource.ToAzureDevOpsArtifactResource();

// Then
result.Data.ShouldBe(artifactResource.Data);
result.DownloadUrl.ShouldBe(artifactResource.DownloadUrl);
result.Url.ShouldBe(artifactResource.Url);
result.Type.ShouldBe(AzurePipelinesArtifactType.FilePath);
result.Properties.Count.ShouldBe(1);
result.Properties.Single().Key.ShouldBe(artifactResource.Properties.Single().Key);
result.Properties.Single().Value.ShouldBe(artifactResource.Properties.Single().Value);
}

[Theory]
[InlineData("container", AzurePipelinesArtifactType.Container)]
[InlineData("Container", AzurePipelinesArtifactType.Container)]
[InlineData("FilePath", AzurePipelinesArtifactType.FilePath)]
[InlineData("filepath", AzurePipelinesArtifactType.FilePath)]
[InlineData("GitRef", AzurePipelinesArtifactType.GitRef)]
[InlineData("gitref", AzurePipelinesArtifactType.GitRef)]
[InlineData("TFVCLabel", AzurePipelinesArtifactType.TFVCLabel)]
[InlineData("tfvclabel", AzurePipelinesArtifactType.TFVCLabel)]
[InlineData("VersionControl", AzurePipelinesArtifactType.VersionControl)]
[InlineData("versioncontrol", AzurePipelinesArtifactType.VersionControl)]

public void Should_Return_The_Correct_AzureDevOpsArtifactResource_Type_EnumValue_Independent_The_ArtifactResource_Type_String_Casing(string typeString, AzurePipelinesArtifactType expectedResult)
{
// Given
var artifactResource = new ArtifactResource()
{
Type = typeString,
};

// When
var result = artifactResource.ToAzureDevOpsArtifactResource();

// Then
result.Type.ShouldBe(expectedResult);
}
}
}
}
10 changes: 5 additions & 5 deletions src/Cake.AzureDevOps/Cake.AzureDevOps.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
Expand All @@ -22,7 +22,7 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/cake-contrib/Cake.AzureDevOps.git</RepositoryUrl>
<PackageReleaseNotes>https://github.com/cake-contrib/Cake.AzureDevOps/releases/tag/3.0.0</PackageReleaseNotes>
<PackageReleaseNotes>https://github.com/cake-contrib/Cake.AzureDevOps/releases/tag/3.0.1</PackageReleaseNotes>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<IncludeBuildOutput>false</IncludeBuildOutput>
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);PackBuildOutputs</TargetsForTfmSpecificContentInPackage>
Expand All @@ -36,13 +36,13 @@
<ItemGroup>
<PackageReference Include="Cake.Common" Version="3.0.0" PrivateAssets="All" />
<PackageReference Include="Cake.Core" Version="3.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.0">
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
<PackageReference Include="Microsoft.TeamFoundationServer.Client" Version="16.170.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.VisualStudio.Services.InteractiveClient" Version="16.170.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.TeamFoundationServer.Client" Version="16.205.1" PrivateAssets="All" />
<PackageReference Include="Microsoft.VisualStudio.Services.InteractiveClient" Version="16.205.1" PrivateAssets="All" />
<PackageReference Include="TfsUrlParser" Version="1.3.0" PrivateAssets="All" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static AzureDevOpsArtifactResource ToAzureDevOpsArtifactResource(this Art
{
artifactResource.NotNull(nameof(artifactResource));

if (!Enum.TryParse(artifactResource.Type, out AzurePipelinesArtifactType type))
if (!Enum.TryParse(artifactResource.Type, true, out AzurePipelinesArtifactType type))
{
throw new InvalidOperationException($"Unexpected value for artifact type '{artifactResource.Type}'");
}
Expand Down

0 comments on commit cba1d28

Please sign in to comment.