diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d39e9aa..fd216ff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,6 +13,7 @@ on: - main jobs: build: + name: Build runs-on: ubuntu-latest steps: - name: Check out @@ -28,6 +29,7 @@ jobs: - name: Test run: dotnet test --no-build --verbosity normal add_tag: + name: Add Tag and Create Release runs-on: ubuntu-latest needs: - build @@ -109,6 +111,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.PAT_FOR_TAGGING }} publish: + name: Publish to NuGet runs-on: ubuntu-latest needs: - add_tag diff --git a/.github/workflows/prLinter.yml b/.github/workflows/prLinter.yml index 31d7538..a67f18d 100644 --- a/.github/workflows/prLinter.yml +++ b/.github/workflows/prLinter.yml @@ -1,8 +1,5 @@ name: PR Linter on: - push: - branches: - - main pull_request: types: - opened diff --git a/ADotNet.Infrastructure.Build/Services/ScriptGenerationService.cs b/ADotNet.Infrastructure.Build/Services/ScriptGenerationService.cs index 753e94f..d23479d 100644 --- a/ADotNet.Infrastructure.Build/Services/ScriptGenerationService.cs +++ b/ADotNet.Infrastructure.Build/Services/ScriptGenerationService.cs @@ -43,6 +43,7 @@ public void GenerateBuildScript(string branchName, string projectName, string do "build", new Job { + Name = "Build", RunsOn = BuildMachines.UbuntuLatest, Steps = new List @@ -87,6 +88,9 @@ public void GenerateBuildScript(string branchName, string projectName, string do projectRelativePath: "ADotNet/ADotNet.csproj", githubToken: "${{ secrets.PAT_FOR_TAGGING }}", branchName: branchName) + { + Name = "Add Tag and Create Release" + } }, { "publish", @@ -95,6 +99,9 @@ public void GenerateBuildScript(string branchName, string projectName, string do dependsOn: "add_tag", dotNetVersion: dotNetVersion, nugetApiKey: "${{ secrets.NUGET_ACCESS }}") + { + Name = "Publish to NuGet" + } } } }; @@ -120,8 +127,6 @@ public void GeneratePrLintScript(string branchName) OnEvents = new Events { - Push = new PushEvent { Branches = [branchName] }, - PullRequest = new PullRequestEvent { Types = ["opened", "edited", "synchronize", "reopened", "closed"], diff --git a/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Events.cs b/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Events.cs index 7b685ea..087e60b 100644 --- a/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Events.cs +++ b/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Events.cs @@ -10,9 +10,10 @@ namespace ADotNet.Models.Pipelines.GithubPipelines.DotNets { public class Events { + [YamlMember(DefaultValuesHandling = DefaultValuesHandling.OmitDefaults)] public PushEvent Push { get; set; } - [YamlMember(Alias = "pull_request")] + [YamlMember(Alias = "pull_request", DefaultValuesHandling = DefaultValuesHandling.OmitDefaults)] public PullRequestEvent PullRequest { get; set; } } }