Skip to content

Commit fc8922a

Browse files
Merge pull request #1575 from RocketSurgeonsGuild/nuke-latest
Updated to the latest nuke packages
2 parents 87372d0 + 729ab6d commit fc8922a

File tree

9 files changed

+332
-28
lines changed

9 files changed

+332
-28
lines changed

.build/Pipeline.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using Nuke.Common.CI.GitHubActions;
33
using Rocket.Surgery.Nuke.ContinuousIntegration;
44
using Rocket.Surgery.Nuke.GithubActions;
5+
using Rocket.Surgery.Nuke.Jobs;
56

67
#pragma warning disable CA1050
78

@@ -33,7 +34,10 @@
3334
OnPullRequestTargetBranches = ["master", "main", "next"],
3435
Enhancements = [nameof(LintStagedMiddleware)]
3536
)]
36-
[PrintBuildVersion]
37+
[CloseMilestoneJob]
38+
[DraftReleaseJob]
39+
[UpdateMilestoneJob]
40+
[PublishNugetPackagesJob("RSG_NUGET_API_KEY", "ci")]
3741
[PrintCIEnvironment]
3842
[UploadLogs]
3943
[TitleEvents]
@@ -58,11 +62,10 @@ public static RocketSurgeonGitHubActionsConfiguration CiMiddleware(RocketSurgeon
5862
{
5963
_ = configuration
6064
.ExcludeRepositoryConfigurationFiles()
61-
.AddNugetPublish()
6265
.Jobs.OfType<RocketSurgeonsGithubActionsJob>()
6366
.First(z => z.Name.Equals("build", StringComparison.OrdinalIgnoreCase))
6467
.UseDotNetSdks("8.0", "9.0")
65-
// .ConfigureForGitVersion()
68+
// .ConfigureForGitVersion()
6669
.ConfigureStep<CheckoutStep>(step => step.FetchDepth = 0)
6770
.PublishLogs<Pipeline>();
6871

.config/dotnet-tools.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@
5656
"version": "0.6.0",
5757
"commands": ["dotnet-verify"],
5858
"rollForward": false
59+
},
60+
"gitreleasemanager.tool": {
61+
"version": "0.18.0",
62+
"commands": ["dotnet-gitreleasemanager"],
63+
"rollForward": false
5964
}
6065
}
6166
}

.github/workflows/ci.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,3 @@ jobs:
184184
with:
185185
name: 'nuget'
186186
path: 'artifacts/nuget/'
187-
Publish:
188-
needs:
189-
- Build
190-
uses: RocketSurgeonsGuild/actions/.github/workflows/publish-nuget.yml@v0.3.15
191-
secrets:
192-
RSG_NUGET_API_KEY: '${{ secrets.RSG_NUGET_API_KEY }}'
193-
RSG_AZURE_DEVOPS: '${{ secrets.RSG_AZURE_DEVOPS }}'
Lines changed: 93 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,98 @@
1+
# ------------------------------------------------------------------------------
2+
# <auto-generated>
3+
#
4+
# This code was generated.
5+
#
6+
# - To turn off auto-generation set:
7+
#
8+
# [CloseMilestoneJob (AutoGenerate = false)]
9+
#
10+
# - To trigger manual generation invoke:
11+
#
12+
# nuke --generate-configuration GitHubActions_close-milestone --host GitHubActions
13+
#
14+
# </auto-generated>
15+
# ------------------------------------------------------------------------------
16+
117
name: Close Milestone
18+
219
on:
20+
workflow_call:
21+
secrets:
22+
RSG_BOT_TOKEN:
23+
required: true
324
release:
4-
types:
5-
- released
25+
permissions:
26+
actions: read
27+
checks: read
28+
contents: read
29+
deployments: read
30+
id-token: none
31+
issues: write
32+
discussions: none
33+
packages: none
34+
pages: none
35+
pull-requests: write
36+
repository-projects: none
37+
security-events: none
38+
statuses: write
39+
640
jobs:
741
close_milestone:
8-
uses: RocketSurgeonsGuild/actions/.github/workflows/close-milestone6.yml@v0.3.15
9-
secrets:
10-
RSG_BOT_TOKEN: ${{ secrets.RSG_BOT_TOKEN }}
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Checkout
45+
uses: actions/checkout@v4
46+
with:
47+
clean: 'false'
48+
fetch-depth: '0'
49+
- name: Fetch all history for all tags and branches
50+
run: |
51+
git fetch --prune
52+
- name: 📲 Install DotNet
53+
uses: actions/setup-dotnet@v4
54+
- name: ⚒️ dotnet tool restore
55+
run: |
56+
dotnet tool restore
57+
- name: 🔨 Use GitVersion
58+
id: gitversion
59+
shell: pwsh
60+
run: |
61+
$data = dotnet gitversion | ConvertFrom-Json
62+
foreach ($item in $data.PSObject.Properties) {
63+
$key = $item.Name
64+
$value = $item.Value
65+
echo "$($key.Substring(0,1).ToLower() + $key.Substring(1))=$value" >> $env:GITHUB_OUTPUT
66+
}
67+
- name: Create Milestone
68+
env:
69+
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
70+
uses: WyriHaximus/github-action-create-milestone@v1
71+
with:
72+
title: 'v${{ steps.gitversion.outputs.majorMinorPatch }}'
73+
- name: sync milestones
74+
uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.15
75+
with:
76+
default-label: ':sparkles: mysterious'
77+
github-token: '${{ secrets.GITHUB_TOKEN }}'
78+
- name: 📲 Install GitReleaseManager
79+
uses: gittools/actions/gitreleasemanager/setup@v3.1.1
80+
with:
81+
versionSpec: '0.18.0'
82+
- name: Get Repo and Owner
83+
id: repository
84+
if: ${{ !github.event.release.prerelease && steps.gitversion.outputs.preReleaseTag == '' }}
85+
shell: pwsh
86+
run: |
87+
$parts = $ENV:GITHUB_REPOSITORY.Split('/')
88+
echo "::set-output name=owner::$($parts[0])"
89+
echo "::set-output name=repository::$($parts[1])"
90+
- name: Close Milestone
91+
if: ${{ !github.event.release.prerelease && steps.gitversion.outputs.preReleaseTag == '' }}
92+
shell: pwsh
93+
run: |
94+
dotnet gitreleasemanager close `
95+
-o "${{ steps.repository.outputs.owner }}" `
96+
-r "${{ steps.repository.outputs.repository }}" `
97+
--token "${{ secrets.GITHUB_TOKEN }}" `
98+
-m "v${{ steps.gitversion.outputs.majorMinorPatch }}"
Lines changed: 89 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,97 @@
1-
name: Create Milestone and Draft Release
1+
# ------------------------------------------------------------------------------
2+
# <auto-generated>
3+
#
4+
# This code was generated.
5+
#
6+
# - To turn off auto-generation set:
7+
#
8+
# [DraftReleaseJob (AutoGenerate = false)]
9+
#
10+
# - To trigger manual generation invoke:
11+
#
12+
# nuke --generate-configuration GitHubActions_draft-release --host GitHubActions
13+
#
14+
# </auto-generated>
15+
# ------------------------------------------------------------------------------
16+
17+
name: Draft Release and Create Milestone
18+
219
on:
20+
workflow_call:
21+
secrets:
22+
RSG_BOT_TOKEN:
23+
required: true
324
push:
425
branches:
5-
- master
26+
- 'master'
627
paths-ignore:
728
- '**/*.md'
829
schedule:
930
- cron: '0 0 * * 4'
31+
permissions:
32+
actions: read
33+
checks: read
34+
contents: read
35+
deployments: read
36+
id-token: none
37+
issues: write
38+
discussions: none
39+
packages: none
40+
pages: none
41+
pull-requests: write
42+
repository-projects: none
43+
security-events: none
44+
statuses: write
45+
1046
jobs:
11-
create_milestone_and_draft_release:
12-
uses: RocketSurgeonsGuild/actions/.github/workflows/draft-release6.yml@v0.3.15
13-
secrets:
14-
RSG_BOT_TOKEN: ${{ secrets.RSG_BOT_TOKEN }}
47+
draft_release:
48+
runs-on: ubuntu-latest
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@v4
52+
with:
53+
clean: 'false'
54+
fetch-depth: '0'
55+
- name: Fetch all history for all tags and branches
56+
run: |
57+
git fetch --prune
58+
- name: 📲 Install DotNet
59+
uses: actions/setup-dotnet@v4
60+
- name: ⚒️ dotnet tool restore
61+
run: |
62+
dotnet tool restore
63+
- name: 🔨 Use GitVersion
64+
id: gitversion
65+
shell: pwsh
66+
run: |
67+
$data = dotnet gitversion | ConvertFrom-Json
68+
foreach ($item in $data.PSObject.Properties) {
69+
$key = $item.Name
70+
$value = $item.Value
71+
echo "$($key.Substring(0,1).ToLower() + $key.Substring(1))=$value" >> $env:GITHUB_OUTPUT
72+
}
73+
- name: Create Milestone
74+
env:
75+
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
76+
uses: WyriHaximus/github-action-create-milestone@v1
77+
with:
78+
title: 'v${{ steps.gitversion.outputs.majorMinorPatch }}'
79+
- name: sync milestones
80+
uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.15
81+
with:
82+
default-label: ':sparkles: mysterious'
83+
github-token: '${{ secrets.GITHUB_TOKEN }}'
84+
- name: Create Release
85+
uses: ncipollo/release-action@v1
86+
with:
87+
allowUpdates: 'true'
88+
generateReleaseNotes: 'true'
89+
updateOnlyUnreleased: 'true'
90+
draft: 'true'
91+
omitBodyDuringUpdate: 'true'
92+
omitNameDuringUpdate: 'true'
93+
omitDraftDuringUpdate: 'true'
94+
name: 'v${{ steps.gitversion.outputs.majorMinorPatch }}'
95+
tag: 'v${{ steps.gitversion.outputs.majorMinorPatch }}'
96+
token: '${{ secrets.RSG_BOT_TOKEN }}'
97+
commit: '${{ github.base_ref }}'
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# ------------------------------------------------------------------------------
2+
# <auto-generated>
3+
#
4+
# This code was generated.
5+
#
6+
# - To turn off auto-generation set:
7+
#
8+
# [PublishNugetPackagesJob (AutoGenerate = false)]
9+
#
10+
# - To trigger manual generation invoke:
11+
#
12+
# nuke --generate-configuration GitHubActions_publish-nuget --host GitHubActions
13+
#
14+
# </auto-generated>
15+
# ------------------------------------------------------------------------------
16+
17+
name: Publish Nuget Packages
18+
19+
on:
20+
workflow_run:
21+
workflows:
22+
- 'ci'
23+
types:
24+
- 'completed'
25+
permissions:
26+
actions: read
27+
checks: read
28+
contents: read
29+
deployments: read
30+
id-token: none
31+
issues: write
32+
discussions: none
33+
packages: none
34+
pages: none
35+
pull-requests: write
36+
repository-projects: none
37+
security-events: none
38+
statuses: write
39+
40+
jobs:
41+
publish_nuget:
42+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: Dump GitHub context
46+
env:
47+
GITHUB_CONTEXT: '${{ toJson(github) }}'
48+
shell: pwsh
49+
run: |
50+
echo "$GITHUB_CONTEXT"
51+
- name: 🚀 NuGet
52+
uses: actions/download-artifact@v4
53+
with:
54+
name: 'nuget'
55+
github-token: '${{ secrets.GITHUB_TOKEN }}'
56+
run-id: '${{ github.event.workflow_run.id }}'
57+
- name: nuget.org
58+
env:
59+
ApiKey: '${{ secrets.RSG_NUGET_API_KEY }}'
60+
if: startsWith(github.event.workflow_run.head_branch, 'v') && contains(github.event.workflow_run.head_branch, '.') && !contains(github.event.workflow_run.head_branch, '/')
61+
shell: pwsh
62+
run: |
63+
dotnet nuget push **/*.nupkg --skip-duplicate -s nuget.org --api-key $ENV:ApiKey
64+
dotnet nuget push **/*.snupkg --skip-duplicate -s nuget.org --api-key $ENV:ApiKey

0 commit comments

Comments
 (0)