Skip to content

smezger/Nuke.GitHub

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

8acaf32 · Jul 16, 2020

History

65 Commits
Feb 14, 2020
Feb 26, 2018
Jul 16, 2020
Feb 26, 2018
Feb 26, 2018
Feb 26, 2018
Feb 14, 2020
Feb 19, 2019
Aug 5, 2018
Feb 26, 2018
Feb 23, 2019
Feb 14, 2020
Aug 12, 2018
Feb 26, 2018
Feb 26, 2018
Mar 2, 2019
Mar 2, 2019
Dec 15, 2018
Feb 26, 2018

Repository files navigation

Nuke.GitHub

Build Status
Built with Nuke

NuGet MyGet

This plugin provides some methods to work with GitHub repositories in NUKE Build.

Currently supported:

  • PublishRelease to create GitHub releases.
  • CreatePullRequest
  • GetReleases
  • GetRepository

Link to documentation.

Changelog

CI Builds

All builds are available on MyGet:

https://www.myget.org/F/dangl/api/v2
https://www.myget.org/F/dangl/api/v3/index.json

Example

using static Nuke.GitHub.GitHubTasks;
using static Nuke.GitHub.ChangeLogExtensions;
using static Nuke.Common.ChangeLog.ChangelogTasks;

Target PublishGitHubRelease => _ => _
    .DependsOn(Pack)
    .Requires(() => GitHubAuthenticationToken)
    .OnlyWhen(() => GitVersion.BranchName.Equals("master") || GitVersion.BranchName.Equals("origin/master"))
    .Executes<Task>(async () =>
    {
        var releaseTag = $"v{GitVersion.MajorMinorPatch}";

        // Not providing the second, optional parameter gives the latest section
        var changeLogSectionEntries = ExtractChangelogSectionNotes(ChangeLogFile);
        var latestChangeLog = changeLogSectionEntries
            .Aggregate((c, n) => c + Environment.NewLine + n);
        var completeChangeLog = $"## {releaseTag}" + Environment.NewLine + latestChangeLog;

        var repositoryInfo = GetGitHubRepositoryInfo(GitRepository);

        await PublishRelease(x => x
            .SetArtifactPaths(GlobFiles(OutputDirectory, "*.nupkg").NotEmpty().ToArray())
            .SetCommitSha(GitVersion.Sha)
            .SetReleaseNotes(completeChangeLog)
            .SetRepositoryName(repositoryInfo.repositoryName)
            .SetRepositoryOwner(repositoryInfo.gitHubOwner)
            .SetTag(releaseTag)
            .SetToken(GitHubAuthenticationToken)
        );
    });

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 86.3%
  • PowerShell 6.2%
  • Shell 5.0%
  • CSS 2.4%
  • Batchfile 0.1%