33using Rocket . Surgery . Nuke . ContinuousIntegration ;
44using Rocket . Surgery . Nuke . DotNetCore ;
55using Rocket . Surgery . Nuke . GithubActions ;
6+ using Rocket . Surgery . Nuke . Jobs ;
67
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
339
3410[ GitHubActionsSteps (
3511 "ci-ignore" ,
12+ GitHubActionsImage . MacOsLatest ,
3613 GitHubActionsImage . WindowsLatest ,
3714 GitHubActionsImage . UbuntuLatest ,
3815 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 ) ]
4421) ]
4522[ GitHubActionsSteps (
4623 "ci" ,
4724 GitHubActionsImage . MacOsLatest ,
4825 GitHubActionsImage . WindowsLatest ,
4926 GitHubActionsImage . UbuntuLatest ,
5027 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 = [
5834 nameof ( ICIEnvironment . CIEnvironment ) ,
59- nameof ( ITriggerCodeCoverageReports . TriggerCodeCoverageReports ) ,
6035 nameof ( ITriggerCodeCoverageReports . GenerateCodeCoverageReportCobertura ) ,
6136 nameof ( IGenerateCodeCoverageBadges . GenerateCodeCoverageBadges ) ,
6237 nameof ( IGenerateCodeCoverageReport . GenerateCodeCoverageReport ) ,
6338 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 ) ]
6843) ]
44+ [ CloseMilestoneJob ( AutoGenerate = false ) ]
45+ [ DraftReleaseJob ( AutoGenerate = false ) ]
46+ [ UpdateMilestoneJob ( AutoGenerate = false ) ]
6947[ PrintBuildVersion ]
7048[ PrintCIEnvironment ]
7149[ UploadLogs ]
7250[ TitleEvents ]
7351[ ContinuousIntegrationConventions ]
74- public partial class Solution
52+ internal sealed partial class Pipeline
7553{
7654 public static RocketSurgeonGitHubActionsConfiguration CiIgnoreMiddleware (
7755 RocketSurgeonGitHubActionsConfiguration configuration
7856 )
7957 {
80- configuration . IncludeRepositoryConfigurationFiles ( ) ;
81-
8258 ( ( RocketSurgeonsGithubActionsJob ) configuration . Jobs [ 0 ] ) . Steps = new List < GitHubActionsStep >
8359 {
8460 new RunStep ( "N/A" )
@@ -87,7 +63,7 @@ RocketSurgeonGitHubActionsConfiguration configuration
8763 }
8864 } ;
8965
90- return configuration ;
66+ return configuration . IncludeRepositoryConfigurationFiles ( ) ;
9167 }
9268
9369 public static RocketSurgeonGitHubActionsConfiguration CiMiddleware (
@@ -96,33 +72,32 @@ RocketSurgeonGitHubActionsConfiguration configuration
9672 {
9773 configuration
9874 . ExcludeRepositoryConfigurationFiles ( )
99- . AddNugetPublish ( )
10075 . Jobs . OfType < RocketSurgeonsGithubActionsJob > ( )
10176 . First ( z => z . Name . Equals ( "Build" , StringComparison . OrdinalIgnoreCase ) )
10277 . ConfigureStep < CheckoutStep > ( step => step . FetchDepth = 0 )
103- . UseDotNetSdks ( "3.1" , " 6.0", "8.0" , "9.0" )
78+ . UseDotNetSdks ( "6.0" , "8.0" , "9.0" )
10479 . AddNuGetCache ( )
10580 . AddVscodeExtensionTests ( )
106- . PublishLogs < Solution > ( )
107- . PublishArtifacts < Solution > ( )
81+ . PublishLogs < Pipeline > ( )
82+ . PublishArtifacts < Pipeline > ( )
10883 . FailFast = false ;
10984
11085 return configuration ;
11186 }
11287}
11388
114- public static class Extensions
89+ public static class JobExtensions
11590{
11691 public static RocketSurgeonsGithubActionsJob AddVscodeExtensionTests ( this RocketSurgeonsGithubActionsJob job )
11792 {
11893 return job
11994 . AddStep ( new RunStep ( "Npm install" ) {
12095 Run = "npm ci" ,
121- WorkingDirectory = Solution . VscodeTestExtensionProjectDirectory
96+ WorkingDirectory = Pipeline . VscodeTestExtensionProjectDirectory
12297 } )
12398 . AddStep ( new HeadlessRunStep ( "Vscode extension tests" ) {
12499 Run = "npm run test" ,
125- WorkingDirectory = Solution . VscodeTestExtensionProjectDirectory
100+ WorkingDirectory = Pipeline . VscodeTestExtensionProjectDirectory
126101 } ) ;
127102 }
128103}
0 commit comments