1
1
using System ;
2
2
using System . Linq ;
3
+ using Newtonsoft . Json ;
3
4
using Nuke . Common ;
4
5
using Nuke . Common . CI ;
5
6
using Nuke . Common . CI . GitHubActions ;
@@ -56,6 +57,7 @@ class Build : NukeBuild
56
57
. Before ( Restore )
57
58
. Executes ( ( ) =>
58
59
{
60
+ Console . WriteLine ( JsonConvert . SerializeObject ( GitRepository ) ) ;
59
61
SourceDirectory . GlobDirectories ( "**/bin" , "**/obj" )
60
62
. ForEach ( DeleteDirectory ) ;
61
63
TestsDirectory . GlobDirectories ( "**/bin" , "**/obj" )
@@ -93,17 +95,16 @@ class Build : NukeBuild
93
95
. Executes ( ( ) =>
94
96
{
95
97
DotNetTest ( s => s
96
- . SetProjectFile ( TestsDirectory )
98
+ . SetProjectFile ( Solution )
97
99
. SetConfiguration ( Configuration )
98
100
. EnableNoBuild ( )
99
101
. EnableNoRestore ( )
100
- . SetResultsDirectory ( TestsResultDirectory )
101
102
) ;
102
103
}
103
104
) ;
104
105
105
106
Target Pack => _ => _
106
- . DependsOn ( Compile )
107
+ . DependsOn ( Test )
107
108
. Produces ( NugetDestinationDirectory / "*.nupkg" )
108
109
. Executes ( ( ) =>
109
110
{
@@ -112,12 +113,21 @@ class Build : NukeBuild
112
113
. SetConfiguration ( Configuration )
113
114
. EnableNoBuild ( )
114
115
. EnableNoRestore ( )
116
+ . SetIncludeSymbols ( true )
115
117
. SetVersion ( GitVersion . NuGetVersionV2 )
116
118
. SetOutputDirectory ( NugetDestinationDirectory )
117
119
) ;
118
120
}
119
121
) ;
120
122
123
+ Target DeployToGithubPackage => _ => _
124
+ . DependsOn ( Pack )
125
+ . Executes ( ( ) =>
126
+ {
127
+
128
+ }
129
+ ) ;
130
+
121
131
Target Deploy => _ => _
122
132
. DependsOn ( Pack )
123
133
. OnlyWhenStatic ( ( ) => GitRepository . Branch == "refs/heads/master" )
@@ -132,6 +142,7 @@ class Build : NukeBuild
132
142
. ForEach ( x =>
133
143
{
134
144
DotNetNuGetPush ( s => s
145
+ . SetTargetPath ( x )
135
146
. SetSource ( NugetApiUrl )
136
147
. SetApiKey ( NugetApiKey )
137
148
. SetSkipDuplicate ( true )
@@ -142,5 +153,8 @@ class Build : NukeBuild
142
153
) ;
143
154
144
155
Target ContinousIntegration => _ => _
156
+ . DependsOn ( Clean ) ;
157
+
158
+ Target ContinousDeployment => _ => _
145
159
. DependsOn ( Deploy ) ;
146
160
}
0 commit comments