Skip to content

Commit

Permalink
Bump
Browse files Browse the repository at this point in the history
  • Loading branch information
YuKitsune committed Nov 23, 2023
1 parent 1f9a3d2 commit 0d1f29c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
20 changes: 10 additions & 10 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using static Nuke.Common.IO.FileSystemTasks;
using static Nuke.Common.Tools.DotNet.DotNetTasks;
using Nuke.Common.Tools.OctoVersion;
using Serilog;

[UnsetVisualStudioEnvironmentVariables]
class Build : NukeBuild
Expand All @@ -16,12 +17,12 @@ class Build : NukeBuild

readonly Configuration Configuration = Configuration.Release;

[Solution] readonly Solution Solution;
[Solution] readonly Solution Solution = null!; // assigned by Nuke via reflection

[Parameter] readonly bool? OctoVersionAutoDetectBranch = NukeBuild.IsLocalBuild;

[Parameter("Branch name for OctoVersion to use to calculate the version number. Can be set via the environment variable " + CiBranchNameEnvVariable + ".", Name = CiBranchNameEnvVariable)]
readonly string OctoVersionBranch;
readonly string OctoVersionBranch = null!; // assigned by Nuke via reflection

Check warning on line 25 in build/Build.cs

View workflow job for this annotation

GitHub Actions / build

The field 'Build.OctoVersionBranch' is assigned but its value is never used

[Parameter] readonly string? OctoVersionFullSemVer;
[Parameter] readonly int? OctoVersionMajor;
Expand All @@ -37,8 +38,7 @@ class Build : NukeBuild
MinorMember = nameof(OctoVersionMinor),
PatchMember = nameof(OctoVersionPatch),
Framework = "net8.0")]

readonly OctoVersionInfo OctoVersionInfo;
readonly OctoVersionInfo OctoVersionInfo = null!; // assigned by Nuke via reflection

static AbsolutePath SourceDirectory => RootDirectory / "source";
static AbsolutePath ArtifactsDirectory => RootDirectory / "artifacts";
Expand All @@ -49,9 +49,9 @@ class Build : NukeBuild
.Before(Restore)
.Executes(() =>
{
SourceDirectory.GlobDirectories("**/bin", "**/obj", "**/TestResults").ForEach(DeleteDirectory);
EnsureCleanDirectory(ArtifactsDirectory);
EnsureCleanDirectory(PublishDirectory);
SourceDirectory.GlobDirectories("**/bin", "**/obj", "**/TestResults").ForEach(x => x.DeleteDirectory());
ArtifactsDirectory.CreateOrCleanDirectory();
PublishDirectory.CreateOrCleanDirectory();
});

Target Restore => _ => _
Expand All @@ -67,7 +67,7 @@ class Build : NukeBuild
.DependsOn(Restore)
.Executes(() =>
{
Logger.Info("Building Octopus Versioning v{0}", OctoVersionInfo.FullSemVer);
Log.Information("Building Octopus Versioning v{0}", OctoVersionInfo.FullSemVer);

DotNetBuild(_ => _
.SetProjectFile(Solution)
Expand All @@ -93,7 +93,7 @@ class Build : NukeBuild
.Produces(ArtifactsDirectory / "*.nupkg")
.Executes(() =>
{
Logger.Info("Packing Octopus Versioning v{0}", OctoVersionInfo.FullSemVer);
Log.Information("Packing Octopus Versioning v{0}", OctoVersionInfo.FullSemVer);

// This is done to pass the data to github actions
Console.Out.WriteLine($"::set-output name=semver::{OctoVersionInfo.FullSemVer}");
Expand All @@ -115,7 +115,7 @@ class Build : NukeBuild
.TriggeredBy(Pack)
.Executes(() =>
{
EnsureExistingDirectory(LocalPackagesDir);
LocalPackagesDir.CreateDirectory();
ArtifactsDirectory.GlobFiles("*.nupkg")
.ForEach(package =>
{
Expand Down
3 changes: 2 additions & 1 deletion build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@
<NukeTelemetryVersion>1</NukeTelemetryVersion>
<!-- NET8: Remove this when Nuke releases a new version which sets it for us -->
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
<Nullable>enable</Nullable>
</PropertyGroup>

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

<ItemGroup>
<PackageDownload Include="OctoVersion.Tool" Version="[0.3.49]" />
<PackageDownload Include="Octopus.OctoVersion.Tool" Version="[0.3.293]" />
</ItemGroup>

</Project>

0 comments on commit 0d1f29c

Please sign in to comment.