No description, website, or topics provided.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
build
docstemplate/styles
src/Nuke.GitHub
.gitattributes
.gitignore
.nuke
CHANGELOG.md
GitVersion.yml
Jenkinsfile
LICENSE.md
Nuke.GitHub.sln
README.md
app-logo.png
build.cmd
build.ps1
build.sh
docfx.json
toc.yml

README.md

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)
        );
    });