1414using System . Collections . Generic ;
1515using System . IO ;
1616using System . Linq ;
17+ using Nuke . Common . Tooling ;
1718using static Nuke . Common . IO . FileSystemTasks ;
18- using static Nuke . Common . IO . PathConstruction ;
1919using static Nuke . Common . Tools . DotNet . DotNetTasks ;
2020using static Nuke . Common . Tools . NuGet . NuGetTasks ;
2121using Project = Nuke . Common . ProjectModel . Project ;
@@ -99,7 +99,7 @@ protected override void OnBuildInitialized()
9999
100100 Log . Information ( "Building version: {Version}" , Version ) ;
101101
102- TargetProject = Solution . GetProject ( SourceDirectory / TargetProjectName / $ " { TargetLibName } .csproj" ) ;
102+ TargetProject = Solution . GetProject ( TargetLibName ) ;
103103 TargetProject . NotNull ( "TargetProject could not be loaded!" ) ;
104104
105105 TargetFrameworks = TargetProject . GetTargetFrameworks ( ) ;
@@ -112,7 +112,7 @@ protected override void OnBuildInitialized()
112112 . Before ( Restore )
113113 . Executes ( ( ) =>
114114 {
115- SourceDirectory . GlobDirectories ( "**/bin" , "**/obj" ) . ForEach ( DeleteDirectory ) ;
115+ SourceDirectory . GlobDirectories ( "**/bin" , "**/obj" ) . ForEach ( x => x . DeleteDirectory ( ) ) ;
116116 } ) ;
117117
118118 Target Restore => _ => _
@@ -129,6 +129,7 @@ protected override void OnBuildInitialized()
129129 DotNetBuild ( s => s
130130 . SetProjectFile ( Solution )
131131 . SetConfiguration ( Configuration )
132+ . SetContinuousIntegrationBuild ( IsServerBuild )
132133 . EnableNoRestore ( ) ) ;
133134 } ) ;
134135
@@ -140,7 +141,8 @@ protected override void OnBuildInitialized()
140141 . SetProjectFile ( Solution )
141142 . SetConfiguration ( Configuration )
142143 . EnableNoRestore ( )
143- . EnableNoBuild ( ) ) ;
144+ . EnableNoBuild ( )
145+ . When ( GitHubActions . Instance is not null , x => x . SetLoggers ( "GitHubActions" ) ) ) ;
144146 } ) ;
145147
146148 Target CopyFiles => _ => _
@@ -172,9 +174,9 @@ protected override void OnBuildInitialized()
172174 . SetTargetPath ( nuspec )
173175 . SetVersion ( Version )
174176 . SetOutputDirectory ( NugetDirectory )
175- . SetSymbols ( true )
176- . SetSymbolPackageFormat ( " snupkg" )
177- . AddProperty ( "Configuration" , Configuration )
177+ . EnableSymbols ( )
178+ . SetSymbolPackageFormat ( NuGetSymbolPackageFormat . snupkg )
179+ . SetConfiguration ( Configuration )
178180 ) ;
179181 } ) ;
180182
@@ -185,13 +187,12 @@ protected override void OnBuildInitialized()
185187 {
186188 var apiKey = Environment . GetEnvironmentVariable ( "NUGET_API_KEY" ) ;
187189
188-
189190 if ( apiKey . IsNullOrEmpty ( ) )
190191 {
191192 throw new BuildAbortedException ( "Could not resolve the NuGet API key." ) ;
192193 }
193194
194- foreach ( var nupkg in GlobFiles ( NugetDirectory , "*.nupkg" ) )
195+ foreach ( var nupkg in NugetDirectory . GlobFiles ( "*.nupkg" ) )
195196 {
196197 NuGetPush ( s => s
197198 . SetTargetPath ( nupkg )
0 commit comments