diff --git a/.automerge.yml b/.automerge.yml deleted file mode 100644 index a49a7c83..00000000 --- a/.automerge.yml +++ /dev/null @@ -1,15 +0,0 @@ -merge: - whitelist: - # a PR must have these labels set - labels: ["automerge"] - blacklist: - # a PR may not have these labels set - labels: ["wip"] - # merge method, see https://help.github.com/en/articles/about-merge-methods-on-github - # one of: merge, squash, rebase - method: merge - # status checks required in addition to the ones defined in GitHub Branch Protection Rules - # required_statuses: - # - "test1" - # - "test2" - delete_after_merge: true diff --git a/.build/Build.CI.cs b/.build/Build.CI.cs new file mode 100644 index 00000000..88e7da09 --- /dev/null +++ b/.build/Build.CI.cs @@ -0,0 +1,142 @@ +using System.Collections.Generic; +using System.Linq; +using Nuke.Common.CI.GitHubActions; +using Rocket.Surgery.Nuke; +using Rocket.Surgery.Nuke.ContinuousIntegration; +using Rocket.Surgery.Nuke.DotNetCore; +using Rocket.Surgery.Nuke.GithubActions; + +[AzurePipelinesSteps( + AutoGenerate = false, + InvokeTargets = new[] { nameof(Default) }, + NonEntryTargets = new[] + { + nameof(ICIEnvironment.CIEnvironment), + nameof(ITriggerCodeCoverageReports.Trigger_Code_Coverage_Reports), + nameof(ITriggerCodeCoverageReports.Generate_Code_Coverage_Report_Cobertura), + nameof(IGenerateCodeCoverageBadges.Generate_Code_Coverage_Badges), + nameof(IGenerateCodeCoverageReport.Generate_Code_Coverage_Report), + nameof(IGenerateCodeCoverageSummary.Generate_Code_Coverage_Summary), + nameof(Default) + }, + ExcludedTargets = new[] + { nameof(ICanClean.Clean), nameof(ICanRestoreWithDotNetCore.Restore), nameof(ICanRestoreWithDotNetCore.DotnetToolRestore) }, + Parameters = new[] + { + nameof(IHaveCodeCoverage.CoverageDirectory), nameof(IHaveOutputArtifacts.ArtifactsDirectory), nameof(Verbosity), + nameof(IHaveConfiguration.Configuration) + } +)] +[GitHubActionsSteps("ci", GitHubActionsImage.MacOsLatest, GitHubActionsImage.WindowsLatest, GitHubActionsImage.UbuntuLatest, + AutoGenerate = false, + On = new[] { GitHubActionsTrigger.Push }, + OnPushTags = new[] { "v*" }, + OnPushBranches = new[] { "master", "next" }, + OnPullRequestBranches = new[] { "master", "next" }, + InvokedTargets = new[] { nameof(Default) }, + NonEntryTargets = new[] + { + nameof(ICIEnvironment.CIEnvironment), + nameof(ITriggerCodeCoverageReports.Trigger_Code_Coverage_Reports), + nameof(ITriggerCodeCoverageReports.Generate_Code_Coverage_Report_Cobertura), + nameof(IGenerateCodeCoverageBadges.Generate_Code_Coverage_Badges), + nameof(IGenerateCodeCoverageReport.Generate_Code_Coverage_Report), + nameof(IGenerateCodeCoverageSummary.Generate_Code_Coverage_Summary), + nameof(Default) + }, + ExcludedTargets = new[] { nameof(ICanClean.Clean), nameof(ICanRestoreWithDotNetCore.DotnetToolRestore) }, + Enhancements = new[] { nameof(Middleware) } +)] +[PrintBuildVersion, PrintCIEnvironment, UploadLogs] +public partial class Solution +{ + public static RocketSurgeonGitHubActionsConfiguration Middleware(RocketSurgeonGitHubActionsConfiguration configuration) + { + var buildJob = configuration.Jobs.First(z => z.Name == "Build"); + var checkoutStep = buildJob.Steps.OfType().Single(); + // For fetch all + // checkoutStep.FetchDepth = 0; + buildJob.Steps.InsertRange(buildJob.Steps.IndexOf(checkoutStep) + 1, new BaseGitHubActionsStep[] { + new RunStep("Fetch all history for all tags and branches") { + Run = "git fetch --prune --unshallow" + }, + new SetupDotNetStep("Use .NET Core 2.1 SDK") { + DotNetVersion = "2.1.x" + }, + new SetupDotNetStep("Use .NET Core 3.1 SDK") { + DotNetVersion = "3.1.x" + }, + new RunStep("πŸͺ“ **DOTNET HACK** πŸͺ“") { + Shell = GithubActionShell.Pwsh, + Run = @"$version = Split-Path (Split-Path $ENV:DOTNET_ROOT -Parent) -Leaf; + $root = Split-Path (Split-Path $ENV:DOTNET_ROOT -Parent) -Parent; + $directories = Get-ChildItem $root | Where-Object { $_.Name -ne $version }; + foreach ($dir in $directories) { + $from = $dir.FullName; + $to = ""$root/$version""; + Write-Host Copying from $from to $to; + Copy-Item ""$from\*"" $to -Recurse -Force; + } + " + }, + }); + + buildJob.Steps.Add(new UsingStep("Publish Coverage") + { + Uses = "codecov/codecov-action@v1", + With = new Dictionary + { + ["name"] = "actions-${{ matrix.os }}", + ["fail_ci_if_error"] = "true", + } + }); + + buildJob.Steps.Add(new UploadArtifactStep("Publish logs") + { + Name = "logs", + Path = "artifacts/logs/", + If = "always()" + }); + + buildJob.Steps.Add(new UploadArtifactStep("Publish coverage data") + { + Name = "coverage", + Path = "coverage/", + If = "always()" + }); + + buildJob.Steps.Add(new UploadArtifactStep("Publish test data") + { + Name = "test data", + Path = "artifacts/test/", + If = "always()" + }); + + buildJob.Steps.Add(new UploadArtifactStep("Publish NuGet Packages") + { + Name = "nuget", + Path = "artifacts/nuget/", + If = "always()" + }); + + + /* + + - publish: "${{ parameters.Artifacts }}/logs/" + displayName: Publish Logs + artifact: "Logs${{ parameters.Postfix }}" + condition: always() + + - publish: ${{ parameters.Coverage }} + displayName: Publish Coverage + artifact: "Coverage${{ parameters.Postfix }}" + condition: always() + + - publish: "${{ parameters.Artifacts }}/nuget/" + displayName: Publish NuGet Artifacts + artifact: "NuGet${{ parameters.Postfix }}" + condition: always() + */ + return configuration; + } +} diff --git a/.build/Build.cs b/.build/Build.cs index 7be3ed50..0c822b4f 100644 --- a/.build/Build.cs +++ b/.build/Build.cs @@ -1,45 +1,72 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using JetBrains.Annotations; using Nuke.Common; using Nuke.Common.Execution; -using Rocket.Surgery.Nuke.DotNetCore; +using Nuke.Common.Git; +using Nuke.Common.Tools.DotNet; +using Nuke.Common.Tools.GitVersion; +using Nuke.Common.Tools.MSBuild; using Rocket.Surgery.Nuke; -using JetBrains.Annotations; +using Rocket.Surgery.Nuke.DotNetCore; [PublicAPI] [CheckBuildProjectConfigurations] [UnsetVisualStudioEnvironmentVariables] -[AzurePipelinesSteps( - InvokedTargets = new[] { nameof(Default) }, - NonEntryTargets = new[] { nameof(BuildVersion), nameof(Generate_Code_Coverage_Reports), nameof(Default) }, - ExcludedTargets = new[] { nameof(Restore), nameof(DotnetToolRestore) }, - Parameters = new[] { nameof(CoverageDirectory), nameof(ArtifactsDirectory), nameof(Verbosity), nameof(Configuration) } -)] [PackageIcon("https://raw.githubusercontent.com/RocketSurgeonsGuild/graphics/master/png/social-square-thrust-rounded.png")] -[EnsurePackageSourceHasCredentials("RocketSurgeonsGuild")] [EnsureGitHooks(GitHook.PreCommit)] -class Solution : DotNetCoreBuild, IDotNetCoreBuild +[DotNetVerbosityMapping] +[MSBuildVerbosityMapping] +[NuGetVerbosityMapping] +public partial class Solution : NukeBuild, + ICanRestoreWithDotNetCore, + ICanBuildWithDotNetCore, + ICanTestWithDotNetCore, + ICanPackWithDotNetCore, + IHaveDataCollector, + ICanClean, + ICanUpdateReadme, + IGenerateCodeCoverageReport, + IGenerateCodeCoverageSummary, + IGenerateCodeCoverageBadges, + IHaveConfiguration, + ICanLint { /// /// Support plugins are available for: - /// - JetBrains ReSharper https://nuke.build/resharper - /// - JetBrains Rider https://nuke.build/rider - /// - Microsoft VisualStudio https://nuke.build/visualstudio - /// - Microsoft VSCode https://nuke.build/vscode + /// - JetBrains ReSharper https://nuke.build/resharper + /// - JetBrains Rider https://nuke.build/rider + /// - Microsoft VisualStudio https://nuke.build/visualstudio + /// - Microsoft VSCode https://nuke.build/vscode /// - public static int Main() => Execute(x => x.Default); - Target Default => _ => _ - .DependsOn(Restore) - .DependsOn(Build) - .DependsOn(Test) - .DependsOn(Pack) - ; + [OptionalGitRepository] + public GitRepository? GitRepository { get; } + + private Target Default => _ => _ + .DependsOn(Restore) + .DependsOn(Build) + .DependsOn(Test) + .DependsOn(Pack); + + public Target Build => _ => _.Inherit(x => x.CoreBuild); + + public Target Pack => _ => _.Inherit(x => x.CorePack) + .DependsOn(Clean); - public new Target Restore => _ => _.With(this, DotNetCoreBuild.Restore); + [ComputedGitVersion] + public GitVersion GitVersion { get; } = null!; - public new Target Build => _ => _.With(this, DotNetCoreBuild.Build); + public Target Clean => _ => _.Inherit(x => x.Clean); + public Target Restore => _ => _.Inherit(x => x.CoreRestore); + public Target Test => _ => _.Inherit(x => x.CoreTest); - public new Target Test => _ => _.With(this, DotNetCoreBuild.Test); + public Target BuildVersion => _ => _.Inherit(x => x.BuildVersion) + .Before(Default) + .Before(Clean); - public new Target Pack => _ => _.With(this, DotNetCoreBuild.Pack); + [Parameter("Configuration to build")] + public Configuration Configuration { get; } = IsLocalBuild ? Configuration.Debug : Configuration.Release; } diff --git a/.build/Configuration.cs b/.build/Configuration.cs new file mode 100644 index 00000000..549687ce --- /dev/null +++ b/.build/Configuration.cs @@ -0,0 +1,11 @@ +ο»Ώusing System.ComponentModel; +using Nuke.Common.Tooling; + +[TypeConverter(typeof(TypeConverter))] +public class Configuration : Enumeration +{ + public static readonly Configuration Debug = new Configuration { Value = nameof(Debug) }; + public static readonly Configuration Release = new Configuration { Value = nameof(Release) }; + + public static implicit operator string(Configuration configuration) => configuration.Value; +} \ No newline at end of file diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 6cef083e..99b18d33 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -2,32 +2,24 @@ "version": 1, "isRoot": true, "tools": { - "nukeeper": { - "version": "0.26.0", - "commands": ["nukeeper"] - }, "dotnet-outdated": { - "version": "2.8.0", + "version": "2.11.0", "commands": ["dotnet-outdated"] }, "gitversion.tool": { - "version": "5.1.3", + "version": "5.3.5", "commands": ["dotnet-gitversion"] }, "dotnet-reportgenerator-globaltool": { - "version": "4.4.0", + "version": "4.6.1", "commands": ["reportgenerator"] }, "nuke.globaltool": { - "version": "0.23.6", + "version": "0.24.11", "commands": ["nuke"] }, - "gitreleasemanager.tool": { - "version": "0.10.0", - "commands": ["dotnet-gitreleasemanager"] - }, "codecov.tool": { - "version": "1.9.0", + "version": "1.11.1", "commands": ["codecov"] } } diff --git a/.dependabot/config.yml b/.dependabot/config.yml deleted file mode 100644 index 4e10fdcc..00000000 --- a/.dependabot/config.yml +++ /dev/null @@ -1,60 +0,0 @@ -version: 1 -update_configs: - - package_manager: 'dotnet:nuget' - directory: '/' - update_schedule: 'live' - target_branch: master - default_labels: - - ':package: dependencies' - default_assignees: - - 'david-driscoll' - # default_reviewers: - # - "david-driscoll" - automerged_updates: - - match: - dependency_name: 'Rocket.Surgery.*' - update_type: 'semver:minor' - - match: - dependency_name: 'JetBrains.ReSharper.CommandLineTools' - update_type: 'all' - - match: - dependency_name: 'System.Reactive.*' - update_type: 'semver:minor' - - match: - dependency_name: 'System.Interactive.*' - update_type: 'semver:minor' - - match: - dependency_name: System.Diagnostics.* - update_type: 'semver:minor' - - match: - dependency_name: 'Microsoft.NET.Test.Sdk' - update_type: 'all' - - match: - dependency_name: 'Moq' - update_type: 'all' - - match: - dependency_name: 'Nuke.Common' - update_type: 'all' - - match: - dependency_name: 'Bogus' - update_type: 'all' - - match: - dependency_name: 'FakeItEasy.*' - update_type: 'all' - - match: - dependency_name: 'coverlet.*' - update_type: 'all' - - match: - dependency_name: 'FluentAssertions.*' - update_type: 'all' - - match: - dependency_name: 'GitVersion.Tool' - update_type: 'all' - - match: - dependency_name: 'ReportGenerator' - update_type: 'semver:minor' - ignored_updates: - - match: - dependency_name: Microsoft.Extensions.* - - match: - dependency_name: Microsoft.AspNetCore.* diff --git a/.github/auto_assign.yml b/.github/auto_assign.yml deleted file mode 100644 index 9de08a23..00000000 --- a/.github/auto_assign.yml +++ /dev/null @@ -1,16 +0,0 @@ -# Set to true to add reviewers to pull requests - -# Set to true to add assignees to pull requests -addAssignees: false - -# A list of reviewers to be added to pull requests (GitHub user name) -reviewers: - - david-driscoll - -# A list of keywords to be skipped the process that add reviewers if pull requests include it -skipKeywords: - - wip - -# A number of reviewers added to the pull request -# Set 0 to add all the reviewers (default: 0) -numberOfReviewers: 0 diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..eba8bd57 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,28 @@ +version: 2 +updates: + - package-ecosystem: 'github-actions' + directory: '/' + schedule: + interval: 'daily' + assignees: + - 'david-driscoll' + open-pull-requests-limit: 100 + + - package-ecosystem: 'npm' + directory: '/' + schedule: + interval: 'daily' + assignees: + - 'david-driscoll' + open-pull-requests-limit: 100 + + - package-ecosystem: 'nuget' + directory: '/' + schedule: + interval: 'daily' + assignees: + - 'david-driscoll' + ignore: + - dependency-name: Microsoft.Extensions.* + - dependency-name: Microsoft.AspNetCore.* + open-pull-requests-limit: 100 diff --git a/.github/labels.yml b/.github/labels.yml new file mode 100644 index 00000000..e69de29b diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..101a4a24 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,110 @@ +# ------------------------------------------------------------------------------ +# +# +# This code was generated. +# +# - To turn off auto-generation set: +# +# [GitHubActionsSteps (AutoGenerate = false)] +# +# - To trigger manual generation invoke: +# +# nuke --generate-configuration GitHubActions_ci --host GitHubActions +# +# +# ------------------------------------------------------------------------------ + +name: ci + +on: + push: + branches: + - master + - next + tags: + - v* + pull_request: + branches: + - master + - next + +jobs: + Build: + strategy: + fail-fast: false + matrix: + os: [macOS-latest, windows-latest, ubuntu-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + clean: 'false' + - name: Fetch all history for all tags and branches + run: | + git fetch --prune --unshallow + - name: πŸ”¨ Use .NET Core 2.1 SDK + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '2.1.x' + - name: πŸ”¨ Use .NET Core 3.1 SDK + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '3.1.x' + - name: πŸͺ“ **DOTNET HACK** πŸͺ“ + shell: pwsh + run: | + $version = Split-Path (Split-Path $ENV:DOTNET_ROOT -Parent) -Leaf; + $root = Split-Path (Split-Path $ENV:DOTNET_ROOT -Parent) -Parent; + $directories = Get-ChildItem $root | Where-Object { $_.Name -ne $version }; + foreach ($dir in $directories) { + $from = $dir.FullName; + $to = "$root/$version"; + Write-Host Copying from $from to $to; + Copy-Item "$from\*" $to -Recurse -Force; + } + + - name: 🎁 dotnet tool restore + run: | + dotnet tool restore + - name: 🎁 Restore + run: | + dotnet nuke Restore --skip + - name: βš™ Build + run: | + dotnet nuke Build --skip + - name: 🚦 Test + run: | + dotnet nuke Test Trigger_Code_Coverage_Reports Generate_Code_Coverage_Report_Cobertura Generate_Code_Coverage_Badges Generate_Code_Coverage_Summary Generate_Code_Coverage_Report --skip + - name: πŸ“¦ Pack + run: | + dotnet nuke Pack --skip + - name: 🐿 Publish Coverage + uses: codecov/codecov-action@v1 + with: + name: 'actions-${{ matrix.os }}' + fail_ci_if_error: 'true' + - name: 🏺 Publish logs + if: always() + uses: actions/upload-artifact@v1 + with: + name: 'logs' + path: 'artifacts/logs/' + - name: 🏺 Publish coverage data + if: always() + uses: actions/upload-artifact@v1 + with: + name: 'coverage' + path: 'coverage/' + - name: 🏺 Publish test data + if: always() + uses: actions/upload-artifact@v1 + with: + name: 'test data' + path: 'artifacts/test/' + - name: 🏺 Publish NuGet Packages + if: always() + uses: actions/upload-artifact@v1 + with: + name: 'nuget' + path: 'artifacts/nuget/' diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml new file mode 100644 index 00000000..bb361062 --- /dev/null +++ b/.github/workflows/close-milestone.yml @@ -0,0 +1,62 @@ +name: Close Milestone +on: + release: + types: + - released +jobs: + close_milestone: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Install GitVersion + uses: gittools/actions/gitversion/setup@master + with: + versionSpec: '5.x' + + - name: Install GitReleaseManager + uses: gittools/actions/gitreleasemanager/setup@master + with: + versionSpec: '0.11.x' + + - name: Use GitVersion + id: gitversion + uses: gittools/actions/gitversion/execute@master + + # Ensure the milestone exists + - name: Create Milestone + uses: WyriHaximus/github-action-create-milestone@0.1.0 + 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 + - name: sync milestones + uses: RocketSurgeonsGuild/actions/sync-milestone@v0.2.2 + with: + default-label: ':sparkles: mysterious' + github-token: ${{ secrets.RSG_BOT_TOKEN }} + + - name: Get Repo and Owner + shell: pwsh + id: repository + if: ${{ !github.event.release.prerelease && steps.gitversion.outputs.preReleaseTag == '' }} + 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 == '' }} + run: | + dotnet gitreleasemanager close ` + -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 new file mode 100644 index 00000000..5273a401 --- /dev/null +++ b/.github/workflows/draft-release.yml @@ -0,0 +1,72 @@ +name: Create Milestone and Draft Release +on: + push: + branches: + - master + paths-ignore: + - '**/*.md' +jobs: + create_milestone_and_draft_release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Fetch all history for all tags and branches + run: git fetch --prune + + - name: Install GitVersion + uses: gittools/actions/gitversion/setup@master + with: + versionSpec: '5.x' + + - name: Install GitReleaseManager + uses: gittools/actions/gitreleasemanager/setup@master + with: + versionSpec: '0.11.x' + + - name: Use GitVersion + id: gitversion + uses: gittools/actions/gitversion/execute@master + + - name: Create Milestone + uses: WyriHaximus/github-action-create-milestone@0.1.0 + with: + title: v${{ steps.gitversion.outputs.majorMinorPatch }} + env: + GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' + continue-on-error: true + + - name: Get Repo and Owner + shell: pwsh + id: repository + run: | + $parts = $ENV:GITHUB_REPOSITORY.Split('/') + echo "::set-output name=owner::$($parts[0])" + echo "::set-output name=repository::$($parts[1])" + + - name: sync milestones + uses: RocketSurgeonsGuild/actions/sync-milestone@v0.2.2 + with: + default-label: ':sparkles: mysterious' + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Create Draft Release + shell: pwsh + run: | + dotnet gitreleasemanager create ` + -o "${{ steps.repository.outputs.owner }}" ` + -r "${{ steps.repository.outputs.repository }}" ` + --token "${{ secrets.RSG_BOT_TOKEN }}" ` + -m "v${{ steps.gitversion.outputs.majorMinorPatch }}" + + - name: Export Changelog + shell: pwsh + run: | + dotnet gitreleasemanager export ` + -o "${{ steps.repository.outputs.owner }}" ` + -r "${{ steps.repository.outputs.repository }}" ` + --token "${{ secrets.GITHUB_TOKEN }}" ` + -f CHANGELOG.md diff --git a/.github/workflows/nukeeper.yml b/.github/workflows/nukeeper.yml new file mode 100644 index 00000000..abf2f86b --- /dev/null +++ b/.github/workflows/nukeeper.yml @@ -0,0 +1,25 @@ +name: Nukeeper Update + +on: + schedule: + - cron: '0 0 * * *' + +defaults: + run: + shell: pwsh +jobs: + nukeeper: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + ref: 'master' + + - name: install nukeeper + run: | + dotnet tool install -g nukeeper + + - name: nukeeper repo + run: | + nukeeper repo https://github.com/${{ github.repository }} ${{ secrets.RSG_BOT_TOKEN }} diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml new file mode 100644 index 00000000..d079c46a --- /dev/null +++ b/.github/workflows/sync-labels.yml @@ -0,0 +1,39 @@ +name: Sync Labels +on: + push: + branches: + - master + paths: + - .github/workflows/sync-labels.yml + - .github/labels.yml + schedule: + - cron: '0 0 * * *' + +jobs: + sync_labels: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Checkout tools repo + uses: actions/checkout@v2 + with: + repository: RocketSurgeonsGuild/.github + path: .rsg + + - name: merge files + uses: RocketSurgeonsGuild/actions/merge-labels@v0.2.2 + with: + files: '.rsg/.github/labels.yml,.github/labels.yml' + output: .github/labels.yml + + - name: Run Labeler + if: success() + uses: crazy-max/ghaction-github-labeler@v2 + with: + yaml_file: .github/labels.yml + skip_delete: false + dry_run: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml new file mode 100644 index 00000000..a9854b7b --- /dev/null +++ b/.github/workflows/update-milestone.yml @@ -0,0 +1,21 @@ +name: Update Milestone +on: + pull_request: + types: + - closed + - opened + - reopened + - synchronize + +jobs: + update_milestone: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: sync milestones + uses: RocketSurgeonsGuild/actions/sync-milestone@v0.2.2 + with: + default-label: ':sparkles: mysterious' + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.mergify.yml b/.mergify.yml index c77ac19d..e4c33e4f 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -1,9 +1,115 @@ pull_request_rules: - - name: automatic merge when GitHub branch protection passes - conditions: - - base=master - - 'label=:shipit: merge' - actions: - merge: - method: merge - strict: smart + - name: automatic merge when GitHub branch protection passes (dependabot) + conditions: + - base=master + - author~=^dependabot(|-preview)\[bot\]$ + - 'label=:shipit: merge' + actions: + merge: + method: squash + strict: false + - name: automatic merge when GitHub branch protection passes (others) + conditions: + - base=master + - -author~=^dependabot(|-preview)\[bot\]$ + - 'label=:shipit: merge' + actions: + merge: + method: squash + strict: smart+fasttrack + - name: automatic merge when GitHub branch protection passes + conditions: + - merged + - 'label=:shipit: merge' + actions: + label: + remove: + - ':shipit: merge' + - name: delete head branch after merge + conditions: + - merged + actions: + label: + remove: + - ':shipit: merge' + delete_head_branch: {} + - name: automatic merge for JetBrains.ReSharper.CommandLineTools pull requests + conditions: + - title~=^Bump JetBrains\.ReSharper\.CommandLineTools.*$ + - author~=^dependabot(|-preview)\[bot\]$ + actions: + label: + add: + - ':shipit: merge' + - name: automatic merge for ReportGenerator pull requests + conditions: + - title~=^Bump ReportGenerator.*$ + - author~=^dependabot(|-preview)\[bot\]$ + actions: + label: + add: + - ':shipit: merge' + - name: automatic merge for Nuke.Common pull requests + conditions: + - title~=^Bump Nuke\.Common.*$ + - author~=^dependabot(|-preview)\[bot\]$ + actions: + label: + add: + - ':shipit: merge' + - name: automatic merge for GitVersion.Tool pull requests + conditions: + - title~=^Bump GitVersion\.Tool.*$ + - author~=^dependabot(|-preview)\[bot\]$ + actions: + label: + add: + - ':shipit: merge' + - name: automatic merge for Bogus pull requests + conditions: + - title~=^Bump Bogus.*$ + - author~=^dependabot(|-preview)\[bot\]$ + actions: + label: + add: + - ':shipit: merge' + - name: automatic merge for coverlet pull requests + conditions: + - title~=^Bump coverlet.*$ + - author~=^dependabot(|-preview)\[bot\]$ + actions: + label: + add: + - ':shipit: merge' + - name: automatic merge for FakeItEasy pull requests + conditions: + - title~=^Bump FakeItEasy.*$ + - author~=^dependabot(|-preview)\[bot\]$ + actions: + label: + add: + - ':shipit: merge' + - name: automatic merge for FluentAssertions pull requests + conditions: + - title~=^Bump FluentAssertions.*$ + - author~=^dependabot(|-preview)\[bot\]$ + actions: + label: + add: + - ':shipit: merge' + - name: automatic merge for xunit pull requests + conditions: + - title~=^Bump xunit.*$ + - author~=^dependabot(|-preview)\[bot\]$ + actions: + label: + add: + - ':shipit: merge' + - name: automatic merge for Microsoft.NET.Test.Sdk pull requests + conditions: + - title~=^Bump Microsoft\.NET\.Test\.Sdk.*$ + - author~=^dependabot(|-preview)\[bot\]$ + actions: + label: + add: + - ':shipit: merge' diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..2faf3835 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +azure-pipelines.nuke.yml +.github/workflows/ci.yml diff --git a/GitReleaseManager.yaml b/GitReleaseManager.yaml index 29320bee..454088eb 100644 --- a/GitReleaseManager.yaml +++ b/GitReleaseManager.yaml @@ -4,23 +4,27 @@ # footer-content: '' # footer-includes-milestone: true export: - include-created-date-in-title: false - perform-regex-removal: true - regex-text: '([a-f\d]{40}\s|:boom:|:rocket:|:fire:|:blue_book:|:beetle:|:squirrel:|:raised_hand:|:sparkles:|:package:)' + include-created-date-in-title: true + created-date-string-format: MMMM dd, yyyy + perform-regex-removal: true + regex-text: '([a-f\d]{40}\s|:boom:|:rocket:|:fire:|:blue_book:|:beetle:|:squirrel:|:raised_hand:|:sparkles:|:package:|:old_key:|:wastebasket:|:construction:)' issue-labels-include: - - ':boom: breaking change' - - ':rocket: feature' - - ':fire: enhancement' - - ':blue_book: documentation' - - ':beetle: bug' - - ':hammer: chore' - - ':raised_hand: good first issue' - - ':raised_hand: help wanted' - - ':sparkles: mysterious' - - ':package: dependencies' + - ':boom: breaking change' + - ':rocket: feature' + - ':fire: enhancement' + - ':old_key: security' + - ':blue_book: documentation' + - ':beetle: bug' + - ':hammer: chore' + - ':raised_hand: good first issue' + - ':raised_hand: help wanted' + - ':sparkles: mysterious' + - ':package: dependencies' + - ':construction: deprecated' + - ':wastebasket: removed' issue-labels-exclude: - - ':x: invalid' - - ':grey_question: question' - - ':lock: wontfix' - - ':family: duplicate' - - ':shipit: merge' + - ':family: duplicate' + - ':grey_question: question' + - ':lock: wontfix' + - ':shipit: merge' + - ':x: invalid' diff --git a/GitVersion.yml b/GitVersion.yml index 3b579f50..07bc5967 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -2,6 +2,16 @@ assembly-versioning-scheme: MajorMinorPatch mode: ContinuousDeployment continuous-delivery-fallback-tag: beta next-version: 0.1.0 -branches: {} +branches: + next: + regex: ^next$ + mode: ContinuousDeployment + tag: next + increment: Major + prevent-increment-of-merged-branch-version: false + track-merge-target: false + tracks-release-branches: false + is-release-branch: false + source-branches: ['master'] ignore: sha: [] diff --git a/NuGet.config b/NuGet.config index edbe0124..1669fcd5 100644 --- a/NuGet.config +++ b/NuGet.config @@ -6,7 +6,7 @@ - + diff --git a/Packages.props b/Packages.props index 24ad93b7..56e42fd4 100644 --- a/Packages.props +++ b/Packages.props @@ -10,9 +10,9 @@ - + - + diff --git a/Readme.md b/Readme.md index c4b6851b..4e3be999 100644 --- a/Readme.md +++ b/Readme.md @@ -27,10 +27,10 @@ Every good Rocket Surgeon needs a way to know where there code came from. This -| Azure Pipelines | AppVeyor | -| --------------- | -------- | -| [![azurepipelines-badge]][azurepipelines] | [![appveyor-badge]][appveyor] | -| [![azurepipelines-history-badge]][azurepipelines-history] | [![appveyor-history-badge]][appveyor-history] | +| Azure Pipelines | GitHub Actions | +| --------------- | -------------- | +| [![azurepipelines-badge]][azurepipelines] | [![github-badge]][github] | +| [![azurepipelines-history-badge]][azurepipelines-history] | [![github-history-badge]][github] | @@ -57,10 +57,9 @@ TBD [azurepipelines-badge]: https://img.shields.io/azure-devops/build/rocketsurgeonsguild/Libraries/5.svg?color=98C6FF&label=azure%20pipelines&logo=azuredevops&logoColor=98C6FF&style=flat "Azure Pipelines Status" [azurepipelines-history]: https://rocketsurgeonsguild.visualstudio.com/Libraries/_build?definitionId=5&branchName=master [azurepipelines-history-badge]: https://buildstats.info/azurepipelines/chart/rocketsurgeonsguild/Libraries/5?includeBuildsFromPullRequest=false "Azure Pipelines History" -[appveyor]: https://ci.appveyor.com/project/RocketSurgeonsGuild/MSBuild.Targets -[appveyor-badge]: https://img.shields.io/appveyor/ci/RocketSurgeonsGuild/MSBuild.Targets.svg?color=00b3e0&label=appveyor&logo=appveyor&logoColor=00b3e0&style=flat "AppVeyor Status" -[appveyor-history]: https://ci.appveyor.com/project/RocketSurgeonsGuild/MSBuild.Targets/history -[appveyor-history-badge]: https://buildstats.info/appveyor/chart/RocketSurgeonsGuild/MSBuild.Targets?includeBuildsFromPullRequest=false "AppVeyor History" +[github]: https://github.com/RocketSurgeonsGuild/MSBuild.Targets/actions?query=workflow%3Aci +[github-badge]: https://img.shields.io/github/workflow/status/RocketSurgeonsGuild/MSBuild.Targets/ci.svg?label=github&logo=github&color=b845fc&logoColor=b845fc&style=flat "GitHub Actions Status" +[github-history-badge]: https://buildstats.info/github/chart/RocketSurgeonsGuild/MSBuild.Targets?includeBuildsFromPullRequest=false "GitHub Actions History" [nuget-crojfy8iotja]: https://www.nuget.org/packages/Rocket.Surgery.MSBuild.CI/ [nuget-version-crojfy8iotja-badge]: https://img.shields.io/nuget/v/Rocket.Surgery.MSBuild.CI.svg?color=004880&logo=nuget&style=flat-square "NuGet Version" [nuget-downloads-crojfy8iotja-badge]: https://img.shields.io/nuget/dt/Rocket.Surgery.MSBuild.CI.svg?color=004880&logo=nuget&style=flat-square "NuGet Downloads" @@ -86,7 +85,4 @@ azurepipelines: account: rocketsurgeonsguild teamproject: Libraries builddefinition: 5 -appveyor: - account: RocketSurgeonsGuild - build: MSBuild.Targets --> \ No newline at end of file diff --git a/azure-pipelines.nuke.yml b/azure-pipelines.nuke.yml index 00bc6302..31800472 100644 --- a/azure-pipelines.nuke.yml +++ b/azure-pipelines.nuke.yml @@ -9,23 +9,21 @@ # # - To trigger manual generation invoke: # -# nuke --configure-build-server --host AzurePipelines +# nuke --generate-configuration AzurePipelines --host AzurePipelines # # # ------------------------------------------------------------------------------ # parameters: - Configuration: 'Release' Artifacts: '' Coverage: '' + Configuration: 'Release' Verbosity: 'Normal' steps: - - pwsh: ./build.ps1 BuildVersion Clean --skip --configuration '${{ parameters.Configuration }}' --artifacts '${{ parameters.Artifacts }}' --coverage '${{ parameters.Coverage }}' --verbosity '${{ parameters.Verbosity }}' - displayName: 'Clean' - - pwsh: ./build.ps1 Build --skip --configuration '${{ parameters.Configuration }}' --artifacts '${{ parameters.Artifacts }}' --coverage '${{ parameters.Coverage }}' --verbosity '${{ parameters.Verbosity }}' + - pwsh: ./build.ps1 Build --skip --artifacts '${{ parameters.Artifacts }}' --coverage '${{ parameters.Coverage }}' --configuration '${{ parameters.Configuration }}' --verbosity '${{ parameters.Verbosity }}' displayName: 'βš™ Build' - - pwsh: ./build.ps1 Generate_Code_Coverage_Reports Test --skip --configuration '${{ parameters.Configuration }}' --artifacts '${{ parameters.Artifacts }}' --coverage '${{ parameters.Coverage }}' --verbosity '${{ parameters.Verbosity }}' + - pwsh: ./build.ps1 Test Trigger_Code_Coverage_Reports Generate_Code_Coverage_Report_Cobertura Generate_Code_Coverage_Badges Generate_Code_Coverage_Summary Generate_Code_Coverage_Report --skip --artifacts '${{ parameters.Artifacts }}' --coverage '${{ parameters.Coverage }}' --configuration '${{ parameters.Configuration }}' --verbosity '${{ parameters.Verbosity }}' displayName: '🚦 Test' - - pwsh: ./build.ps1 Pack --skip --configuration '${{ parameters.Configuration }}' --artifacts '${{ parameters.Artifacts }}' --coverage '${{ parameters.Coverage }}' --verbosity '${{ parameters.Verbosity }}' + - pwsh: ./build.ps1 Pack --skip --artifacts '${{ parameters.Artifacts }}' --coverage '${{ parameters.Coverage }}' --configuration '${{ parameters.Configuration }}' --verbosity '${{ parameters.Verbosity }}' displayName: 'πŸ“¦ Pack' diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ea731ca8..f44511a0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -3,6 +3,7 @@ trigger: branches: include: - master + - next - refs/tags/* paths: exclude: @@ -22,13 +23,14 @@ pr: branches: include: - master + - next resources: repositories: - repository: rsg type: github name: RocketSurgeonsGuild/AzureDevopsTemplates - ref: refs/tags/v0.12.0 + ref: refs/tags/v0.13.0 endpoint: github variables: @@ -43,33 +45,18 @@ variables: - name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE value: 'true' - name: CodeCovToken - value: 'c93f6719-da50-4d00-ba2b-b73fd95239e0' + value: '888a5202-dab9-4150-bc1c-66165d519e24' - group: rsg-bot - # Fixes the github package repo warnings on restore - - name: EmitAssetsLogMessages - value: false - - name: HideWarningsAndErrors - value: true jobs: - - template: jobs/gitversion.yml@rsg - template: jobs/publish-release.yml@rsg parameters: - EnableReleaseNotes: true - GitHub: true GitHubPackages: true GitHubAuthVariableGroup: rsg-bot PublishNuGetPackagesFromArtifact: 'NuGet - Windows' - AuthNuGetFeeds: - - name: RocketSurgeonsGuild - source: https://nuget.pkg.github.com/RocketSurgeonsGuild/index.json - username: $(GitHub.UserName) - password: $(GitHub.Token) - job: Build dependsOn: - - ${{ if startsWith(variables['Build.SourceBranch'], 'refs/tags/v') }}: - - GitHub_Draft_Release variables: - group: rsg-bot strategy: @@ -87,19 +74,13 @@ jobs: vmImage: $(ImageName) steps: - template: support/mono.yml@rsg - - ${{ if startsWith(variables['Build.SourceBranch'], 'refs/tags/v') }}: - - template: support/download-release-notes.yml@rsg + # - ${{ if startsWith(variables['Build.SourceBranch'], 'refs/tags/v') }}: + # - template: support/download-release-notes.yml@rsg - template: support/install-dotnet.yml@rsg parameters: DotNetSdk: - '2.x' - '3.x' - AuthNuGetFeeds: - - name: RocketSurgeonsGuild - source: https://nuget.pkg.github.com/RocketSurgeonsGuild/index.json - username: $(GitHub.UserName) - password: $(GitHub.Token) - - template: support/gitversion-hack.yml@rsg - task: DotNetCoreCLI@2 displayName: 'dotnet tool restore'