3
3
using Rocket . Surgery . Nuke . ContinuousIntegration ;
4
4
using Rocket . Surgery . Nuke . DotNetCore ;
5
5
using Rocket . Surgery . Nuke . GithubActions ;
6
+ using Rocket . Surgery . Nuke . Jobs ;
6
7
7
- namespace Build ;
8
-
9
- internal class LocalConstants
10
- {
11
- public static string [ ] PathsIgnore => new [ ]
12
- {
13
- ".codecov.yml" ,
14
- ".editorconfig" ,
15
- ".gitattributes" ,
16
- ".gitignore" ,
17
- ".gitmodules" ,
18
- ".lintstagedrc.js" ,
19
- ".prettierignore" ,
20
- ".prettierrc" ,
21
- "LICENSE" ,
22
- "nukeeper.settings.json" ,
23
- "omnisharp.json" ,
24
- "package-lock.json" ,
25
- "package.json" ,
26
- "Readme.md" ,
27
- ".github/dependabot.yml" ,
28
- ".github/labels.yml" ,
29
- ".github/release.yml" ,
30
- ".github/renovate.json" ,
31
- } ;
32
- }
8
+ #pragma warning disable CA1050
33
9
34
10
[ GitHubActionsSteps (
35
11
"ci-ignore" ,
12
+ GitHubActionsImage . MacOsLatest ,
36
13
GitHubActionsImage . WindowsLatest ,
37
14
GitHubActionsImage . UbuntuLatest ,
38
15
AutoGenerate = false ,
39
- On = new [ ] { RocketSurgeonGitHubActionsTrigger . Push } ,
40
- OnPushTags = new [ ] { "v*" } ,
41
- OnPushBranches = new [ ] { "master" , "main" , "next" } ,
42
- OnPullRequestBranches = new [ ] { "master" , "main" , "next" } ,
43
- Enhancements = new [ ] { nameof ( CiIgnoreMiddleware ) }
16
+ On = [ RocketSurgeonGitHubActionsTrigger . Push ] ,
17
+ OnPushTags = [ "v*" ] ,
18
+ OnPushBranches = [ "master" , "main" , "next" ] ,
19
+ OnPullRequestBranches = [ "master" , "main" , "next" ] ,
20
+ Enhancements = [ nameof ( CiIgnoreMiddleware ) ]
44
21
) ]
45
22
[ GitHubActionsSteps (
46
23
"ci" ,
47
24
GitHubActionsImage . MacOsLatest ,
48
25
GitHubActionsImage . WindowsLatest ,
49
26
GitHubActionsImage . UbuntuLatest ,
50
27
AutoGenerate = false ,
51
- On = new [ ] { RocketSurgeonGitHubActionsTrigger . Push } ,
52
- OnPushTags = new [ ] { "v*" } ,
53
- OnPushBranches = new [ ] { "master" , "main" , "next" } ,
54
- OnPullRequestBranches = new [ ] { "master" , "main" , "next" } ,
55
- InvokedTargets = new [ ] { nameof ( Default ) } ,
56
- NonEntryTargets = new [ ]
57
- {
28
+ On = [ RocketSurgeonGitHubActionsTrigger . Push ] ,
29
+ OnPushTags = [ "v*" ] ,
30
+ OnPushBranches = [ "master" , "main" , "next" ] ,
31
+ OnPullRequestBranches = [ "master" , "main" , "next" ] ,
32
+ InvokedTargets = [ nameof ( Default ) ] ,
33
+ NonEntryTargets = [
58
34
nameof ( ICIEnvironment . CIEnvironment ) ,
59
- nameof ( ITriggerCodeCoverageReports . TriggerCodeCoverageReports ) ,
60
35
nameof ( ITriggerCodeCoverageReports . GenerateCodeCoverageReportCobertura ) ,
61
36
nameof ( IGenerateCodeCoverageBadges . GenerateCodeCoverageBadges ) ,
62
37
nameof ( IGenerateCodeCoverageReport . GenerateCodeCoverageReport ) ,
63
38
nameof ( IGenerateCodeCoverageSummary . GenerateCodeCoverageSummary ) ,
64
- nameof ( Default )
65
- } ,
66
- ExcludedTargets = new [ ] { nameof ( ICanClean . Clean ) , nameof ( ICanRestoreWithDotNetCore . DotnetToolRestore ) } ,
67
- Enhancements = new [ ] { nameof ( CiMiddleware ) }
39
+ nameof ( Default ) ,
40
+ ] ,
41
+ ExcludedTargets = [ nameof ( ICanClean . Clean ) , nameof ( ICanRestoreWithDotNetCore . DotnetToolRestore ) ] ,
42
+ Enhancements = [ nameof ( CiMiddleware ) ]
68
43
) ]
44
+ [ CloseMilestoneJob ( AutoGenerate = false ) ]
45
+ [ DraftReleaseJob ( AutoGenerate = false ) ]
46
+ [ UpdateMilestoneJob ( AutoGenerate = false ) ]
69
47
[ PrintBuildVersion ]
70
48
[ PrintCIEnvironment ]
71
49
[ UploadLogs ]
72
50
[ TitleEvents ]
73
51
[ ContinuousIntegrationConventions ]
74
- public partial class Solution
52
+ internal sealed partial class Pipeline
75
53
{
76
54
public static RocketSurgeonGitHubActionsConfiguration CiIgnoreMiddleware (
77
55
RocketSurgeonGitHubActionsConfiguration configuration
78
56
)
79
57
{
80
- configuration . IncludeRepositoryConfigurationFiles ( ) ;
81
-
82
58
( ( RocketSurgeonsGithubActionsJob ) configuration . Jobs [ 0 ] ) . Steps = new List < GitHubActionsStep >
83
59
{
84
60
new RunStep ( "N/A" )
@@ -87,7 +63,7 @@ RocketSurgeonGitHubActionsConfiguration configuration
87
63
}
88
64
} ;
89
65
90
- return configuration ;
66
+ return configuration . IncludeRepositoryConfigurationFiles ( ) ;
91
67
}
92
68
93
69
public static RocketSurgeonGitHubActionsConfiguration CiMiddleware (
@@ -96,33 +72,32 @@ RocketSurgeonGitHubActionsConfiguration configuration
96
72
{
97
73
configuration
98
74
. ExcludeRepositoryConfigurationFiles ( )
99
- . AddNugetPublish ( )
100
75
. Jobs . OfType < RocketSurgeonsGithubActionsJob > ( )
101
76
. First ( z => z . Name . Equals ( "Build" , StringComparison . OrdinalIgnoreCase ) )
102
77
. ConfigureStep < CheckoutStep > ( step => step . FetchDepth = 0 )
103
- . UseDotNetSdks ( "3.1" , " 6.0", "8.0" , "9.0" )
78
+ . UseDotNetSdks ( "6.0" , "8.0" , "9.0" )
104
79
. AddNuGetCache ( )
105
80
. AddVscodeExtensionTests ( )
106
- . PublishLogs < Solution > ( )
107
- . PublishArtifacts < Solution > ( )
81
+ . PublishLogs < Pipeline > ( )
82
+ . PublishArtifacts < Pipeline > ( )
108
83
. FailFast = false ;
109
84
110
85
return configuration ;
111
86
}
112
87
}
113
88
114
- public static class Extensions
89
+ public static class JobExtensions
115
90
{
116
91
public static RocketSurgeonsGithubActionsJob AddVscodeExtensionTests ( this RocketSurgeonsGithubActionsJob job )
117
92
{
118
93
return job
119
94
. AddStep ( new RunStep ( "Npm install" ) {
120
95
Run = "npm ci" ,
121
- WorkingDirectory = Solution . VscodeTestExtensionProjectDirectory
96
+ WorkingDirectory = Pipeline . VscodeTestExtensionProjectDirectory
122
97
} )
123
98
. AddStep ( new HeadlessRunStep ( "Vscode extension tests" ) {
124
99
Run = "npm run test" ,
125
- WorkingDirectory = Solution . VscodeTestExtensionProjectDirectory
100
+ WorkingDirectory = Pipeline . VscodeTestExtensionProjectDirectory
126
101
} ) ;
127
102
}
128
103
}
0 commit comments