File tree 7 files changed +189
-3
lines changed
7 files changed +189
-3
lines changed Original file line number Diff line number Diff line change
1
+ using System . Diagnostics . CodeAnalysis ;
2
+ using Nuke . Common ;
3
+ using Nuke . Common . CI . GitHubActions ;
4
+ using Serilog ;
5
+
6
+ // ReSharper disable UnusedMember.Local
7
+ // ReSharper disable AllUnderscoreLocalParameterName
8
+
9
+ [ GitHubActions (
10
+ "cd-publish-shared" ,
11
+ GitHubActionsImage . WindowsLatest ,
12
+ InvokedTargets = [
13
+ nameof ( Shared_Push ) ,
14
+ ] ,
15
+ ImportSecrets = [ "NUGET_PUSH_SHARED" ] ,
16
+ OnWorkflowDispatchOptionalInputs = [ "SharedLibVersion" ]
17
+ ) ]
18
+
19
+ [ GitHubActions (
20
+ "cd-publish-extension" ,
21
+ GitHubActionsImage . WindowsLatest ,
22
+ InvokedTargets = [
23
+ nameof ( Extension_Push ) ,
24
+ ] ,
25
+ ImportSecrets = [ "NUGET_PUSH_SHARED" ] ,
26
+ OnWorkflowDispatchRequiredInputs = [ "ExtensionName" ] ,
27
+ OnWorkflowDispatchOptionalInputs = [ "ExtensionLibVersion" ]
28
+ ) ]
29
+
30
+ // Continuous Integration: Validate pull requests
31
+ [ GitHubActions (
32
+ "pr-validation" ,
33
+ GitHubActionsImage . UbuntuLatest ,
34
+ InvokedTargets = [
35
+ nameof ( Solution_Build ) ,
36
+ ] ,
37
+ OnPullRequestBranches = [ "master" ]
38
+ ) ]
39
+ [ SuppressMessage ( "ReSharper" , "CheckNamespace" ) ]
40
+
41
+ // CI/CD targets
42
+ partial class Build
43
+ {
44
+ Target UpdateYaml => _ => _ . Executes ( ( ) => Log . Information ( "Generating YAML..." ) ) ;
45
+ }
Original file line number Diff line number Diff line change 18
18
[ SuppressMessage ( "ReSharper" , "CheckNamespace" ) ]
19
19
partial class Build
20
20
{
21
- [ Required ]
22
21
[ Parameter ( "Extension library name" ) ]
23
22
string ExtensionName = EnvironmentInfo . GetVariable < string > ( "EXTENSION_NAME" ) ?? string . Empty ;
24
23
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ partial class Build
24
24
string SharedLibVersion = EnvironmentInfo . GetVariable < string > ( "SHARED_LIB_VERSION" ) ?? string . Empty ;
25
25
26
26
[ Parameter ( "NuGet push API key" ) ]
27
- string PushApiKey => EnvironmentInfo . GetVariable < string > ( "NUGET_API " ) ?? Settings . Value < string > ( "nuget_push_api_key" ) ;
27
+ string PushApiKey => EnvironmentInfo . GetVariable < string > ( "NUGET_PUSH_SHARED " ) ?? Settings . Value < string > ( "nuget_push_api_key" ) ;
28
28
29
29
Target Shared_FindNextVersion => _ => _
30
30
. OnlyWhenDynamic ( ( ) => string . IsNullOrWhiteSpace ( SharedLibVersion ) )
Original file line number Diff line number Diff line change 1
- using System . IO ;
1
+ using System ;
2
+ using System . Diagnostics . CodeAnalysis ;
3
+ using System . IO ;
4
+ using System . Linq ;
2
5
using Nuke . Common ;
3
6
using Nuke . Common . Tools . DotNet ;
4
7
using static Nuke . Common . Tools . DotNet . DotNetTasks ;
5
8
9
+ [ SuppressMessage ( "ReSharper" , "AllUnderscoreLocalParameterName" ) ]
10
+ [ SuppressMessage ( "ReSharper" , "CheckNamespace" ) ]
6
11
partial class Build
7
12
{
8
13
Target Solution_Clean => _ => _
@@ -18,4 +23,13 @@ partial class Build
18
23
{
19
24
DotNetRestore ( x => x . SetProjectFile ( Solution ) ) ;
20
25
} ) ;
26
+
27
+ Target Solution_Build => _ => _
28
+ . DependsOn ( Solution_Restore )
29
+ . Executes ( ( ) =>
30
+ {
31
+ // build all projects except 'Builder.Shared'
32
+ foreach ( var project in Solution . AllProjects . Where ( x => ! x . Name . Equals ( "Builder.Shared" , StringComparison . Ordinal ) ) )
33
+ DotNetBuild ( x => x . SetProjectFile ( project ) ) ;
34
+ } ) ;
21
35
}
Original file line number Diff line number Diff line change
1
+ # ------------------------------------------------------------------------------
2
+ # <auto-generated>
3
+ #
4
+ # This code was generated.
5
+ #
6
+ # - To turn off auto-generation set:
7
+ #
8
+ # [GitHubActions (AutoGenerate = false)]
9
+ #
10
+ # - To trigger manual generation invoke:
11
+ #
12
+ # nuke --generate-configuration GitHubActions_cd-publish-extension --host GitHubActions
13
+ #
14
+ # </auto-generated>
15
+ # ------------------------------------------------------------------------------
16
+
17
+ name : cd-publish-extension
18
+
19
+ on :
20
+ workflow_dispatch :
21
+ inputs :
22
+ ExtensionLibVersion :
23
+ description : " Extension Lib Version"
24
+ required : false
25
+ ExtensionName :
26
+ description : " Extension Name"
27
+ required : true
28
+
29
+ jobs :
30
+ windows-latest :
31
+ name : windows-latest
32
+ runs-on : windows-latest
33
+ steps :
34
+ - uses : actions/checkout@v4
35
+ - name : ' Cache: .nuke/temp, ~/.nuget/packages'
36
+ uses : actions/cache@v4
37
+ with :
38
+ path : |
39
+ .nuke/temp
40
+ ~/.nuget/packages
41
+ key : ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }}
42
+ - name : ' Run: Extension_Push'
43
+ run : ./build.cmd Extension_Push
44
+ env :
45
+ ExtensionLibVersion : ${{ github.event.inputs.ExtensionLibVersion }}
46
+ ExtensionName : ${{ github.event.inputs.ExtensionName }}
47
+ NUGET_PUSH_SHARED : ${{ secrets.NUGET_PUSH_SHARED }}
Original file line number Diff line number Diff line change
1
+ # ------------------------------------------------------------------------------
2
+ # <auto-generated>
3
+ #
4
+ # This code was generated.
5
+ #
6
+ # - To turn off auto-generation set:
7
+ #
8
+ # [GitHubActions (AutoGenerate = false)]
9
+ #
10
+ # - To trigger manual generation invoke:
11
+ #
12
+ # nuke --generate-configuration GitHubActions_cd-publish-shared --host GitHubActions
13
+ #
14
+ # </auto-generated>
15
+ # ------------------------------------------------------------------------------
16
+
17
+ name : cd-publish-shared
18
+
19
+ on :
20
+ workflow_dispatch :
21
+ inputs :
22
+ SharedLibVersion :
23
+ description : " Shared Lib Version"
24
+ required : false
25
+
26
+ jobs :
27
+ windows-latest :
28
+ name : windows-latest
29
+ runs-on : windows-latest
30
+ steps :
31
+ - uses : actions/checkout@v4
32
+ - name : ' Cache: .nuke/temp, ~/.nuget/packages'
33
+ uses : actions/cache@v4
34
+ with :
35
+ path : |
36
+ .nuke/temp
37
+ ~/.nuget/packages
38
+ key : ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }}
39
+ - name : ' Run: Shared_Push'
40
+ run : ./build.cmd Shared_Push
41
+ env :
42
+ SharedLibVersion : ${{ github.event.inputs.SharedLibVersion }}
43
+ NUGET_PUSH_SHARED : ${{ secrets.NUGET_PUSH_SHARED }}
Original file line number Diff line number Diff line change
1
+ # ------------------------------------------------------------------------------
2
+ # <auto-generated>
3
+ #
4
+ # This code was generated.
5
+ #
6
+ # - To turn off auto-generation set:
7
+ #
8
+ # [GitHubActions (AutoGenerate = false)]
9
+ #
10
+ # - To trigger manual generation invoke:
11
+ #
12
+ # nuke --generate-configuration GitHubActions_pr-validation --host GitHubActions
13
+ #
14
+ # </auto-generated>
15
+ # ------------------------------------------------------------------------------
16
+
17
+ name : pr-validation
18
+
19
+ on :
20
+ pull_request :
21
+ branches :
22
+ - master
23
+
24
+ jobs :
25
+ ubuntu-latest :
26
+ name : ubuntu-latest
27
+ runs-on : ubuntu-latest
28
+ steps :
29
+ - uses : actions/checkout@v4
30
+ - name : ' Cache: .nuke/temp, ~/.nuget/packages'
31
+ uses : actions/cache@v4
32
+ with :
33
+ path : |
34
+ .nuke/temp
35
+ ~/.nuget/packages
36
+ key : ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }}
37
+ - name : ' Run: Solution_Build'
38
+ run : ./build.cmd Solution_Build
You can’t perform that action at this time.
0 commit comments