diff --git a/.build/.build.csproj b/.build/.build.csproj
index 859c216f5..343f8f5ec 100644
--- a/.build/.build.csproj
+++ b/.build/.build.csproj
@@ -4,11 +4,9 @@
Exe
net8.0
false
-
+
False
CS0649;CS0169
- 1
- true
diff --git a/.build/Solution.cs b/.build/Build.CI.cs
similarity index 55%
rename from .build/Solution.cs
rename to .build/Build.CI.cs
index 6bcbeab9a..3c53d7228 100644
--- a/.build/Solution.cs
+++ b/.build/Build.CI.cs
@@ -3,44 +3,21 @@
using Rocket.Surgery.Nuke.ContinuousIntegration;
using Rocket.Surgery.Nuke.DotNetCore;
using Rocket.Surgery.Nuke.GithubActions;
+using Rocket.Surgery.Nuke.Jobs;
-namespace Build;
-
-internal class LocalConstants
-{
- public static string[] PathsIgnore => new[]
- {
- ".codecov.yml",
- ".editorconfig",
- ".gitattributes",
- ".gitignore",
- ".gitmodules",
- ".lintstagedrc.js",
- ".prettierignore",
- ".prettierrc",
- "LICENSE",
- "nukeeper.settings.json",
- "omnisharp.json",
- "package-lock.json",
- "package.json",
- "Readme.md",
- ".github/dependabot.yml",
- ".github/labels.yml",
- ".github/release.yml",
- ".github/renovate.json",
- };
-}
+#pragma warning disable CA1050
[GitHubActionsSteps(
"ci-ignore",
+ GitHubActionsImage.MacOsLatest,
GitHubActionsImage.WindowsLatest,
GitHubActionsImage.UbuntuLatest,
AutoGenerate = false,
- On = new[] { RocketSurgeonGitHubActionsTrigger.Push },
- OnPushTags = new[] { "v*" },
- OnPushBranches = new[] { "master", "main", "next" },
- OnPullRequestBranches = new[] { "master", "main", "next" },
- Enhancements = new[] { nameof(CiIgnoreMiddleware) }
+ On = [RocketSurgeonGitHubActionsTrigger.Push],
+ OnPushTags = ["v*"],
+ OnPushBranches = ["master", "main", "next"],
+ OnPullRequestBranches = ["master", "main", "next"],
+ Enhancements = [nameof(CiIgnoreMiddleware)]
)]
[GitHubActionsSteps(
"ci",
@@ -48,37 +25,36 @@ internal class LocalConstants
GitHubActionsImage.WindowsLatest,
GitHubActionsImage.UbuntuLatest,
AutoGenerate = false,
- On = new[] { RocketSurgeonGitHubActionsTrigger.Push },
- OnPushTags = new[] { "v*" },
- OnPushBranches = new[] { "master", "main", "next" },
- OnPullRequestBranches = new[] { "master", "main", "next" },
- InvokedTargets = new[] { nameof(Default) },
- NonEntryTargets = new[]
- {
+ On = [RocketSurgeonGitHubActionsTrigger.Push],
+ OnPushTags = ["v*"],
+ OnPushBranches = ["master", "main", "next"],
+ OnPullRequestBranches = ["master", "main", "next"],
+ InvokedTargets = [nameof(Default)],
+ NonEntryTargets = [
nameof(ICIEnvironment.CIEnvironment),
- nameof(ITriggerCodeCoverageReports.TriggerCodeCoverageReports),
nameof(ITriggerCodeCoverageReports.GenerateCodeCoverageReportCobertura),
nameof(IGenerateCodeCoverageBadges.GenerateCodeCoverageBadges),
nameof(IGenerateCodeCoverageReport.GenerateCodeCoverageReport),
nameof(IGenerateCodeCoverageSummary.GenerateCodeCoverageSummary),
- nameof(Default)
- },
- ExcludedTargets = new[] { nameof(ICanClean.Clean), nameof(ICanRestoreWithDotNetCore.DotnetToolRestore) },
- Enhancements = new[] { nameof(CiMiddleware) }
+ nameof(Default),
+ ],
+ ExcludedTargets = [nameof(ICanClean.Clean), nameof(ICanRestoreWithDotNetCore.DotnetToolRestore)],
+ Enhancements = [nameof(CiMiddleware)]
)]
+[CloseMilestoneJob(AutoGenerate = false)]
+[DraftReleaseJob(AutoGenerate = false)]
+[UpdateMilestoneJob(AutoGenerate = false)]
[PrintBuildVersion]
[PrintCIEnvironment]
[UploadLogs]
[TitleEvents]
[ContinuousIntegrationConventions]
-public partial class Solution
+internal sealed partial class Pipeline
{
public static RocketSurgeonGitHubActionsConfiguration CiIgnoreMiddleware(
RocketSurgeonGitHubActionsConfiguration configuration
)
{
- configuration.IncludeRepositoryConfigurationFiles();
-
( (RocketSurgeonsGithubActionsJob)configuration.Jobs[0] ).Steps = new List
{
new RunStep("N/A")
@@ -87,7 +63,7 @@ RocketSurgeonGitHubActionsConfiguration configuration
}
};
- return configuration;
+ return configuration.IncludeRepositoryConfigurationFiles();
}
public static RocketSurgeonGitHubActionsConfiguration CiMiddleware(
@@ -96,33 +72,32 @@ RocketSurgeonGitHubActionsConfiguration configuration
{
configuration
.ExcludeRepositoryConfigurationFiles()
- .AddNugetPublish()
.Jobs.OfType()
.First(z => z.Name.Equals("Build", StringComparison.OrdinalIgnoreCase))
.ConfigureStep(step => step.FetchDepth = 0)
- .UseDotNetSdks("3.1", "6.0", "8.0", "9.0")
+ .UseDotNetSdks("6.0", "8.0", "9.0")
.AddNuGetCache()
.AddVscodeExtensionTests()
- .PublishLogs()
- .PublishArtifacts()
+ .PublishLogs()
+ .PublishArtifacts()
.FailFast = false;
return configuration;
}
}
-public static class Extensions
+public static class JobExtensions
{
public static RocketSurgeonsGithubActionsJob AddVscodeExtensionTests(this RocketSurgeonsGithubActionsJob job)
{
return job
.AddStep(new RunStep("Npm install") {
Run = "npm ci",
- WorkingDirectory = Solution.VscodeTestExtensionProjectDirectory
+ WorkingDirectory = Pipeline.VscodeTestExtensionProjectDirectory
})
.AddStep(new HeadlessRunStep("Vscode extension tests") {
Run = "npm run test",
- WorkingDirectory = Solution.VscodeTestExtensionProjectDirectory
+ WorkingDirectory = Pipeline.VscodeTestExtensionProjectDirectory
});
}
}
diff --git a/.build/Build.cs b/.build/Build.cs
index 8097b5d06..651fd35b7 100644
--- a/.build/Build.cs
+++ b/.build/Build.cs
@@ -1,8 +1,8 @@
using JetBrains.Annotations;
using Nuke.Common;
+using Nuke.Common.CI;
using Nuke.Common.Execution;
using Nuke.Common.Git;
-using Nuke.Common.IO;
using Nuke.Common.Tooling;
using Nuke.Common.Tools.DotNet;
using Nuke.Common.Tools.GitVersion;
@@ -10,28 +10,26 @@
using Nuke.Common.Tools.Npm;
using Rocket.Surgery.Nuke.DotNetCore;
-namespace Build;
+#pragma warning disable CA1050
[PublicAPI]
[UnsetVisualStudioEnvironmentVariables]
[PackageIcon("http://www.omnisharp.net/images/logo.png")]
-[EnsureReadmeIsUpdated]
[DotNetVerbosityMapping]
[MSBuildVerbosityMapping]
[NuGetVerbosityMapping]
+[ShutdownDotNetAfterServerBuild]
[LocalBuildConventions]
-public sealed partial class Solution : NukeBuild,
+internal sealed partial class Pipeline : NukeBuild,
ICanRestoreWithDotNetCore,
ICanBuildWithDotNetCore,
ICanTestWithDotNetCore,
ICanPackWithDotNetCore,
- IHaveDataCollector,
ICanClean,
- ICanUpdateReadme,
+ IHavePublicApis,
IGenerateCodeCoverageReport,
IGenerateCodeCoverageSummary,
IGenerateCodeCoverageBadges,
- IGenerateDocFx,
IHaveConfiguration
{
///
@@ -41,29 +39,39 @@ public sealed partial class Solution : NukeBuild,
/// - Microsoft VisualStudio https://nuke.build/visualstudio
/// - Microsoft VSCode https://nuke.build/vscode
///
- public static int Main() => Execute(x => x.Default);
+ public static int Main() => Execute(x => x.Default);
- [OptionalGitRepository] public GitRepository? GitRepository { get; }
+ public Target Build => _ => _;
- private Target Default => _ => _
- .DependsOn(Restore)
- .DependsOn(Build)
- .DependsOn(Test)
- .DependsOn(Pack);
+ public Target Clean => _ => _;
+
+ [Parameter("Configuration to build")]
+ public Configuration Configuration { get; } = IsLocalBuild ? Configuration.Debug : Configuration.Release;
- public Target Build => _ => _.Inherit(x => x.CoreBuild);
+ [OptionalGitRepository]
+ public GitRepository? GitRepository { get; }
- public Target Pack => _ => _.Inherit(x => x.CorePack)
- .DependsOn(Clean);
+ [GitVersion(NoFetch = true, NoCache = false)]
+ public GitVersion GitVersion { get; } = null!;
- [ComputedGitVersion] public GitVersion GitVersion { get; } = null!;
+ public Target Lint => _ => _;
- public Target Clean => _ => _.Inherit(x => x.Clean);
- public Target Restore => _ => _.Inherit(x => x.CoreRestore);
+ public Target Pack => _ => _.DependsOn(Clean);
- public Target Test => _ => _.Inherit(x => x.CoreTest);
+ public Target Restore => _ => _;
+ public Target Test => _ => _;
+
+ [NonEntryTarget]
+ private Target Default => _ => _
+ .DependsOn(Restore)
+ .DependsOn(Build)
+ .DependsOn(Test)
+ .DependsOn(Pack);
+
+#pragma warning disable CA1822
public Target NpmInstall => _ => _
+#pragma warning restore CA1822 // Member 'NpmInstall' does not access instance data and can be marked as static
.Executes(() =>
NpmTasks.NpmCi(s => s
.SetProcessWorkingDirectory(VscodeTestExtensionProjectDirectory)));
@@ -75,13 +83,7 @@ public sealed partial class Solution : NukeBuild,
.SetProcessWorkingDirectory(VscodeTestExtensionProjectDirectory)
.SetCommand("test")));
- public Target BuildVersion => _ => _.Inherit(x => x.BuildVersion)
- .Before(Default)
- .Before(Clean);
-
- [Parameter("Configuration to build")] public Configuration Configuration { get; } = IsLocalBuild ? Configuration.Debug : Configuration.Release;
-
- AbsolutePath ICanUpdateReadme.ReadmeFilePath => RootDirectory / "README.md";
+ public Target BuildVersion => _ => _.Before(Default).Before(Clean);
internal const string VscodeTestExtensionProjectDirectory = "vscode-testextension";
}
diff --git a/.build/Configuration.cs b/.build/Configuration.cs
index 6f2fcceaf..39145e725 100644
--- a/.build/Configuration.cs
+++ b/.build/Configuration.cs
@@ -1,13 +1,13 @@
ο»Ώusing System.ComponentModel;
using Nuke.Common.Tooling;
-namespace Build;
+#pragma warning disable CA1050, CA1724, CA2225
[TypeConverter(typeof(TypeConverter))]
public class Configuration : Enumeration
{
- public static Configuration Debug = new() { Value = nameof(Debug) };
- public static Configuration Release = new() { Value = nameof(Release) };
+ public static readonly Configuration Debug = new() { Value = nameof(Debug) };
+ public static readonly Configuration Release = new() { Value = nameof(Release) };
public static implicit operator string(Configuration configuration) => configuration.Value;
}
diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
index 109b0cded..b078b9dba 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -1,42 +1,69 @@
{
- "version": 1,
- "isRoot": true,
- "tools": {
- "dotnet-outdated": {
- "version": "2.11.0",
- "commands": [
- "dotnet-outdated"
- ]
- },
- "dotnet-reportgenerator-globaltool": {
- "version": "5.4.4",
- "commands": [
- "reportgenerator"
- ]
- },
- "nuke.globaltool": {
- "version": "9.0.4",
- "commands": [
- "nuke"
- ]
- },
- "codecov.tool": {
- "version": "1.13.0",
- "commands": [
- "codecov"
- ]
- },
- "jetbrains.resharper.globaltools": {
- "version": "2024.3.5",
- "commands": [
- "jb"
- ]
- },
- "nukeeper": {
- "version": "0.35.0",
- "commands": [
- "nukeeper"
- ]
- }
+ "version": 1,
+ "isRoot": true,
+ "tools": {
+ "dotnet-outdated": {
+ "version": "2.11.0",
+ "commands": [
+ "dotnet-outdated"
+ ],
+ "rollForward": false
+ },
+ "dotnet-reportgenerator-globaltool": {
+ "version": "5.4.4",
+ "commands": [
+ "reportgenerator"
+ ],
+ "rollForward": false
+ },
+ "nuke.globaltool": {
+ "version": "9.0.4",
+ "commands": [
+ "nuke"
+ ],
+ "rollForward": false
+ },
+ "codecov.tool": {
+ "version": "1.13.0",
+ "commands": [
+ "codecov"
+ ],
+ "rollForward": false
+ },
+ "jetbrains.resharper.globaltools": {
+ "version": "2024.3.5",
+ "commands": [
+ "jb"
+ ],
+ "rollForward": false
+ },
+ "nukeeper": {
+ "version": "0.35.0",
+ "commands": [
+ "nukeeper"
+ ],
+ "rollForward": false
+ },
+ "dotnet-coverage": {
+ "version": "17.13.1",
+ "commands": [
+ "dotnet-coverage"
+ ],
+ "rollForward": false
+ },
+ "gitreleasemanager.tool": {
+ "version": "0.18.0",
+ "commands": [
+ "dotnet-gitreleasemanager"
+ ],
+ "rollForward": false
+ },
+ "gitversion.tool": {
+ "version": "6.1.0",
+ "commands": [
+ "dotnet-gitversion"
+ ],
+ "rollForward": false
}
-}
+ }
+}
\ No newline at end of file
diff --git a/.github/workflows/ci-ignore.yml b/.github/workflows/ci-ignore.yml
index 1826f2ffc..b48765ee3 100644
--- a/.github/workflows/ci-ignore.yml
+++ b/.github/workflows/ci-ignore.yml
@@ -67,6 +67,20 @@ on:
- '.github/labels.yml'
- '.github/release.yml'
- '.github/renovate.json'
+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:
build:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index f4e527ddb..ca6725a71 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -67,11 +67,39 @@ on:
- '.github/labels.yml'
- '.github/release.yml'
- '.github/renovate.json'
+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:
build:
env:
NUGET_PACKAGES: '${{ github.workspace }}/.nuget/packages'
+ permissions:
+ actions: read
+ checks: write
+ 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
strategy:
fail-fast: false
matrix:
@@ -89,10 +117,6 @@ jobs:
with:
path: '${{ github.workspace }}/.nuget/packages'
key: "${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props') }}-${{ hashFiles('**/dotnet-tools.json') }}"
- - name: π¨ Use .NET Core 3.1 SDK
- uses: actions/setup-dotnet@v4.3.0
- with:
- dotnet-version: '3.1.x'
- name: π¨ Use .NET Core 6.0 SDK
uses: actions/setup-dotnet@v4.3.0
with:
@@ -105,74 +129,87 @@ jobs:
uses: actions/setup-dotnet@v4.3.0
with:
dotnet-version: '9.0.x'
- - name: π dotnet tool restore
+ - name: π dotnet workload restore
+ continue-on-error: true
+ run: |
+ dotnet workload restore
+ - name: βοΈ dotnet tool restore
run: |
dotnet tool restore
- name: π Restore
id: restore
run: |
- dotnet nuke Restore --skip
+ dotnet nuke --target DotnetCoreRestore Restore
- name: Update NuGet Cache
if: always() && steps.restore-nuget-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
key: "${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props') }}-${{ hashFiles('**/dotnet-tools.json') }}"
path: '${{ github.workspace }}/.nuget/packages'
- - name: β Build
+ - name: βοΈ Build
id: build
run: |
- dotnet nuke Build --skip
- - name: π¦ Test
+ dotnet .build/bin/Debug/.build.dll --target DotnetCoreBuild Build
+ - name: π¨ Test
id: test
run: |
- dotnet nuke Test TriggerCodeCoverageReports GenerateCodeCoverageReportCobertura GenerateCodeCoverageBadges GenerateCodeCoverageSummary GenerateCodeCoverageReport --skip
+ dotnet .build/bin/Debug/.build.dll --target DotnetCoreTest Test CollectCodeCoverage GenerateCodeCoverageReportCobertura GenerateCodeCoverageBadges GenerateCodeCoverageSummary GenerateCodeCoverageReport
- name: π¦ Pack
id: pack
run: |
- dotnet nuke Pack --skip
+ dotnet .build/bin/Debug/.build.dll --target DotnetCorePack Pack --skip Build
- name: Npm install
working-directory: vscode-testextension
run: |
npm ci
- - name: π¦ Vscode extension tests
+ - name: π¨ Vscode extension tests
uses: coactions/setup-xvfb@v1
with:
run: 'npm run test'
working-directory: 'vscode-testextension'
- - name: πΊ Publish coverage data
- if: always()
- uses: actions/upload-artifact@v4
- with:
- name: 'coverage-${{ matrix.os }}'
- path: 'coverage/'
- - name: πΏ Publish Coverage
- if: (github.event_name != 'pull_request' && github.event_name != 'pull_request_target') || ((github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.pull_request.user.login != 'renovate[bot]' && github.event.pull_request.user.login != 'dependabot[bot]')
- uses: codecov/codecov-action@v4.0.0-beta.2
- with:
- name: 'actions-${{ matrix.os }}'
- - name: πΊ Publish logs
+ - name: πΊ Publish logs (${{ matrix.os }})
if: always()
uses: actions/upload-artifact@v4
with:
name: 'logs-${{ matrix.os }}'
- path: 'artifacts/logs/'
- - name: πΊ Publish test data
+ path: '${{ github.workspace }}/artifacts/logs/'
+ - name: πΊ Publish test data (${{ matrix.os }})
if: always()
uses: actions/upload-artifact@v4
with:
name: 'test data-${{ matrix.os }}'
- path: 'artifacts/test/'
- - name: πΊ Publish NuGet Packages
+ path: '${{ github.workspace }}/artifacts/test/'
+ - name: π Publish Test Results
+ if: always() && matrix.os == 'macos-latest'
+ uses: EnricoMi/publish-unit-test-result-action/macos@v2
+ with:
+ files: '${{ github.workspace }}/artifacts/test/**/*.trx'
+ - name: πΊ Publish coverage data (${{ matrix.os }})
if: always()
uses: actions/upload-artifact@v4
with:
- name: 'nuget-${{ matrix.os }}'
- path: 'artifacts/nuget/'
- - name: πΊ Publish Documentation
+ name: 'coverage-${{ matrix.os }}'
+ path: '${{ github.workspace }}/coverage/'
+ - name: π Publish Coverage Comment
+ if: always() && github.event_name == 'pull_request'
+ continue-on-error: true
+ uses: marocchino/sticky-pull-request-comment@v2
+ with:
+ header: 'Coverage'
+ path: '${{ github.workspace }}/coverage/summary/SummaryGithub.md'
+ GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
+ - name: π Publish Codecov Coverage
+ if: always() && (github.event_name != 'pull_request' && github.event_name != 'pull_request_target') || ((github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.pull_request.user.login != 'renovate[bot]' && github.event.pull_request.user.login != 'dependabot[bot]')
+ continue-on-error: true
+ uses: codecov/codecov-action@v4.0.0-beta.2
+ with:
+ name: 'actions-${{ matrix.os }}'
+ - name: πΊ Publish NuGet Packages (${{ matrix.os }})
+ if: always()
uses: actions/upload-artifact@v4
with:
- name: 'docs-${{ matrix.os }}'
- path: 'artifacts/docs/'
+ name: 'nuget-${{ matrix.os }}'
+ path: '${{ github.workspace }}/artifacts/nuget/'
Merge:
runs-on: ubuntu-latest
needs: build
diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml
index 0cff1b3c8..50a616814 100644
--- a/.github/workflows/close-milestone.yml
+++ b/.github/workflows/close-milestone.yml
@@ -1,9 +1,39 @@
+# ------------------------------------------------------------------------------
+#
+#
+# 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
+#
+#
+# ------------------------------------------------------------------------------
+
name: Close Milestone
on:
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:
@@ -12,56 +42,55 @@ jobs:
- name: Checkout
uses: actions/checkout@v4.2.2
with:
- fetch-depth: 0
-
- - uses: actions/setup-dotnet@v4
-
- - name: Install GitVersion
- uses: gittools/actions/gitversion/setup@v3.1.11
- with:
- versionSpec: '6.0.x'
- preferLatestVersion: true
-
- - name: Install GitReleaseManager
- uses: gittools/actions/gitreleasemanager/setup@v3.1.11
- with:
- versionSpec: '0.18.x'
-
- - name: Use GitVersion
+ 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@v4
+ - name: βοΈ dotnet tool restore
+ run: |
+ dotnet tool restore
+ - name: π¨ Use GitVersion
id: gitversion
- uses: gittools/actions/gitversion/execute@v3.1.11
-
- # Ensure the milestone exists
+ shell: pwsh
+ run: |
+ $data = dotnet gitversion | ConvertFrom-Json
+ foreach ($item in $data.PSObject.Properties) {
+ $key = $item.Name
+ $value = $item.Value
+ echo "$($key.Substring(0,1).ToLower() + $key.Substring(1))=$value" >> $env:GITHUB_OUTPUT
+ }
- name: Create Milestone
- uses: WyriHaximus/github-action-create-milestone@v1
- with:
- title: v${{ steps.gitversion.outputs.majorMinorPatch }}
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
- continue-on-error: true
-
- # move any issues to that milestone in the event the release is renamed
+ 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: 'mysterious'
- github-token: ${{ secrets.OMNISHARP_BOT_TOKEN }}
-
+ default-label: ':sparkles: mysterious'
+ github-token: '${{ secrets.GITHUB_TOKEN }}'
+ - name: π² Install GitReleaseManager
+ uses: gittools/actions/gitreleasemanager/setup@v3.1.11
+ with:
+ versionSpec: '0.18.0'
- name: Get Repo and Owner
- shell: pwsh
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
- shell: pwsh
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 }}"
+ -o "${{ steps.repository.outputs.owner }}" `
+ -r "${{ steps.repository.outputs.repository }}" `
+ --token "${{ secrets.GITHUB_TOKEN }}" `
+ -m "v${{ steps.gitversion.outputs.majorMinorPatch }}"
diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml
index 7f595dca9..84c30e88a 100644
--- a/.github/workflows/draft-release.yml
+++ b/.github/workflows/draft-release.yml
@@ -1,16 +1,46 @@
-name: Create Milestone and Draft Release
+# ------------------------------------------------------------------------------
+#
+#
+# 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
+#
+#
+# ------------------------------------------------------------------------------
+
+name: Draft Release and Create Milestone
on:
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:
+ draft_release:
permissions:
# write permission is required to create a github release
contents: write
@@ -19,44 +49,48 @@ jobs:
- name: Checkout
uses: actions/checkout@v4.2.2
with:
- fetch-depth: 0
-
- - uses: actions/setup-dotnet@v4
-
+ clean: 'false'
+ fetch-depth: '0'
- name: Fetch all history for all tags and branches
- run: git fetch --prune
-
- - name: Install GitVersion
- uses: gittools/actions/gitversion/setup@v3.1.11
- with:
- versionSpec: '6.0.x'
- preferLatestVersion: true
-
- - name: Use GitVersion
+ run: |
+ git fetch --prune
+ - name: π² Install DotNet
+ uses: actions/setup-dotnet@v4
+ - name: βοΈ dotnet tool restore
+ run: |
+ dotnet tool restore
+ - name: π¨ Use GitVersion
id: gitversion
- uses: gittools/actions/gitversion/execute@v3.1.11
-
+ shell: pwsh
+ run: |
+ $data = dotnet gitversion | ConvertFrom-Json
+ foreach ($item in $data.PSObject.Properties) {
+ $key = $item.Name
+ $value = $item.Value
+ echo "$($key.Substring(0,1).ToLower() + $key.Substring(1))=$value" >> $env:GITHUB_OUTPUT
+ }
- name: Create Milestone
- uses: WyriHaximus/github-action-create-milestone@v1
- with:
- title: v${{ steps.gitversion.outputs.majorMinorPatch }}
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
- continue-on-error: true
-
- - name: sync milestones
+ 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: 'mysterious'
- github-token: ${{ secrets.GITHUB_TOKEN }}
-
- - uses: ncipollo/release-action@v1
+ 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
+ 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.GITHUB_TOKEN }}
- commit: ${{ github.base_ref }}
+ token: '${{ secrets.GITHUB_TOKEN }}'
+ commit: '${{ github.base_ref }}'
diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml
index 8aa210765..4b6205777 100644
--- a/.github/workflows/update-milestone.yml
+++ b/.github/workflows/update-milestone.yml
@@ -1,12 +1,43 @@
+# ------------------------------------------------------------------------------
+#
+#
+# This code was generated.
+#
+# - To turn off auto-generation set:
+#
+# [UpdateMilestoneJob (AutoGenerate = false)]
+#
+# - To trigger manual generation invoke:
+#
+# nuke --generate-configuration GitHubActions_update-milestone --host GitHubActions
+#
+#
+# ------------------------------------------------------------------------------
+
name: Update Milestone
on:
+ push:
pull_request_target:
types:
- - closed
- - opened
- - reopened
- - synchronize
+ - 'closed'
+ - 'opened'
+ - 'reopened'
+ - 'synchronize'
+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:
update_milestone:
@@ -15,43 +46,34 @@ jobs:
- name: Checkout
uses: actions/checkout@v4.2.2
with:
- ref: ${{ github.sha }}
- fetch-depth: 0
-
- - uses: actions/setup-dotnet@v4
-
+ clean: 'false'
+ fetch-depth: '0'
- name: Fetch all history for all tags and branches
- run: git fetch --prune
-
- - name: Install GitVersion
- if: ${{ github.event.action == 'opened' }}
- uses: gittools/actions/gitversion/setup@v3.1.11
- with:
- versionSpec: '6.0.x'
- preferLatestVersion: true
-
- - name: Install GitReleaseManager
- if: ${{ github.event.action == 'opened' }}
- uses: gittools/actions/gitreleasemanager/setup@v3.1.11
- with:
- versionSpec: '0.18.x'
-
- - name: Use GitVersion
- if: ${{ github.event.action == 'opened' }}
+ run: |
+ git fetch --prune
+ - name: π² Install DotNet
+ uses: actions/setup-dotnet@v4
+ - name: βοΈ dotnet tool restore
+ run: |
+ dotnet tool restore
+ - name: π¨ Use GitVersion
id: gitversion
- uses: gittools/actions/gitversion/execute@v3.1.11
-
+ shell: pwsh
+ run: |
+ $data = dotnet gitversion | ConvertFrom-Json
+ foreach ($item in $data.PSObject.Properties) {
+ $key = $item.Name
+ $value = $item.Value
+ echo "$($key.Substring(0,1).ToLower() + $key.Substring(1))=$value" >> $env:GITHUB_OUTPUT
+ }
- name: Create Milestone
- if: ${{ github.event.action == 'opened' }}
- uses: WyriHaximus/github-action-create-milestone@v1
- with:
- title: v${{ steps.gitversion.outputs.majorMinorPatch }}
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
- continue-on-error: true
-
- - name: sync milestones
+ 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: 'mysterious'
- github-token: ${{ secrets.GITHUB_TOKEN }}
+ default-label: ':sparkles: mysterious'
+ github-token: '${{ secrets.GITHUB_TOKEN }}'
diff --git a/.gitignore b/.gitignore
index 99a0f4a92..866dd2678 100644
--- a/.gitignore
+++ b/.gitignore
@@ -41,8 +41,8 @@ tools/*/
.idea/
node_modules/
coverage.*.xml
-coverage.json
-coverage.info
+coverage.*.json
+coverage.*.info
/codealike.json
.tmp/
.nuke/temp/
diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json
index e18c1f5f0..cc7d21694 100644
--- a/.nuke/build.schema.json
+++ b/.nuke/build.schema.json
@@ -1,55 +1,82 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
- "$ref": "#/definitions/build",
- "title": "Build Schema",
"definitions": {
- "build": {
- "type": "object",
+ "Host": {
+ "type": "string",
+ "enum": [
+ "AppVeyor",
+ "AzurePipelines",
+ "Bamboo",
+ "Bitbucket",
+ "Bitrise",
+ "GitHubActions",
+ "GitLab",
+ "Jenkins",
+ "Rider",
+ "SpaceAutomation",
+ "TeamCity",
+ "Terminal",
+ "TravisCI",
+ "VisualStudio",
+ "VSCode"
+ ]
+ },
+ "ExecutableTarget": {
+ "type": "string",
+ "enum": [
+ "Build",
+ "BuildVersion",
+ "Clean",
+ "CleanWellKnownTemporaryFiles",
+ "CollectCodeCoverage",
+ "Default",
+ "DotnetCoreBuild",
+ "DotnetCorePack",
+ "DotnetCoreRestore",
+ "DotnetCoreTest",
+ "DotnetToolRestore",
+ "GenerateCodeCoverageBadges",
+ "GenerateCodeCoverageReport",
+ "GenerateCodeCoverageReportCobertura",
+ "GenerateCodeCoverageSummary",
+ "HuskyLint",
+ "Lint",
+ "LintFiles",
+ "LintGitAdd",
+ "LintPublicApiAnalyzers",
+ "MoveUnshippedToShipped",
+ "NpmInstall",
+ "Pack",
+ "PostLint",
+ "Restore",
+ "ShipPublicApis",
+ "Test",
+ "TestVscodeExtension"
+ ]
+ },
+ "Verbosity": {
+ "type": "string",
+ "description": "",
+ "enum": [
+ "Verbose",
+ "Normal",
+ "Minimal",
+ "Quiet"
+ ]
+ },
+ "NukeBuild": {
"properties": {
- "Artifacts": {
- "type": "string",
- "description": "The directory where artifacts are to be dropped"
- },
- "Configuration": {
- "type": "string",
- "description": "Configuration to build",
- "enum": [
- "Debug",
- "Release"
- ]
- },
"Continue": {
"type": "boolean",
"description": "Indicates to continue a previously failed build attempt"
},
- "Coverage": {
- "type": "string",
- "description": "The directory where coverage artifacts are to be dropped"
- },
"Help": {
"type": "boolean",
"description": "Shows the help text for this build assembly"
},
"Host": {
- "type": "string",
"description": "Host for execution. Default is 'automatic'",
- "enum": [
- "AppVeyor",
- "AzurePipelines",
- "Bamboo",
- "Bitbucket",
- "Bitrise",
- "GitHubActions",
- "GitLab",
- "Jenkins",
- "Rider",
- "SpaceAutomation",
- "TeamCity",
- "Terminal",
- "TravisCI",
- "VisualStudio",
- "VSCode"
- ]
+ "$ref": "#/definitions/Host"
},
"NoLogo": {
"type": "boolean",
@@ -74,95 +101,61 @@
"type": "string",
"description": "Root directory during build execution"
},
- "Serve": {
- "type": "boolean",
- "description": "serve the docs"
- },
"Skip": {
"type": "array",
"description": "List of targets to be skipped. Empty list skips all dependencies",
"items": {
- "type": "string",
- "enum": [
- "Build",
- "BuildVersion",
- "Clean",
- "CoreBuild",
- "CoreDocs",
- "CorePack",
- "CoreRestore",
- "CoreTest",
- "Default",
- "DotnetToolRestore",
- "Generate_Code_Coverage_Badges",
- "Generate_Code_Coverage_Report",
- "Generate_Code_Coverage_Report_Cobertura",
- "Generate_Code_Coverage_Summary",
- "GenerateCodeCoverageBadges",
- "GenerateCodeCoverageReport",
- "GenerateCodeCoverageReportCobertura",
- "GenerateCodeCoverageSummary",
- "GenerateReadme",
- "NpmInstall",
- "Pack",
- "Restore",
- "Test",
- "TestVscodeTestExtension",
- "Trigger_Code_Coverage_Reports",
- "TriggerCodeCoverageReports"
- ]
+ "$ref": "#/definitions/ExecutableTarget"
}
},
- "Solution": {
- "type": "string",
- "description": "Path to a solution file that is automatically loaded"
- },
"Target": {
"type": "array",
"description": "List of targets to be invoked. Default is '{default_target}'",
"items": {
- "type": "string",
- "enum": [
- "Build",
- "BuildVersion",
- "Clean",
- "CoreBuild",
- "CoreDocs",
- "CorePack",
- "CoreRestore",
- "CoreTest",
- "Default",
- "DotnetToolRestore",
- "Generate_Code_Coverage_Badges",
- "Generate_Code_Coverage_Report",
- "Generate_Code_Coverage_Report_Cobertura",
- "Generate_Code_Coverage_Summary",
- "GenerateCodeCoverageBadges",
- "GenerateCodeCoverageReport",
- "GenerateCodeCoverageReportCobertura",
- "GenerateCodeCoverageSummary",
- "GenerateReadme",
- "NpmInstall",
- "Pack",
- "Restore",
- "Test",
- "TestVscodeTestExtension",
- "Trigger_Code_Coverage_Reports",
- "TriggerCodeCoverageReports"
- ]
+ "$ref": "#/definitions/ExecutableTarget"
}
},
"Verbosity": {
- "type": "string",
"description": "Logging verbosity during build execution. Default is 'Normal'",
+ "$ref": "#/definitions/Verbosity"
+ }
+ }
+ }
+ },
+ "allOf": [
+ {
+ "properties": {
+ "Artifacts": {
+ "type": "string",
+ "description": "The directory where artifacts are to be dropped"
+ },
+ "Configuration": {
+ "type": "string",
+ "description": "Configuration to build",
"enum": [
- "Minimal",
- "Normal",
- "Quiet",
- "Verbose"
+ "Debug",
+ "Release"
]
+ },
+ "Coverage": {
+ "type": "string",
+ "description": "The directory where coverage artifacts are to be dropped"
+ },
+ "lint-files": {
+ "type": "array",
+ "description": "The files to lint, if not given lints all files",
+ "items": {
+ "type": "string"
+ }
+ },
+ "Solution": {
+ "type": "string",
+ "description": "Path to a solution file that is automatically loaded"
}
}
+ },
+ {
+ "$ref": "#/definitions/NukeBuild"
}
- }
+ ]
}
diff --git a/.nuke/parameters.json b/.nuke/parameters.json
index 2d4a451b6..2616d8357 100644
--- a/.nuke/parameters.json
+++ b/.nuke/parameters.json
@@ -1,4 +1,5 @@
{
"$schema": "./build.schema.json",
- "Solution": "LSP.sln"
-}
\ No newline at end of file
+ "Solution": "LSP.sln",
+ "Host": "GitHubActions"
+}
diff --git a/Directory.Build.props b/Directory.Build.props
index c824ab2bf..004d3bb90 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -21,14 +21,16 @@
1
true
enable
+
+ true
+ $(NoWarn);CS4014
true
true
snupkg
true
- $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb
+ $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb
$(AllowedReferenceRelatedFileExtensions);.pdb
diff --git a/Directory.Packages.props b/Directory.Packages.props
index d54ec7bea..abfa3a0f9 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -24,7 +24,7 @@
-
+
diff --git a/sample/SampleServer/Program.cs b/sample/SampleServer/Program.cs
index 999932d2a..d338ae7a5 100644
--- a/sample/SampleServer/Program.cs
+++ b/sample/SampleServer/Program.cs
@@ -8,6 +8,8 @@
using OmniSharp.Extensions.LanguageServer.Server;
using Serilog;
+#nullable disable
+
// ReSharper disable UnusedParameter.Local
namespace SampleServer
diff --git a/sample/SampleServer/SemanticTokensHandler.cs b/sample/SampleServer/SemanticTokensHandler.cs
index 0f8c3d517..363f9e575 100644
--- a/sample/SampleServer/SemanticTokensHandler.cs
+++ b/sample/SampleServer/SemanticTokensHandler.cs
@@ -10,6 +10,8 @@
using OmniSharp.Extensions.LanguageServer.Protocol.Document;
using OmniSharp.Extensions.LanguageServer.Protocol.Models;
+#nullable disable
+
namespace SampleServer
{
#pragma warning disable 618
@@ -22,7 +24,7 @@ public SemanticTokensHandler(ILogger logger)
_logger = logger;
}
- public override async Task Handle(
+ public override async Task Handle(
SemanticTokensParams request, CancellationToken cancellationToken
)
{
@@ -30,7 +32,7 @@ public SemanticTokensHandler(ILogger logger)
return result;
}
- public override async Task Handle(
+ public override async Task Handle(
SemanticTokensRangeParams request, CancellationToken cancellationToken
)
{
@@ -38,7 +40,7 @@ public SemanticTokensHandler(ILogger logger)
return result;
}
- public override async Task Handle(
+ public override async Task Handle(
SemanticTokensDeltaParams request,
CancellationToken cancellationToken
)
diff --git a/sample/SampleServer/TextDocumentHandler.cs b/sample/SampleServer/TextDocumentHandler.cs
index e9a06b74a..2c71fd2c2 100644
--- a/sample/SampleServer/TextDocumentHandler.cs
+++ b/sample/SampleServer/TextDocumentHandler.cs
@@ -15,6 +15,7 @@
using OmniSharp.Extensions.LanguageServer.Protocol.Workspace;
using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range;
+#nullable disable
#pragma warning disable CS0618
diff --git a/src/Protocol/Features/Workspace/ExecuteCommandFeature.cs b/src/Protocol/Features/Workspace/ExecuteCommandFeature.cs
index 1b69c1085..e500af6df 100644
--- a/src/Protocol/Features/Workspace/ExecuteCommandFeature.cs
+++ b/src/Protocol/Features/Workspace/ExecuteCommandFeature.cs
@@ -17,6 +17,9 @@
using OmniSharp.Extensions.LanguageServer.Protocol.Shared;
using ISerializer = OmniSharp.Extensions.JsonRpc.ISerializer;
+#nullable disable
+
+#pragma warning restore format
// ReSharper disable once CheckNamespace
namespace OmniSharp.Extensions.LanguageServer.Protocol
{
diff --git a/test/Client.Tests/ClientTests.cs b/test/Client.Tests/ClientTests.cs
index 6c31d0426..7a99c574a 100644
--- a/test/Client.Tests/ClientTests.cs
+++ b/test/Client.Tests/ClientTests.cs
@@ -11,6 +11,7 @@
using Xunit.Abstractions;
using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range;
+#nullable disable
namespace OmniSharp.Extensions.LanguageServer.Client.Tests
{
@@ -686,8 +687,8 @@ public async Task Diagnostics_Success()
var receivedDiagnosticsNotification = new TaskCompletionSource