Skip to content

Commit

Permalink
try and fix nugetpublish
Browse files Browse the repository at this point in the history
  • Loading branch information
david-driscoll committed Dec 18, 2024
1 parent d9823f9 commit f6dbc78
Show file tree
Hide file tree
Showing 14 changed files with 402 additions and 427 deletions.
1 change: 1 addition & 0 deletions .build/Build.CI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Nuke.Common.CI.GitHubActions;
using Rocket.Surgery.Nuke.ContinuousIntegration;
using Rocket.Surgery.Nuke.GithubActions;
using Rocket.Surgery.Nuke.Jobs;

#pragma warning disable CA1050

Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/close-milestone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ jobs:
uses: gittools/actions/gitversion/setup@v3.1.1
with:
versionSpec: '6.1.0'
- name: 📲 Install GitReleaseManager
uses: gittools/actions/gitreleasemanager/setup@v3.1.1
with:
versionSpec: '0.18.0'
- name: 🔨 Use GitVersion
id: gitversion
uses: gittools/actions/gitversion/execute@v3.1.1
Expand All @@ -70,7 +66,6 @@ jobs:
- name: Create Milestone
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
continue-on-error: true
uses: WyriHaximus/github-action-create-milestone@v1
with:
title: 'v${{ steps.gitversion.outputs.majorMinorPatch }}'
Expand All @@ -79,6 +74,10 @@ jobs:
with:
default-label: ':sparkles: mysterious'
github-token: '${{ secrets.GITHUB_TOKEN }}'
- name: 📲 Install GitReleaseManager
uses: gittools/actions/gitreleasemanager/setup@v3.1.1
with:
versionSpec: '0.18.0'
- name: Get Repo and Owner
id: repository
if: ${{ !github.event.release.prerelease && steps.gitversion.outputs.preReleaseTag == '' }}
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ jobs:
uses: gittools/actions/gitversion/setup@v3.1.1
with:
versionSpec: '6.1.0'
- name: 📲 Install GitReleaseManager
uses: gittools/actions/gitreleasemanager/setup@v3.1.1
with:
versionSpec: '0.18.0'
- name: 🔨 Use GitVersion
id: gitversion
uses: gittools/actions/gitversion/execute@v3.1.1
Expand All @@ -89,8 +85,11 @@ jobs:
with:
allowUpdates: 'true'
generateReleaseNotes: 'true'
updateOnlyUnreleased: 'true'
draft: 'true'
omitBodyDuringUpdate: 'true'
omitNameDuringUpdate: 'true'
omitDraftDuringUpdate: 'true'
name: 'v${{ steps.gitversion.outputs.majorMinorPatch }}'
tag: 'v${{ steps.gitversion.outputs.majorMinorPatch }}'
token: '${{ secrets.RSG_BOT_TOKEN }}'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@ jobs:
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
5 changes: 0 additions & 5 deletions .github/workflows/update-milestone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ jobs:
uses: gittools/actions/gitversion/setup@v3.1.1
with:
versionSpec: '6.1.0'
- name: 📲 Install GitReleaseManager
uses: gittools/actions/gitreleasemanager/setup@v3.1.1
with:
versionSpec: '0.18.0'
- name: 🔨 Use GitVersion
id: gitversion
uses: gittools/actions/gitversion/execute@v3.1.1
Expand All @@ -72,7 +68,6 @@ jobs:
- name: Create Milestone
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
continue-on-error: true
uses: WyriHaximus/github-action-create-milestone@v1
with:
title: 'v${{ steps.gitversion.outputs.majorMinorPatch }}'
Expand Down
51 changes: 28 additions & 23 deletions src/Nuke/DotNetCore/ICanDotNetFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@ public interface ICanDotNetFormat : IHaveSolution, ICanLint, IHaveOutputLogs
{
private static Matcher? jbMatcher;
private static Matcher? dnfMatcher;
private static readonly HashSet<string> _dotNetFormatIncludedDiagnostics = new(StringComparer.OrdinalIgnoreCase);

private static readonly HashSet<string> _dotNetFormatExcludedDiagnostics = new(StringComparer.OrdinalIgnoreCase)
{
"RCS1060",
"RCS1110",
"RCS1250",
"RCS1163",
"CS1591",
"CS0108",
"CS0246",
"IDE1006",
"RCS1175",
"IDE0052",
"RCS1246",
"RCS1112"
};

/// <summary>
/// The default severity to use for DotNetFormat
Expand All @@ -31,26 +48,12 @@ public interface ICanDotNetFormat : IHaveSolution, ICanLint, IHaveOutputLogs
/// <summary>
/// A list of diagnostic ids to exclude from the dotnet format
/// </summary>
public ImmutableArray<string> DotNetFormatExcludedDiagnostics =>
[
"RCS1060",
"RCS1110",
"RCS1250",
"RCS1163",
"CS1591",
"CS0108",
"CS0246",
"IDE1006",
"RCS1175",
"IDE0052",
"RCS1246",
"RCS1112",
];
public HashSet<string> DotNetFormatExcludedDiagnostics => _dotNetFormatExcludedDiagnostics;

/// <summary>
/// A list of diagnostic ids to include in the dotnet format
/// </summary>
public ImmutableArray<string>? DotNetFormatIncludedDiagnostics => null;
public HashSet<string>? DotNetFormatIncludedDiagnostics => _dotNetFormatIncludedDiagnostics;

/// <summary>
/// The dotnet format target
Expand All @@ -64,23 +67,25 @@ public interface ICanDotNetFormat : IHaveSolution, ICanLint, IHaveOutputLogs
.Executes(
() =>
{

var formatSettings = new DotNetFormatSettings()
.SetSeverity(DotNetFormatSeverity)
.SetVerbosity(Verbosity.MapVerbosity(DotNetVerbosity.normal))
.EnableNoRestore()
.SetBinaryLog(LogsDirectory / "dotnet-format.binlog")
;

;

if (DotNetFormatIncludedDiagnostics is { Length: > 0 })
if (DotNetFormatIncludedDiagnostics is { Count: > 0 })
{
formatSettings = formatSettings.SetProcessAdditionalArguments(["--diagnostics", .. DotNetFormatIncludedDiagnostics.Value]);
formatSettings = formatSettings.SetProcessAdditionalArguments(
["--diagnostics", .. DotNetFormatIncludedDiagnostics]
);
}

if (DotNetFormatExcludedDiagnostics is { Length: > 0 })
if (DotNetFormatExcludedDiagnostics is { Count: > 0 })
{
formatSettings = formatSettings.SetProcessAdditionalArguments(["--exclude-diagnostics", .. DotNetFormatExcludedDiagnostics]);
formatSettings = formatSettings.SetProcessAdditionalArguments(
["--exclude-diagnostics", .. DotNetFormatExcludedDiagnostics]
);
}

if (LintPaths.Glob(DotnetFormatMatcher) is { Count: > 0 } values)
Expand Down
150 changes: 0 additions & 150 deletions src/Nuke/GithubActions/CloseMilestoneJobAttribute.cs

This file was deleted.

Loading

0 comments on commit f6dbc78

Please sign in to comment.