File tree 3 files changed +20
-3
lines changed
source/Nuke.Common/Tools/GitHub
3 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -23,14 +23,14 @@ partial class Build
23
23
[ Parameter ] readonly bool Major ;
24
24
25
25
string MajorMinorPatchVersion => Major ? $ "{ GitVersion . Major + 1 } .0.0" : GitVersion . MajorMinorPatch ;
26
+ string MilestoneTitle => $ "v{ MajorMinorPatchVersion } ";
26
27
27
28
Target Milestone => _ => _
28
29
. Unlisted ( )
29
30
. OnlyWhenStatic ( ( ) => GitRepository . IsOnReleaseBranch ( ) || GitRepository . IsOnHotfixBranch ( ) )
30
31
. Executes ( async ( ) =>
31
32
{
32
- var milestoneTitle = $ "v{ MajorMinorPatchVersion } ";
33
- var milestone = await GitRepository . GetGitHubMilestone ( milestoneTitle ) ;
33
+ var milestone = await GitRepository . GetGitHubMilestone ( MilestoneTitle ) ;
34
34
if ( milestone == null )
35
35
return ;
36
36
Original file line number Diff line number Diff line change 18
18
using Nuke . Common . ProjectModel ;
19
19
using Nuke . Common . Tooling ;
20
20
using Nuke . Common . Tools . DotNet ;
21
+ using Nuke . Common . Tools . GitHub ;
21
22
using Nuke . Common . Tools . GitVersion ;
22
23
using Nuke . Common . Utilities ;
23
24
using Nuke . Components ;
@@ -178,7 +179,13 @@ void DeletePackage(string id, string version)
178
179
. Inherit < ICreateGitHubRelease > ( )
179
180
. TriggeredBy < IPublish > ( )
180
181
. ProceedAfterFailure ( )
181
- . OnlyWhenStatic ( ( ) => GitRepository . IsOnMasterBranch ( ) ) ;
182
+ . OnlyWhenStatic ( ( ) => GitRepository . IsOnMasterBranch ( ) )
183
+ . Executes ( async ( ) =>
184
+ {
185
+ var issues = await GitRepository . GetGitHubMilestoneIssues ( MilestoneTitle ) ;
186
+ foreach ( var issue in issues )
187
+ await GitHubActions . Instance . CreateComment ( issue . Number , $ "Released in { MilestoneTitle } ! 🎉") ;
188
+ } ) ;
182
189
183
190
Target Install => _ => _
184
191
. DependsOn < IPack > ( )
Original file line number Diff line number Diff line change @@ -84,6 +84,16 @@ public static async Task<Milestone> GetGitHubMilestone(this GitRepository reposi
84
84
return milestones . FirstOrDefault ( x => x . Title == name ) ;
85
85
}
86
86
87
+ public static async Task < IReadOnlyList < Issue > > GetGitHubMilestoneIssues ( this GitRepository repository , string name )
88
+ {
89
+ Assert . True ( repository . IsGitHubRepository ( ) ) ;
90
+ var milestone = await repository . GetGitHubMilestone ( name ) . NotNull ( ) ;
91
+ return await GitHubClient . Issue . GetAllForRepository (
92
+ repository . GetGitHubOwner ( ) ,
93
+ repository . GetGitHubName ( ) ,
94
+ new RepositoryIssueRequest { State = ItemStateFilter . All , Milestone = milestone . Number . ToString ( ) } ) ;
95
+ }
96
+
87
97
public static async Task TryCreateGitHubMilestone ( this GitRepository repository , string title )
88
98
{
89
99
try
You can’t perform that action at this time.
0 commit comments