Skip to content

Commit

Permalink
Merge branch 'release/v1.2.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswalpen committed Aug 29, 2022
2 parents 5a29eff + 7cdc9b3 commit 7219866
Show file tree
Hide file tree
Showing 9 changed files with 175 additions and 53 deletions.
17 changes: 17 additions & 0 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
"build": {
"type": "object",
"properties": {
"BuildNo": {
"type": "string",
"description": "The Buildnumber provided by the CI"
},
"Configuration": {
"type": "string",
"description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)",
Expand All @@ -29,6 +33,7 @@
"AppVeyor",
"AzurePipelines",
"Bamboo",
"Bitbucket",
"Bitrise",
"GitHubActions",
"GitLab",
Expand All @@ -42,6 +47,10 @@
"VSCode"
]
},
"IsRc": {
"type": "boolean",
"description": "Is RC Version"
},
"NoLogo": {
"type": "boolean",
"description": "Disables displaying the NUKE logo"
Expand Down Expand Up @@ -73,6 +82,8 @@
"enum": [
"Clean",
"Compile",
"Deploy",
"FullBuild",
"Restore",
"Test"
]
Expand All @@ -90,6 +101,8 @@
"enum": [
"Clean",
"Compile",
"Deploy",
"FullBuild",
"Restore",
"Test"
]
Expand All @@ -104,6 +117,10 @@
"Quiet",
"Verbose"
]
},
"Version": {
"type": "string",
"description": "Version to be injected in the Build"
}
}
}
Expand Down
71 changes: 71 additions & 0 deletions appveyor-default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# http://www.appveyor.com/docs/appveyor-yml


# version format
version: 1.2.2.{build}

environment:
base_version: 1.2.2

# you can use {branch} name in version format too
# version: 1.0.{build}-{branch}

dotnet_csproj:
patch: true
file: '**\*.csproj'
version: '{version}'
package_version: $(base_version)-RC{build}
assembly_version: $(base_version)
file_version: '{version}'
informational_version: '{version}'

# branches to build
branches:
# whitelist
only:
- master
- dev
# - somebranch

os: Visual Studio 2022
install:
# - set PATH=C:\Program Files (x86)\MSBuild\16.0\Bin;%PATH%
- dotnet tool install --global Nuke.GlobalTool


#before_build:
# - ps: dotnet tool install --global FlubuCore.Tool --version 5.1.8

build_script:
- nuke ReleaseBuild
# - ps: cd BuildScript
# - ps: flubu rebuild

# to disable automatic tests
test: off

#---------------------------------#
# artifacts configuration #
#---------------------------------#

artifacts:
- path: src\YamlMap\bin\Release\netstandard2.0\YamlMap.dll
name: YamlMap.dll

- path: src\YamlMap\bin\Release\net48\YamlMap.dll
name: YamlMap.dll

# pushing all *.nupkg files in directory
- path: 'src\YamlMap\bin\Release\*.nupkg'

# providers: Local, FTP, WebDeploy, AzureCS, AzureBlob, S3, NuGet, Environment
# provider names are case-sensitive!
# deploy:
# Deploying to NuGet feed
# - provider: NuGet
# server: https://my.nuget.server/feed
# api_key:
# secure: UlhUOcqPXsN837S8VwqMZ+10mKTxkqlnvCS5mwSyUGkFwwukfBtvXNpX81+bjS1j
# skip_symbols: true
# symbol_server: https://your.symbol.server/feed
# artifact: MeasureMap.nupkg
80 changes: 41 additions & 39 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,64 @@
# http://www.appveyor.com/docs/appveyor-yml


# version format
version: 1.2.1.{build}

environment:
base_version: 1.2.1
base_version: 1.2.2

version: $(base_version).{build}

# you can use {branch} name in version format too
# version: 1.0.{build}-{branch}

dotnet_csproj:
patch: true
file: '**\*.csproj'
version: '{version}'
package_version: $(base_version)-RC{build}
assembly_version: $(base_version)
file_version: '{version}'
informational_version: '{version}'
image:
- Visual Studio 2022

for:
-
branches:
# whitelist
only:
- dev

# Do not build on tags (GitHub only)
skip_tags: true

# branches to build
branches:
# whitelist
only:
- master
- dev
# - somebranch
install:
- dotnet tool install Nuke.GlobalTool --global --version 6.0.1 --no-cache

os: Visual Studio 2022
install:
# - set PATH=C:\Program Files (x86)\MSBuild\16.0\Bin;%PATH%
- dotnet tool install --global Nuke.GlobalTool
before_build:
- dotnet restore ./build/_build.csproj

build_script:
- nuke FullBuild --isrc true --version "%base_version%" --buildno "%APPVEYOR_BUILD_NUMBER%"

#before_build:
# - ps: dotnet tool install --global FlubuCore.Tool --version 5.1.8
-
branches:
# whitelist
only:
- master

build_script:
- nuke ReleaseBuild
# - ps: cd BuildScript
# - ps: flubu rebuild
# Do not build on tags (GitHub only)
skip_tags: true

# to disable automatic tests
test: off
install:
- dotnet tool install Nuke.GlobalTool --global --version 6.0.1 --no-cache

before_build:
- dotnet restore ./build/_build.csproj

build_script:
- nuke FullBuild --isrc false --version "%base_version%" --buildno "%APPVEYOR_BUILD_NUMBER%"

#---------------------------------#
# artifacts configuration #
#---------------------------------#

artifacts:
- path: src\YamlMap\bin\Release\netstandard2.0\YamlMap.dll
- path: src\YamlMap\bin\Release\netstandard2.1\YamlMap.dll
name: YamlMap.dll

- path: src\YamlMap\bin\Release\net48\YamlMap.dll
name: YamlMap.dll

- path: src\YamlMap\bin\Release\netstandard2.1\YamlMap.xml
name: YamlMap.xml
# pushing all *.nupkg files in directory
- path: 'src\YamlMap\bin\Release\*.nupkg'
- path: '**\*.nupkg'

# providers: Local, FTP, WebDeploy, AzureCS, AzureBlob, S3, NuGet, Environment
# provider names are case-sensitive!
Expand All @@ -68,4 +70,4 @@ artifacts:
# secure: UlhUOcqPXsN837S8VwqMZ+10mKTxkqlnvCS5mwSyUGkFwwukfBtvXNpX81+bjS1j
# skip_symbols: true
# symbol_server: https://your.symbol.server/feed
# artifact: MeasureMap.nupkg
# artifact: MeasureMap.nupkg
38 changes: 35 additions & 3 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,26 @@ class Build : NukeBuild
[GitRepository] readonly GitRepository GitRepository;

AbsolutePath SourceDirectory => RootDirectory / "src";
AbsolutePath ArtifactsDirectory => RootDirectory / "artifacts";

AbsolutePath ArtifactsDirectory => RootDirectory / "Artifacts";

AbsolutePath TestsDirectory => RootDirectory / "Tests";

[Parameter("Version to be injected in the Build")]
public string Version { get; set; } = $"1.2.2";

[Parameter("The Buildnumber provided by the CI")]
public string BuildNo = "2";

[Parameter("Is RC Version")]
public bool IsRc = false;

Target Clean => _ => _
.Before(Restore)
.Executes(() =>
{
SourceDirectory.GlobDirectories("**/bin", "**/obj").ForEach(DeleteDirectory);
TestsDirectory.GlobDirectories("**/bin", "**/obj").ForEach(DeleteDirectory);
EnsureCleanDirectory(ArtifactsDirectory);
});

Expand All @@ -57,6 +70,11 @@ class Build : NukeBuild
DotNetBuild(s => s
.SetProjectFile(Solution)
.SetConfiguration(Configuration)
.SetVersion($"{Version}.{BuildNo}")
.SetAssemblyVersion($"{Version}.{BuildNo}")
.SetFileVersion(Version)
.SetInformationalVersion($"{Version}.{BuildNo}")
.AddProperty("PackageVersion", PackageVersion)
.EnableNoRestore());
});

Expand All @@ -66,10 +84,24 @@ class Build : NukeBuild
{
DotNetTest(s => s
.SetProjectFile(Solution)
.SetConfiguration("Debug"));
.SetConfiguration(Configuration)
.SetNoBuild(true)
.SetFilter("FullyQualifiedName!~Integration.Tests")
.EnableNoRestore());
});

Target ReleaseBuild => _ => _
Target FullBuild => _ => _
.DependsOn(Compile)
.DependsOn(Test);

Target Deploy => _ => _
.DependsOn(Compile)
.Executes(() =>
{
CopyFileToDirectory($"{SourceDirectory}/YamlMap/bin/{Configuration}/YamlMap.{PackageVersion}.nupkg", "C:\\Projects\\NuGet Store", FileExistsPolicy.Overwrite, false);
CopyFileToDirectory($"{SourceDirectory}/YamlMap/bin/{Configuration}/YamlMap.{PackageVersion}.snupkg", "C:\\Projects\\NuGet Store", FileExistsPolicy.Overwrite, false);
});

string PackageVersion
=> IsRc ? int.Parse(BuildNo) < 10 ? $"{Version}-RC0{BuildNo}" : $"{Version}-RC{BuildNo}" : Version;
}
2 changes: 1 addition & 1 deletion build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nuke.Common" Version="5.3.0" />
<PackageReference Include="Nuke.Common" Version="6.2.1" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/Tests/YamlMap.Tests/Integration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class Integration
[Test]
public void LoadDataFromFile()
{
var path = Uri.UnescapeDataString(new UriBuilder(typeof(Integration).Assembly.CodeBase).Path);
var path = Uri.UnescapeDataString(new UriBuilder(typeof(Integration).Assembly.Location).Path);
path = Path.Combine(Path.GetDirectoryName(path), "TestData", "users.yml");

var reader = new YamlFileReader();
Expand Down
4 changes: 2 additions & 2 deletions src/Tests/YamlMap.Tests/YamlFileWriterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class YamlFileWriterTests
[SetUp]
public void Setup()
{
var path = Path.Combine(Path.GetDirectoryName(Uri.UnescapeDataString(new UriBuilder(Assembly.GetExecutingAssembly().CodeBase).Path)), "WriterTest.yml");
var path = Path.Combine(Path.GetDirectoryName(Uri.UnescapeDataString(new UriBuilder(Assembly.GetExecutingAssembly().Location).Path)), "WriterTest.yml");
if (File.Exists(path))
{
File.Delete(path);
Expand All @@ -28,7 +28,7 @@ public void YamlFileWriter_Write()
Id = "writer test"
};

var path = Path.Combine(Path.GetDirectoryName(Uri.UnescapeDataString(new UriBuilder(Assembly.GetExecutingAssembly().CodeBase).Path)), "WriterTest.yml");
var path = Path.Combine(Path.GetDirectoryName(Uri.UnescapeDataString(new UriBuilder(Assembly.GetExecutingAssembly().Location).Path)), "WriterTest.yml");

var writer = new YamlFileWriter();
writer.Write(path, item);
Expand Down
12 changes: 6 additions & 6 deletions src/Tests/YamlMap.Tests/YamlMap.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFrameworks>net6.0;net48</TargetFrameworks>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand All @@ -18,14 +18,14 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="3.1.0">
<PackageReference Include="coverlet.msbuild" Version="3.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="nunit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Polaroider" Version="2.0.4" />
<PackageReference Include="nunit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.3.0-alpha-net7.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0-preview-20220726-02" />
<PackageReference Include="Polaroider" Version="2.0.6" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/YamlMap/YamlMap.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.1</TargetFrameworks>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">netcoreapp2.1</TargetFrameworks>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>../YamlMap.snk</AssemblyOriginatorKeyFile>
Expand Down

0 comments on commit 7219866

Please sign in to comment.