From 4a1ba4a8b76097899ba780d983cc9d49d7ac903a Mon Sep 17 00:00:00 2001 From: Ebere Abanonu Date: Sat, 9 Jul 2022 17:46:16 +0100 Subject: [PATCH 1/5] GitHubActions Token --- .github/workflows/Build.yml | 22 +++++- .github/workflows/nuget.yml | 9 ++- .github/workflows/run_tests.yml | 11 ++- .github/workflows/run_tests_acks.yml | 11 ++- .github/workflows/run_tests_api.yml | 11 ++- .github/workflows/run_tests_autocluster.yml | 11 ++- .github/workflows/run_tests_eventsource.yml | 11 ++- .github/workflows/run_tests_multitopic.yml | 11 ++- .github/workflows/run_tests_partitioned.yml | 11 ++- .github/workflows/run_tests_tableview.yml | 11 ++- .github/workflows/run_tests_transaction.yml | 11 ++- .nuke/build.schema.json | 11 --- Directory.Build.props | 2 +- build/Build.CI.GitHubActions.cs | 81 +++++++++++++++------ build/Build.cs | 24 +++--- 15 files changed, 185 insertions(+), 63 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 592fee838..19e917515 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -33,7 +33,14 @@ jobs: name: windows-latest runs-on: windows-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + - name: Make build.sh executable + run: chmod +x ./build.sh + - name: Make build.cmd executable + run: chmod +x ./build.cmd + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.* - uses: actions/setup-dotnet@v1 with: dotnet-version: 6.0.* @@ -46,11 +53,20 @@ jobs: key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }} - name: Run './build.cmd Compile' run: ./build.cmd Compile + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ubuntu-latest: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + - name: Make build.sh executable + run: chmod +x ./build.sh + - name: Make build.cmd executable + run: chmod +x ./build.cmd + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.* - uses: actions/setup-dotnet@v1 with: dotnet-version: 6.0.* @@ -63,3 +79,5 @@ jobs: key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }} - name: Run './build.cmd Compile' run: ./build.cmd Compile + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/nuget.yml b/.github/workflows/nuget.yml index 0a1e4c9f5..0aa09a7f2 100644 --- a/.github/workflows/nuget.yml +++ b/.github/workflows/nuget.yml @@ -28,7 +28,14 @@ jobs: name: windows-latest runs-on: windows-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + - name: Make build.sh executable + run: chmod +x ./build.sh + - name: Make build.cmd executable + run: chmod +x ./build.cmd + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.* - uses: actions/setup-dotnet@v1 with: dotnet-version: 6.0.* diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 3b2eac528..edc36bf6b 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -33,7 +33,14 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + - name: Make build.sh executable + run: chmod +x ./build.sh + - name: Make build.cmd executable + run: chmod +x ./build.cmd + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.* - uses: actions/setup-dotnet@v1 with: dotnet-version: 6.0.* @@ -46,3 +53,5 @@ jobs: key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }} - name: Run './build.cmd Test' run: ./build.cmd Test + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/run_tests_acks.yml b/.github/workflows/run_tests_acks.yml index 01be0a2a3..e3b79c45e 100644 --- a/.github/workflows/run_tests_acks.yml +++ b/.github/workflows/run_tests_acks.yml @@ -33,7 +33,14 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + - name: Make build.sh executable + run: chmod +x ./build.sh + - name: Make build.cmd executable + run: chmod +x ./build.cmd + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.* - uses: actions/setup-dotnet@v1 with: dotnet-version: 6.0.* @@ -46,3 +53,5 @@ jobs: key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }} - name: Run './build.cmd Acks' run: ./build.cmd Acks + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/run_tests_api.yml b/.github/workflows/run_tests_api.yml index 8b5e6aaf9..76f86afbc 100644 --- a/.github/workflows/run_tests_api.yml +++ b/.github/workflows/run_tests_api.yml @@ -33,7 +33,14 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + - name: Make build.sh executable + run: chmod +x ./build.sh + - name: Make build.cmd executable + run: chmod +x ./build.cmd + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.* - uses: actions/setup-dotnet@v1 with: dotnet-version: 6.0.* @@ -46,3 +53,5 @@ jobs: key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }} - name: Run './build.cmd TestAPI' run: ./build.cmd TestAPI + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/run_tests_autocluster.yml b/.github/workflows/run_tests_autocluster.yml index a835318b4..ebc8f034e 100644 --- a/.github/workflows/run_tests_autocluster.yml +++ b/.github/workflows/run_tests_autocluster.yml @@ -33,7 +33,14 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + - name: Make build.sh executable + run: chmod +x ./build.sh + - name: Make build.cmd executable + run: chmod +x ./build.cmd + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.* - uses: actions/setup-dotnet@v1 with: dotnet-version: 6.0.* @@ -46,3 +53,5 @@ jobs: key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }} - name: Run './build.cmd AutoClusterFailover' run: ./build.cmd AutoClusterFailover + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/run_tests_eventsource.yml b/.github/workflows/run_tests_eventsource.yml index 54b2422ad..3e5c8112a 100644 --- a/.github/workflows/run_tests_eventsource.yml +++ b/.github/workflows/run_tests_eventsource.yml @@ -33,7 +33,14 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + - name: Make build.sh executable + run: chmod +x ./build.sh + - name: Make build.cmd executable + run: chmod +x ./build.cmd + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.* - uses: actions/setup-dotnet@v1 with: dotnet-version: 6.0.* @@ -46,3 +53,5 @@ jobs: key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }} - name: Run './build.cmd EventSource' run: ./build.cmd EventSource + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/run_tests_multitopic.yml b/.github/workflows/run_tests_multitopic.yml index a6aa86285..49c63554e 100644 --- a/.github/workflows/run_tests_multitopic.yml +++ b/.github/workflows/run_tests_multitopic.yml @@ -33,7 +33,14 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + - name: Make build.sh executable + run: chmod +x ./build.sh + - name: Make build.cmd executable + run: chmod +x ./build.cmd + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.* - uses: actions/setup-dotnet@v1 with: dotnet-version: 6.0.* @@ -46,3 +53,5 @@ jobs: key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }} - name: Run './build.cmd MultiTopic' run: ./build.cmd MultiTopic + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/run_tests_partitioned.yml b/.github/workflows/run_tests_partitioned.yml index c595ebd95..0bceee1ab 100644 --- a/.github/workflows/run_tests_partitioned.yml +++ b/.github/workflows/run_tests_partitioned.yml @@ -33,7 +33,14 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + - name: Make build.sh executable + run: chmod +x ./build.sh + - name: Make build.cmd executable + run: chmod +x ./build.cmd + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.* - uses: actions/setup-dotnet@v1 with: dotnet-version: 6.0.* @@ -46,3 +53,5 @@ jobs: key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }} - name: Run './build.cmd Partitioned' run: ./build.cmd Partitioned + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/run_tests_tableview.yml b/.github/workflows/run_tests_tableview.yml index 211a6bd1a..bea118013 100644 --- a/.github/workflows/run_tests_tableview.yml +++ b/.github/workflows/run_tests_tableview.yml @@ -33,7 +33,14 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + - name: Make build.sh executable + run: chmod +x ./build.sh + - name: Make build.cmd executable + run: chmod +x ./build.cmd + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.* - uses: actions/setup-dotnet@v1 with: dotnet-version: 6.0.* @@ -46,3 +53,5 @@ jobs: key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }} - name: Run './build.cmd TableView' run: ./build.cmd TableView + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/run_tests_transaction.yml b/.github/workflows/run_tests_transaction.yml index 4f6a57cf0..199431d9d 100644 --- a/.github/workflows/run_tests_transaction.yml +++ b/.github/workflows/run_tests_transaction.yml @@ -33,7 +33,14 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + - name: Make build.sh executable + run: chmod +x ./build.sh + - name: Make build.cmd executable + run: chmod +x ./build.cmd + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.* - uses: actions/setup-dotnet@v1 with: dotnet-version: 6.0.* @@ -46,3 +53,5 @@ jobs: key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }} - name: Run './build.cmd Transaction' run: ./build.cmd Transaction + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index a7d908530..6d798e457 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -14,17 +14,10 @@ "Release" ] }, - "Container": { - "type": "boolean" - }, "Continue": { "type": "boolean", "description": "Indicates to continue a previously failed build attempt" }, - "GitHubToken": { - "type": "string", - "default": "Secrets must be entered via 'nuke :secrets [profile]'" - }, "Help": { "type": "boolean", "description": "Shows the help text for this build assembly" @@ -160,10 +153,6 @@ ] } }, - "Toke": { - "type": "string", - "default": "Secrets must be entered via 'nuke :secrets [profile]'" - }, "Verbosity": { "type": "string", "description": "Logging verbosity during build execution. Default is 'Normal'", diff --git a/Directory.Build.props b/Directory.Build.props index 0cc64c38b..53f1ac307 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -7,6 +7,6 @@ 17.0.0 1.4.31 6.3.0 - 6.0.0 + 6.0.1 \ No newline at end of file diff --git a/build/Build.CI.GitHubActions.cs b/build/Build.CI.GitHubActions.cs index 8050f71eb..8be9e2a5e 100644 --- a/build/Build.CI.GitHubActions.cs +++ b/build/Build.CI.GitHubActions.cs @@ -7,92 +7,105 @@ [CustomGitHubActions("build", GitHubActionsImage.WindowsLatest, GitHubActionsImage.UbuntuLatest, - AutoGenerate = false, + AutoGenerate = true, OnPushBranches = new[] { "main", "dev", "release" }, OnPullRequestBranches = new[] { "main", "dev", "release" }, - InvokedTargets = new[] { nameof(Compile) })] + InvokedTargets = new[] { nameof(Compile) }, + PublishArtifacts = true, + EnableGitHubToken = true)] [CustomGitHubActions("run_tests", GitHubActionsImage.UbuntuLatest, - AutoGenerate = false, + AutoGenerate = true, OnPullRequestBranches = new[] { "main", "dev", "release" }, OnPushBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(Test) }, - PublishArtifacts = true)] + PublishArtifacts = true, + EnableGitHubToken = true)] [CustomGitHubActions("run_tests_acks", GitHubActionsImage.UbuntuLatest, - AutoGenerate = false, + AutoGenerate = true, OnPullRequestBranches = new[] { "main", "dev", "release" }, OnPushBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(Acks) }, - PublishArtifacts = true)] + PublishArtifacts = true, + EnableGitHubToken = true)] [CustomGitHubActions("run_tests_partitioned", GitHubActionsImage.UbuntuLatest, - AutoGenerate = false, + AutoGenerate = true, OnPullRequestBranches = new[] { "main", "dev", "release" }, OnPushBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(Partitioned) }, - PublishArtifacts = true)] + PublishArtifacts = true, + EnableGitHubToken = true)] [CustomGitHubActions("run_tests_transaction", GitHubActionsImage.UbuntuLatest, - AutoGenerate = false, + AutoGenerate = true, OnPullRequestBranches = new[] { "main", "dev", "release" }, OnPushBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(Transaction) }, - PublishArtifacts = true)] + PublishArtifacts = true, + EnableGitHubToken = true)] [CustomGitHubActions("run_tests_api", GitHubActionsImage.UbuntuLatest, - AutoGenerate = false, + AutoGenerate = true, OnPullRequestBranches = new[] { "main", "dev", "release" }, OnPushBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(TestAPI) }, - PublishArtifacts = true)] + PublishArtifacts = true, + EnableGitHubToken = true)] [CustomGitHubActions("run_tests_autocluster", GitHubActionsImage.UbuntuLatest, - AutoGenerate = false, + AutoGenerate = true, OnPullRequestBranches = new[] { "main", "dev", "release" }, OnPushBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(AutoClusterFailover) }, - PublishArtifacts = true)] + PublishArtifacts = true, + EnableGitHubToken = true)] [CustomGitHubActions("run_tests_tableview", GitHubActionsImage.UbuntuLatest, - AutoGenerate = false, + AutoGenerate = true, OnPullRequestBranches = new[] { "main", "dev", "release" }, OnPushBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(TableView) }, - PublishArtifacts = true)] + PublishArtifacts = true, + EnableGitHubToken = true)] [CustomGitHubActions("run_tests_eventsource", GitHubActionsImage.UbuntuLatest, - AutoGenerate = false, + AutoGenerate = true, OnPullRequestBranches = new[] { "main", "dev", "release" }, OnPushBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(EventSource) }, - PublishArtifacts = true)] + PublishArtifacts = true, + EnableGitHubToken = true)] [CustomGitHubActions("run_tests_multitopic", GitHubActionsImage.UbuntuLatest, - AutoGenerate = false, + AutoGenerate = true, OnPullRequestBranches = new[] { "main", "dev", "release" }, OnPushBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(MultiTopic) }, - PublishArtifacts = true)] + PublishArtifacts = true, + EnableGitHubToken = true)] [CustomGitHubActions("nuget", GitHubActionsImage.WindowsLatest, - AutoGenerate = false, + AutoGenerate = true, OnPushBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(PublishNuget) }, - ImportSecrets = new[] { "NUGET_API_KEY", "GITHUB_TOKEN" })] + ImportSecrets = new[] { "NUGET_API_KEY"}, + PublishArtifacts = true, + EnableGitHubToken = true)] partial class Build @@ -110,14 +123,21 @@ protected override GitHubActionsJob GetJobs(GitHubActionsImage image, IReadOnlyC var job = base.GetJobs(image, relevantTargets); var newSteps = new List(job.Steps); //newSteps.Insert(1, new GitHubActionsUploadArtifact{ }); - foreach (var version in new[] { "6.0.*" }) + foreach (var version in new[] { "6.0.*", "5.0.*" }) { newSteps.Insert(1, new GitHubActionsSetupDotNetStep { Version = version }); } - + newSteps.Insert(1, new GitHubActionsSetupChmod + { + File = "build.cmd" + }); + newSteps.Insert(1, new GitHubActionsSetupChmod + { + File = "build.sh" + }); job.Steps = newSteps.ToArray(); return job; } @@ -159,4 +179,17 @@ public override void Write(CustomFileWriter writer) } } } +} +class GitHubActionsSetupChmod : GitHubActionsStep +{ + public string File { get; init; } + + public override void Write(CustomFileWriter writer) + { + writer.WriteLine($"- name: Make {File} executable"); + using (writer.Indent()) + { + writer.WriteLine($"run: chmod +x ./{File}"); + } + } } \ No newline at end of file diff --git a/build/Build.cs b/build/Build.cs index 395cc7dd5..a8911e1a0 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -34,11 +34,14 @@ using System.Runtime.InteropServices; using SharpPulsar.TestContainer; using DotNet.Testcontainers.Builders; +using Nuke.Common.CI.GitHubActions; //https://github.com/AvaloniaUI/Avalonia/blob/master/nukebuild/Build.cs //https://github.com/cfrenzel/Eventfully/blob/master/build/Build.cs -[CheckBuildProjectConfigurations] -[ShutdownDotNetAfterServerBuild] + +[ShutdownDotNetAfterServerBuild] +[DotNetVerbosityMapping] +[UnsetVisualStudioEnvironmentVariables] partial class Build : NukeBuild { /// Support plugins are available for: @@ -64,13 +67,8 @@ partial class Build : NukeBuild [Parameter] string NugetApiUrl = "https://api.nuget.org/v3/index.json"; - [Parameter] bool Container = false; - [Parameter][Secret] string NugetApiKey; - [Parameter][Secret] string Toke; - [Parameter][Secret] string GitHubToken; - [PackageExecutable("JetBrains.dotMemoryUnit", "dotMemoryUnit.exe")] readonly Tool DotMemoryUnit; AbsolutePath Output => RootDirectory / "bin"; @@ -84,11 +82,7 @@ partial class Build : NukeBuild public AbsolutePath DocFxDirJson => DocFxDir / "docfx.json"; GitHubClient GitHubClient; - - static readonly JsonElement? _githubContext = string.IsNullOrWhiteSpace(EnvironmentInfo.GetVariable("GITHUB_CONTEXT")) ? - null - : JsonSerializer.Deserialize(EnvironmentInfo.GetVariable("GITHUB_CONTEXT")); - + GitHubActions GitHubActions => GitHubActions.Instance; public ChangeLog Changelog => ReadChangelog(ChangelogFile); public ReleaseNotes LatestVersion => Changelog.ReleaseNotes.OrderByDescending(s => s.Version).FirstOrDefault() ?? throw new ArgumentException("Bad Changelog File. Version Should Exist"); @@ -540,18 +534,18 @@ void CoreTest(string projectName) Target AuthenticatedGitHubClient => _ => _ .Unlisted() - .OnlyWhenDynamic(() => !string.IsNullOrWhiteSpace(GitHubToken)) + .OnlyWhenDynamic(() => !string.IsNullOrWhiteSpace(GitHubActions.Token)) .Executes(() => { GitHubClient = new GitHubClient(new ProductHeaderValue("nuke-build")) { - Credentials = new Octokit.Credentials(GitHubToken, AuthenticationType.Bearer) + Credentials = new Credentials(GitHubActions.Token, AuthenticationType.Bearer) }; }); Target GitHubRelease => _ => _ .Unlisted() .Description("Creates a GitHub release (or amends existing) and uploads the artifact") - .OnlyWhenDynamic(() => !string.IsNullOrWhiteSpace(GitHubToken)) + .OnlyWhenDynamic(() => !string.IsNullOrWhiteSpace(GitHubActions.Token)) .DependsOn(AuthenticatedGitHubClient) .Executes(async () => { From 6c1ccfd10cb6d7849ceadd8540926e83dc7ad3fa Mon Sep 17 00:00:00 2001 From: Ebere Abanonu Date: Sat, 9 Jul 2022 19:15:54 +0100 Subject: [PATCH 2/5] GitVersion --- build/Build.CI.GitHubActions.cs | 18 ------------ build/Build.cs | 52 ++++++++++++++++++--------------- 2 files changed, 29 insertions(+), 41 deletions(-) diff --git a/build/Build.CI.GitHubActions.cs b/build/Build.CI.GitHubActions.cs index 8be9e2a5e..e73b93ffd 100644 --- a/build/Build.CI.GitHubActions.cs +++ b/build/Build.CI.GitHubActions.cs @@ -162,24 +162,6 @@ public override void Write(CustomFileWriter writer) } } -public class GitHubActionsUploadArtifact : GitHubActionsStep -{ - public override void Write(CustomFileWriter writer) - { - writer.WriteLine("- name: Upload a Build Artifact"); - - using (writer.Indent()) - { - writer.WriteLine("uses: actions/upload-artifact@v3.1.0"); - writer.WriteLine("with:"); - using (writer.Indent()) - { - writer.WriteLine("name: assets-for-download"); - writer.WriteLine("path: /home/runner/work/SharpPulsar/SharpPulsar/TestResults"); - } - } - } -} class GitHubActionsSetupChmod : GitHubActionsStep { public string File { get; init; } diff --git a/build/Build.cs b/build/Build.cs index a8911e1a0..f37fa2fa8 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -60,16 +60,14 @@ partial class Build : NukeBuild //readonly Configuration Configuration = Configuration.Release; readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release; - [Solution] readonly Solution Solution; - [GitRepository] readonly GitRepository GitRepository; - - [GitVersion(Framework = "net6.0")] readonly GitVersion GitVersion; - + [Required][Solution] public readonly Solution Solution; + [Required][GitRepository] public readonly GitRepository GitRepository; + [Required][GitVersion(Framework = "net6.0")] public readonly GitVersion GitVersion; + [CI] public readonly GitHubActions GitHubActions; [Parameter] string NugetApiUrl = "https://api.nuget.org/v3/index.json"; [Parameter][Secret] string NugetApiKey; - - [PackageExecutable("JetBrains.dotMemoryUnit", "dotMemoryUnit.exe")] readonly Tool DotMemoryUnit; + public string GitHubPackageSource => $"https://nuget.pkg.github.com/{GitHubActions.RepositoryOwner}/index.json"; AbsolutePath Output => RootDirectory / "bin"; AbsolutePath OutputContainer => RootDirectory / "container"; @@ -82,7 +80,6 @@ partial class Build : NukeBuild public AbsolutePath DocFxDirJson => DocFxDir / "docfx.json"; GitHubClient GitHubClient; - GitHubActions GitHubActions => GitHubActions.Instance; public ChangeLog Changelog => ReadChangelog(ChangelogFile); public ReleaseNotes LatestVersion => Changelog.ReleaseNotes.OrderByDescending(s => s.Version).FirstOrDefault() ?? throw new ArgumentException("Bad Changelog File. Version Should Exist"); @@ -110,28 +107,36 @@ partial class Build : NukeBuild .DependsOn(Restore) .Executes(() => { - var vers = GitVersion.MajorMinorPatch; + //var vers = GitVersion.MajorMinorPatch; DotNetBuild(s => s .SetProjectFile(Solution) .SetNoRestore(InvokedTargets.Contains(Restore)) .SetConfiguration(Configuration) //.SetAssemblyVersion(vers) - .SetFileVersion(vers) - .SetVersion(GitVersion.SemVer)); + //.SetFileVersion(vers) + .SetAssemblyVersion(GitVersion.AssemblySemVer) + .SetFileVersion(GitVersion.AssemblySemFileVer) + .SetInformationalVersion(GitVersion.InformationalVersion) + .SetVersion(GitVersion.NuGetVersionV2)); }); IEnumerable ChangelogSectionNotes => ExtractChangelogSectionNotes(ChangelogFile); Target RunChangelog => _ => _ - .OnlyWhenDynamic(() => GitVersion.BranchName.Equals("main", StringComparison.OrdinalIgnoreCase)) + .Requires(() => IsLocalBuild) + .OnlyWhenDynamic(() => GitRepository.Branch.Equals("main", StringComparison.OrdinalIgnoreCase)) .Executes(() => { - FinalizeChangelog(ChangelogFile, GitVersion.SemVer, GitRepository); - - Git($"add {ChangelogFile}"); + FinalizeChangelog(ChangelogFile, GitVersion.MajorMinorPatch, GitRepository); + Information($"Please review CHANGELOG.md ({ChangelogFile}) and press 'Y' to validate (any other key will cancel changes)..."); + ConsoleKeyInfo keyInfo = Console.ReadKey(); + if (keyInfo.Key == ConsoleKey.Y) + { + Git($"add {ChangelogFile}"); - Git($"commit -S -m \"Finalize {Path.GetFileName(ChangelogFile)} for {GitVersion.SemVer}.\""); + Git($"commit -S -m \"Finalize {Path.GetFileName(ChangelogFile)} for {GitVersion.MajorMinorPatch}.\""); - Git($"tag -f {GitVersion.SemVer}"); + Git($"tag -f {GitVersion.MajorMinorPatch}"); + } }); Target TlsStartPulsar => _ => _ @@ -483,8 +488,7 @@ void CoreTest(string projectName) //.DependsOn(IntegrationTest) .Executes(() => { - var version = GitVersion.SemVer; - var branchName = GitVersion.BranchName; + var branchName = GitRepository.Branch; if (branchName.Equals("main", StringComparison.OrdinalIgnoreCase) && !GitVersion.MajorMinorPatch.Equals(LatestVersion.Version.ToString())) @@ -502,9 +506,10 @@ void CoreTest(string projectName) .EnableNoBuild() .EnableNoRestore() //.SetIncludeSymbols(true) - .SetAssemblyVersion(version) - .SetFileVersion(version) - .SetVersion(version) + .SetAssemblyVersion(GitVersion.AssemblySemVer) + .SetFileVersion(GitVersion.AssemblySemFileVer) + .SetInformationalVersion(GitVersion.InformationalVersion) + .SetVersion(GitVersion.NuGetVersionV2) .SetPackageReleaseNotes(releaseNotes) .SetDescription("SharpPulsar is Apache Pulsar Client built using Akka.net") .SetPackageTags("Apache Pulsar", "Akka.Net", "Event Driven", "Event Sourcing", "Distributed System", "Microservice") @@ -549,7 +554,7 @@ void CoreTest(string projectName) .DependsOn(AuthenticatedGitHubClient) .Executes(async () => { - var version = GitVersion.SemVer; + var version = GitVersion.NuGetVersionV2; var releaseNotes = GetNuGetReleaseNotes(ChangelogFile); Release release; @@ -586,6 +591,7 @@ void CoreTest(string projectName) Information($" {releaseAsset.BrowserDownloadUrl}"); } }); + private string MajorMinorPatchVersion => GitVersion.MajorMinorPatch; string ParseReleaseNote() { From 8e4797276b6014453ac73b02ebcecfdc2911f3dc Mon Sep 17 00:00:00 2001 From: Ebere Abanonu Date: Sat, 9 Jul 2022 19:24:16 +0100 Subject: [PATCH 3/5] default! --- build/Build.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Build.cs b/build/Build.cs index f37fa2fa8..dc4eaa9ce 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -62,7 +62,7 @@ partial class Build : NukeBuild [Required][Solution] public readonly Solution Solution; [Required][GitRepository] public readonly GitRepository GitRepository; - [Required][GitVersion(Framework = "net6.0")] public readonly GitVersion GitVersion; + [Required][GitVersion(Framework = "net6.0")] public readonly GitVersion GitVersion = default!; [CI] public readonly GitHubActions GitHubActions; [Parameter] string NugetApiUrl = "https://api.nuget.org/v3/index.json"; From 582e8b980d52061e1f37d2518abdc5dec6895335 Mon Sep 17 00:00:00 2001 From: Ebere Abanonu Date: Sat, 9 Jul 2022 20:02:20 +0100 Subject: [PATCH 4/5] uses: actions/checkout@v1 --- .github/workflows/Build.yml | 4 ++-- .github/workflows/nuget.yml | 2 +- .github/workflows/run_tests.yml | 2 +- .github/workflows/run_tests_acks.yml | 2 +- .github/workflows/run_tests_api.yml | 2 +- .github/workflows/run_tests_autocluster.yml | 2 +- .github/workflows/run_tests_eventsource.yml | 2 +- .github/workflows/run_tests_multitopic.yml | 2 +- .github/workflows/run_tests_partitioned.yml | 2 +- .github/workflows/run_tests_tableview.yml | 2 +- .github/workflows/run_tests_transaction.yml | 2 +- build/Build.CI.GitHubActions.cs | 22 ++++++++++----------- 12 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 19e917515..c07f9c59c 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -33,7 +33,7 @@ jobs: name: windows-latest runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v1 - name: Make build.sh executable run: chmod +x ./build.sh - name: Make build.cmd executable @@ -59,7 +59,7 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v1 - name: Make build.sh executable run: chmod +x ./build.sh - name: Make build.cmd executable diff --git a/.github/workflows/nuget.yml b/.github/workflows/nuget.yml index 0aa09a7f2..02474612e 100644 --- a/.github/workflows/nuget.yml +++ b/.github/workflows/nuget.yml @@ -28,7 +28,7 @@ jobs: name: windows-latest runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v1 - name: Make build.sh executable run: chmod +x ./build.sh - name: Make build.cmd executable diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index edc36bf6b..8d5651c15 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -33,7 +33,7 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v1 - name: Make build.sh executable run: chmod +x ./build.sh - name: Make build.cmd executable diff --git a/.github/workflows/run_tests_acks.yml b/.github/workflows/run_tests_acks.yml index e3b79c45e..783e5fa4a 100644 --- a/.github/workflows/run_tests_acks.yml +++ b/.github/workflows/run_tests_acks.yml @@ -33,7 +33,7 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v1 - name: Make build.sh executable run: chmod +x ./build.sh - name: Make build.cmd executable diff --git a/.github/workflows/run_tests_api.yml b/.github/workflows/run_tests_api.yml index 76f86afbc..c73d5d049 100644 --- a/.github/workflows/run_tests_api.yml +++ b/.github/workflows/run_tests_api.yml @@ -33,7 +33,7 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v1 - name: Make build.sh executable run: chmod +x ./build.sh - name: Make build.cmd executable diff --git a/.github/workflows/run_tests_autocluster.yml b/.github/workflows/run_tests_autocluster.yml index ebc8f034e..49119fe17 100644 --- a/.github/workflows/run_tests_autocluster.yml +++ b/.github/workflows/run_tests_autocluster.yml @@ -33,7 +33,7 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v1 - name: Make build.sh executable run: chmod +x ./build.sh - name: Make build.cmd executable diff --git a/.github/workflows/run_tests_eventsource.yml b/.github/workflows/run_tests_eventsource.yml index 3e5c8112a..cb7d4952e 100644 --- a/.github/workflows/run_tests_eventsource.yml +++ b/.github/workflows/run_tests_eventsource.yml @@ -33,7 +33,7 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v1 - name: Make build.sh executable run: chmod +x ./build.sh - name: Make build.cmd executable diff --git a/.github/workflows/run_tests_multitopic.yml b/.github/workflows/run_tests_multitopic.yml index 49c63554e..616b3accf 100644 --- a/.github/workflows/run_tests_multitopic.yml +++ b/.github/workflows/run_tests_multitopic.yml @@ -33,7 +33,7 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v1 - name: Make build.sh executable run: chmod +x ./build.sh - name: Make build.cmd executable diff --git a/.github/workflows/run_tests_partitioned.yml b/.github/workflows/run_tests_partitioned.yml index 0bceee1ab..c090322f7 100644 --- a/.github/workflows/run_tests_partitioned.yml +++ b/.github/workflows/run_tests_partitioned.yml @@ -33,7 +33,7 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v1 - name: Make build.sh executable run: chmod +x ./build.sh - name: Make build.cmd executable diff --git a/.github/workflows/run_tests_tableview.yml b/.github/workflows/run_tests_tableview.yml index bea118013..0a84697a0 100644 --- a/.github/workflows/run_tests_tableview.yml +++ b/.github/workflows/run_tests_tableview.yml @@ -33,7 +33,7 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v1 - name: Make build.sh executable run: chmod +x ./build.sh - name: Make build.cmd executable diff --git a/.github/workflows/run_tests_transaction.yml b/.github/workflows/run_tests_transaction.yml index 199431d9d..df91d4fbf 100644 --- a/.github/workflows/run_tests_transaction.yml +++ b/.github/workflows/run_tests_transaction.yml @@ -33,7 +33,7 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v1 - name: Make build.sh executable run: chmod +x ./build.sh - name: Make build.cmd executable diff --git a/build/Build.CI.GitHubActions.cs b/build/Build.CI.GitHubActions.cs index e73b93ffd..a476622ad 100644 --- a/build/Build.CI.GitHubActions.cs +++ b/build/Build.CI.GitHubActions.cs @@ -7,7 +7,7 @@ [CustomGitHubActions("build", GitHubActionsImage.WindowsLatest, GitHubActionsImage.UbuntuLatest, - AutoGenerate = true, + AutoGenerate = false, OnPushBranches = new[] { "main", "dev", "release" }, OnPullRequestBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(Compile) }, @@ -16,7 +16,7 @@ [CustomGitHubActions("run_tests", GitHubActionsImage.UbuntuLatest, - AutoGenerate = true, + AutoGenerate = false, OnPullRequestBranches = new[] { "main", "dev", "release" }, OnPushBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(Test) }, @@ -26,7 +26,7 @@ [CustomGitHubActions("run_tests_acks", GitHubActionsImage.UbuntuLatest, - AutoGenerate = true, + AutoGenerate = false, OnPullRequestBranches = new[] { "main", "dev", "release" }, OnPushBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(Acks) }, @@ -36,7 +36,7 @@ [CustomGitHubActions("run_tests_partitioned", GitHubActionsImage.UbuntuLatest, - AutoGenerate = true, + AutoGenerate = false, OnPullRequestBranches = new[] { "main", "dev", "release" }, OnPushBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(Partitioned) }, @@ -45,7 +45,7 @@ [CustomGitHubActions("run_tests_transaction", GitHubActionsImage.UbuntuLatest, - AutoGenerate = true, + AutoGenerate = false, OnPullRequestBranches = new[] { "main", "dev", "release" }, OnPushBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(Transaction) }, @@ -55,7 +55,7 @@ [CustomGitHubActions("run_tests_api", GitHubActionsImage.UbuntuLatest, - AutoGenerate = true, + AutoGenerate = false, OnPullRequestBranches = new[] { "main", "dev", "release" }, OnPushBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(TestAPI) }, @@ -64,7 +64,7 @@ [CustomGitHubActions("run_tests_autocluster", GitHubActionsImage.UbuntuLatest, - AutoGenerate = true, + AutoGenerate = false, OnPullRequestBranches = new[] { "main", "dev", "release" }, OnPushBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(AutoClusterFailover) }, @@ -73,7 +73,7 @@ [CustomGitHubActions("run_tests_tableview", GitHubActionsImage.UbuntuLatest, - AutoGenerate = true, + AutoGenerate = false, OnPullRequestBranches = new[] { "main", "dev", "release" }, OnPushBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(TableView) }, @@ -82,7 +82,7 @@ [CustomGitHubActions("run_tests_eventsource", GitHubActionsImage.UbuntuLatest, - AutoGenerate = true, + AutoGenerate = false, OnPullRequestBranches = new[] { "main", "dev", "release" }, OnPushBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(EventSource) }, @@ -91,7 +91,7 @@ [CustomGitHubActions("run_tests_multitopic", GitHubActionsImage.UbuntuLatest, - AutoGenerate = true, + AutoGenerate = false, OnPullRequestBranches = new[] { "main", "dev", "release" }, OnPushBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(MultiTopic) }, @@ -100,7 +100,7 @@ [CustomGitHubActions("nuget", GitHubActionsImage.WindowsLatest, - AutoGenerate = true, + AutoGenerate = false, OnPushBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(PublishNuget) }, ImportSecrets = new[] { "NUGET_API_KEY"}, From 90e1251015ba5186dd42cbff46c384f0590cc591 Mon Sep 17 00:00:00 2001 From: Ebere Abanonu Date: Sat, 9 Jul 2022 20:15:36 +0100 Subject: [PATCH 5/5] fetch-depth: 0 --- .github/workflows/Build.yml | 8 +++-- .github/workflows/nuget.yml | 4 ++- .github/workflows/run_tests.yml | 4 ++- .github/workflows/run_tests_acks.yml | 4 ++- .github/workflows/run_tests_api.yml | 4 ++- .github/workflows/run_tests_autocluster.yml | 4 ++- .github/workflows/run_tests_eventsource.yml | 4 ++- .github/workflows/run_tests_multitopic.yml | 4 ++- .github/workflows/run_tests_partitioned.yml | 4 ++- .github/workflows/run_tests_tableview.yml | 4 ++- .github/workflows/run_tests_transaction.yml | 4 ++- build/Build.CI.GitHubActions.cs | 35 ++++++++++++++------- 12 files changed, 59 insertions(+), 24 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index c07f9c59c..41a9c212d 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -33,7 +33,9 @@ jobs: name: windows-latest runs-on: windows-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Make build.sh executable run: chmod +x ./build.sh - name: Make build.cmd executable @@ -59,7 +61,9 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Make build.sh executable run: chmod +x ./build.sh - name: Make build.cmd executable diff --git a/.github/workflows/nuget.yml b/.github/workflows/nuget.yml index 02474612e..ef1403c0e 100644 --- a/.github/workflows/nuget.yml +++ b/.github/workflows/nuget.yml @@ -28,7 +28,9 @@ jobs: name: windows-latest runs-on: windows-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Make build.sh executable run: chmod +x ./build.sh - name: Make build.cmd executable diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 8d5651c15..4e957bed0 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -33,7 +33,9 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Make build.sh executable run: chmod +x ./build.sh - name: Make build.cmd executable diff --git a/.github/workflows/run_tests_acks.yml b/.github/workflows/run_tests_acks.yml index 783e5fa4a..b250d4124 100644 --- a/.github/workflows/run_tests_acks.yml +++ b/.github/workflows/run_tests_acks.yml @@ -33,7 +33,9 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Make build.sh executable run: chmod +x ./build.sh - name: Make build.cmd executable diff --git a/.github/workflows/run_tests_api.yml b/.github/workflows/run_tests_api.yml index c73d5d049..e0146ad36 100644 --- a/.github/workflows/run_tests_api.yml +++ b/.github/workflows/run_tests_api.yml @@ -33,7 +33,9 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Make build.sh executable run: chmod +x ./build.sh - name: Make build.cmd executable diff --git a/.github/workflows/run_tests_autocluster.yml b/.github/workflows/run_tests_autocluster.yml index 49119fe17..e06b30bde 100644 --- a/.github/workflows/run_tests_autocluster.yml +++ b/.github/workflows/run_tests_autocluster.yml @@ -33,7 +33,9 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Make build.sh executable run: chmod +x ./build.sh - name: Make build.cmd executable diff --git a/.github/workflows/run_tests_eventsource.yml b/.github/workflows/run_tests_eventsource.yml index cb7d4952e..951a584a7 100644 --- a/.github/workflows/run_tests_eventsource.yml +++ b/.github/workflows/run_tests_eventsource.yml @@ -33,7 +33,9 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Make build.sh executable run: chmod +x ./build.sh - name: Make build.cmd executable diff --git a/.github/workflows/run_tests_multitopic.yml b/.github/workflows/run_tests_multitopic.yml index 616b3accf..8b7f80081 100644 --- a/.github/workflows/run_tests_multitopic.yml +++ b/.github/workflows/run_tests_multitopic.yml @@ -33,7 +33,9 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Make build.sh executable run: chmod +x ./build.sh - name: Make build.cmd executable diff --git a/.github/workflows/run_tests_partitioned.yml b/.github/workflows/run_tests_partitioned.yml index c090322f7..86b091e57 100644 --- a/.github/workflows/run_tests_partitioned.yml +++ b/.github/workflows/run_tests_partitioned.yml @@ -33,7 +33,9 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Make build.sh executable run: chmod +x ./build.sh - name: Make build.cmd executable diff --git a/.github/workflows/run_tests_tableview.yml b/.github/workflows/run_tests_tableview.yml index 0a84697a0..afce48f45 100644 --- a/.github/workflows/run_tests_tableview.yml +++ b/.github/workflows/run_tests_tableview.yml @@ -33,7 +33,9 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Make build.sh executable run: chmod +x ./build.sh - name: Make build.cmd executable diff --git a/.github/workflows/run_tests_transaction.yml b/.github/workflows/run_tests_transaction.yml index df91d4fbf..025afe457 100644 --- a/.github/workflows/run_tests_transaction.yml +++ b/.github/workflows/run_tests_transaction.yml @@ -33,7 +33,9 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Make build.sh executable run: chmod +x ./build.sh - name: Make build.cmd executable diff --git a/build/Build.CI.GitHubActions.cs b/build/Build.CI.GitHubActions.cs index a476622ad..fb52febc2 100644 --- a/build/Build.CI.GitHubActions.cs +++ b/build/Build.CI.GitHubActions.cs @@ -6,8 +6,9 @@ [CustomGitHubActions("build", GitHubActionsImage.WindowsLatest, - GitHubActionsImage.UbuntuLatest, - AutoGenerate = false, + GitHubActionsImage.UbuntuLatest, + //AutoGenerate = false, + FetchDepth = 0, OnPushBranches = new[] { "main", "dev", "release" }, OnPullRequestBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(Compile) }, @@ -16,7 +17,8 @@ [CustomGitHubActions("run_tests", GitHubActionsImage.UbuntuLatest, - AutoGenerate = false, + //AutoGenerate = false, + FetchDepth = 0, OnPullRequestBranches = new[] { "main", "dev", "release" }, OnPushBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(Test) }, @@ -26,7 +28,8 @@ [CustomGitHubActions("run_tests_acks", GitHubActionsImage.UbuntuLatest, - AutoGenerate = false, + //AutoGenerate = false, + FetchDepth = 0, OnPullRequestBranches = new[] { "main", "dev", "release" }, OnPushBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(Acks) }, @@ -36,7 +39,8 @@ [CustomGitHubActions("run_tests_partitioned", GitHubActionsImage.UbuntuLatest, - AutoGenerate = false, + //AutoGenerate = false, + FetchDepth = 0, OnPullRequestBranches = new[] { "main", "dev", "release" }, OnPushBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(Partitioned) }, @@ -45,7 +49,8 @@ [CustomGitHubActions("run_tests_transaction", GitHubActionsImage.UbuntuLatest, - AutoGenerate = false, + //AutoGenerate = false, + FetchDepth = 0, OnPullRequestBranches = new[] { "main", "dev", "release" }, OnPushBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(Transaction) }, @@ -55,7 +60,8 @@ [CustomGitHubActions("run_tests_api", GitHubActionsImage.UbuntuLatest, - AutoGenerate = false, + //AutoGenerate = false, + FetchDepth = 0, OnPullRequestBranches = new[] { "main", "dev", "release" }, OnPushBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(TestAPI) }, @@ -64,7 +70,8 @@ [CustomGitHubActions("run_tests_autocluster", GitHubActionsImage.UbuntuLatest, - AutoGenerate = false, + //AutoGenerate = false, + FetchDepth = 0, OnPullRequestBranches = new[] { "main", "dev", "release" }, OnPushBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(AutoClusterFailover) }, @@ -73,7 +80,8 @@ [CustomGitHubActions("run_tests_tableview", GitHubActionsImage.UbuntuLatest, - AutoGenerate = false, + //AutoGenerate = false, + FetchDepth = 0, OnPullRequestBranches = new[] { "main", "dev", "release" }, OnPushBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(TableView) }, @@ -82,7 +90,8 @@ [CustomGitHubActions("run_tests_eventsource", GitHubActionsImage.UbuntuLatest, - AutoGenerate = false, + //AutoGenerate = false, + FetchDepth = 0, OnPullRequestBranches = new[] { "main", "dev", "release" }, OnPushBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(EventSource) }, @@ -91,7 +100,8 @@ [CustomGitHubActions("run_tests_multitopic", GitHubActionsImage.UbuntuLatest, - AutoGenerate = false, + //AutoGenerate = false, + FetchDepth = 0, OnPullRequestBranches = new[] { "main", "dev", "release" }, OnPushBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(MultiTopic) }, @@ -100,7 +110,8 @@ [CustomGitHubActions("nuget", GitHubActionsImage.WindowsLatest, - AutoGenerate = false, + //AutoGenerate = false, + FetchDepth = 0, OnPushBranches = new[] { "main", "dev", "release" }, InvokedTargets = new[] { nameof(PublishNuget) }, ImportSecrets = new[] { "NUGET_API_KEY"},