Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added some more workflow management to remove the need for some of ot… #1451

Merged
merged 3 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .build/Build.CI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
On = [RocketSurgeonGitHubActionsTrigger.WorkflowCall],
InvokedTargets = [nameof(WithOutputs)]
)]
[CloseMilestoneJob]
[DraftReleaseJob]
[UpdateMilestoneJob]
[PublishNugetPackagesJob("RSG_NUGET_API_KEY")]
[GitHubActionsVariable("THIS_IS_A_VARIABLE", Alias = "ThisIsAOtherVariable")]
[GitHubActionsVariable("THIS_IS_ANOTHER_VARIABLE")]
[GitHubActionsInput("THIS_IS_A_INPUT" /*, Alias = "ThisIsAInput"*/)]
Expand Down Expand Up @@ -84,7 +88,7 @@ public static RocketSurgeonGitHubActionsConfiguration CiIgnoreMiddleware(RocketS
.ProducesGithubActionsOutput("iSetAThing", "Some output value")
.Requires(() => ThisIsAInput)
.Executes(() => GitHubActions.Instance?.SetOutput("iSetAThing", "myValue"));
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
[Parameter]
public string ThisIsAInput { get; set; }

Expand Down Expand Up @@ -122,11 +126,10 @@ public static RocketSurgeonGitHubActionsConfiguration CiMiddleware(RocketSurgeon
{
_ = configuration
.ExcludeRepositoryConfigurationFiles()
.AddNugetPublish()
.Jobs.OfType<RocketSurgeonsGithubActionsJob>()
.First(z => z.Name.Equals("Build", StringComparison.OrdinalIgnoreCase))
.UseDotNetSdks("8.0", "9.0")
// .ConfigureForGitVersion()
// .ConfigureForGitVersion()
.ConfigureStep<CheckoutStep>(step => step.FetchDepth = 0)
.PublishLogs<Pipeline>();

Expand Down
2 changes: 1 addition & 1 deletion .build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
[LocalBuildConventions]
#pragma warning disable CA1050
internal partial class Pipeline : NukeBuild,
#pragma warning restore CA1050
#pragma warning restore CA1050
ICanRestoreWithDotNetCore,
ICanBuildWithDotNetCore,
ICanTestWithDotNetCore,
Expand Down
5 changes: 5 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@
"version": "0.6.0",
"commands": ["dotnet-verify"],
"rollForward": false
},
"gitreleasemanager.tool": {
"version": "0.18.0",
"commands": ["dotnet-gitreleasemanager"],
"rollForward": false
}
}
}
15 changes: 2 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,10 @@ on:
workflow_call:
secrets:
THIS_IS_A_SECRET:
required: False
RSG_NUGET_API_KEY:
required: False
RSG_AZURE_DEVOPS:
required: False
required: false
CODECOV_TOKEN:
description: 'The codecov token'
required: False
required: false
push:
branches:
- 'master'
Expand Down Expand Up @@ -192,10 +188,3 @@ jobs:
with:
name: 'nuget'
path: 'artifacts/nuget/'
Publish:
needs:
- Build
uses: RocketSurgeonsGuild/actions/.github/workflows/publish-nuget.yml@v0.3.15
secrets:
RSG_NUGET_API_KEY: '${{ secrets.RSG_NUGET_API_KEY }}'
RSG_AZURE_DEVOPS: '${{ secrets.RSG_AZURE_DEVOPS }}'
94 changes: 89 additions & 5 deletions .github/workflows/close-milestone.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,94 @@
# ------------------------------------------------------------------------------
# <auto-generated>
#
# This code was generated.
#
# - To turn off auto-generation set:
#
# [CloseMilestoneJob (AutoGenerate = false)]
#
# - To trigger manual generation invoke:
#
# nuke --generate-configuration GitHubActions_close-milestone --host GitHubActions
#
# </auto-generated>
# ------------------------------------------------------------------------------

name: Close Milestone

on:
workflow_call:
secrets:
RSG_BOT_TOKEN:
required: true
release:
types:
- released
permissions:
actions: read
checks: read
contents: read
deployments: read
id-token: none
issues: write
discussions: none
packages: none
pages: none
pull-requests: write
repository-projects: none
security-events: none
statuses: write

jobs:
close_milestone:
uses: RocketSurgeonsGuild/actions/.github/workflows/close-milestone6.yml@v0.3.15
secrets:
RSG_BOT_TOKEN: ${{ secrets.RSG_BOT_TOKEN }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
clean: 'false'
fetch-depth: '0'
- name: Fetch all history for all tags and branches
run: |
git fetch --prune
- name: 📲 Install DotNet
uses: actions/setup-dotnet@v3
- name: 📲 Install GitVersion
if: ${{ github.event.action == 'opened' }}
uses: gittools/actions/gitversion/setup@v3.1.1
with:
versionSpec: '6.1.0'
- name: 📲 Install GitReleaseManager
if: ${{ github.event.action == 'opened' }}
uses: gittools/actions/gitreleasemanager/setup@v3.1.1
with:
versionSpec: '0.18.0'
- name: Create Milestone
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
if: ${{ github.event.action == 'opened' }}
continue-on-error: true
uses: WyriHaximus/github-action-create-milestone@v1
with:
title: 'v${{ steps.gitversion.outputs.majorMinorPatch }}'
- name: sync milestones
env:
github-token: '${{ secrets.GITHUB_TOKEN }}'
uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.15
with:
default-label: ':sparkles: mysterious'
- name: Get Repo and Owner
id: repository
if: ${{ !github.event.release.prerelease && steps.gitversion.outputs.preReleaseTag == '' }}
shell: pwsh
run: |
$parts = $ENV:GITHUB_REPOSITORY.Split('/')
echo "::set-output name=owner::$($parts[0])"
echo "::set-output name=repository::$($parts[1])"
- name: Close Milestone
if: ${{ !github.event.release.prerelease && steps.gitversion.outputs.preReleaseTag == '' }}
shell: pwsh
run: |
dotnet gitreleasemanager close `
-o "${{ steps.repository.outputs.owner }}" `
-r "${{ steps.repository.outputs.repository }}" `
--token "${{ secrets.GITHUB_TOKEN }}" `
-m "v${{ steps.gitversion.outputs.majorMinorPatch }}"
16 changes: 0 additions & 16 deletions .github/workflows/dependabot-merge.yml

This file was deleted.

90 changes: 84 additions & 6 deletions .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,92 @@
name: Create Milestone and Draft Release
# ------------------------------------------------------------------------------
# <auto-generated>
#
# This code was generated.
#
# - To turn off auto-generation set:
#
# [DraftReleaseJob (AutoGenerate = false)]
#
# - To trigger manual generation invoke:
#
# nuke --generate-configuration GitHubActions_draft-release --host GitHubActions
#
# </auto-generated>
# ------------------------------------------------------------------------------

name: Draft Release and Create Milestone

on:
workflow_call:
secrets:
RSG_BOT_TOKEN:
required: true
push:
branches:
- master
- 'master'
paths-ignore:
- '**/*.md'
schedule:
- cron: '0 0 * * 4'
permissions:
actions: read
checks: read
contents: read
deployments: read
id-token: none
issues: write
discussions: none
packages: none
pages: none
pull-requests: write
repository-projects: none
security-events: none
statuses: write

jobs:
create_milestone_and_draft_release:
uses: RocketSurgeonsGuild/actions/.github/workflows/draft-release6.yml@v0.3.15
secrets:
RSG_BOT_TOKEN: ${{ secrets.RSG_BOT_TOKEN }}
draft_release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
clean: 'false'
fetch-depth: '0'
- name: Fetch all history for all tags and branches
run: |
git fetch --prune
- name: 📲 Install DotNet
uses: actions/setup-dotnet@v3
- name: 📲 Install GitVersion
if: ${{ github.event.action == 'opened' }}
uses: gittools/actions/gitversion/setup@v3.1.1
with:
versionSpec: '6.1.0'
- name: 📲 Install GitReleaseManager
if: ${{ github.event.action == 'opened' }}
uses: gittools/actions/gitreleasemanager/setup@v3.1.1
with:
versionSpec: '0.18.0'
- name: Create Milestone
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
if: ${{ github.event.action == 'opened' }}
uses: WyriHaximus/github-action-create-milestone@v1
with:
title: 'v${{ steps.gitversion.outputs.majorMinorPatch }}'
- name: sync milestones
uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.15
with:
default-label: ':sparkles: mysterious'
github-token: '${{ secrets.GITHUB_TOKEN }'
- name: Create Release
uses: ncipollo/release-action@v1
with:
allowUpdates: 'true'
generateReleaseNotes: 'true'
draft: 'true'
omitNameDuringUpdate: 'true'
name: 'v${{ steps.gitversion.outputs.majorMinorPatch }}'
tag: 'v${{ steps.gitversion.outputs.majorMinorPatch }}'
token: '${{ secrets.RSG_BOT_TOKEN }}'
commit: '${{ github.base_ref }}'
4 changes: 2 additions & 2 deletions .github/workflows/inputs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ on:
inputs:
THIS_IS_A_INPUT:
type: string
required: False
required: false
secrets:
THIS_IS_A_SECRET:
required: False
required: false
outputs:
withOutputsISetAThing:
description: 'Some output value'
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# ------------------------------------------------------------------------------
# <auto-generated>
#
# This code was generated.
#
# - To turn off auto-generation set:
#
# [PublishNugetPackagesJob (AutoGenerate = false)]
#
# - To trigger manual generation invoke:
#
# nuke --generate-configuration GitHubActions_publish-nuget --host GitHubActions
#
# </auto-generated>
# ------------------------------------------------------------------------------

name: Publish Nuget Packages

on:
workflow_call:
secrets:
RSG_NUGET_API_KEY:
required: true
release:
permissions:
actions: read
checks: read
contents: read
deployments: read
id-token: none
issues: write
discussions: none
packages: none
pages: none
pull-requests: write
repository-projects: none
security-events: none
statuses: write

jobs:
publish_nuget:
runs-on: ubuntu-latest
steps:
- name: 🚀 nuget
uses: actions/download-artifact@v3
- name: nuget.org
env:
ApiKey: '${{ secrets.RSG_NUGET_API_KEY }}'
if: startsWith(github.ref, 'refs/tags/')
shell: pwsh
run: |
dotnet nuget push **/*.nupkg --skip-duplicate -s nuget.org --api-key $ENV:ApiKey
dotnet nuget push **/*.snupkg --skip-duplicate -s nuget.org --api-key $ENV:ApiKey
Loading
Loading