releasekit

package module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2018 License: BSD-3-Clause Imports: 10 Imported by: 0

README

releasekit

CircleCI

Command-line app to create GitHub releases.

Installation

To get the most up to date binaries, check the releases for the pre-built binary for your system.

You can also go get to install from source.

go get -u github.com/tombell/releasekit/cmd/releasekit

On macOS you can use Homebrew to install.

brew tap tombell/formulae && brew install tombell/formulae/releasekit

Usage

Use the -h/--help flag to see all the available flags when running releasekit.

You will need a GitHub API token when running releasekit. It's advised you create a token specifically for releasekit.

Creating a Release

To create a new release, the tag you want to cut a release for should be pushed to GitHub.

releasekit -t $GITHUB_TOKEN -o tombell -r releasekit -p v0.1.0 -n v0.2.0 --dry

This will print then release notes for v0.2.0, and will generate the notes from closed issues and merged pull requests between v0.1.0 and v0.2.0.

If you're happy with the release notes, you can rerun the command omitting the --dry flag. This will go ahead and create the release on the GitHub repository.

Updating a Release

To update an existing release, you can rerun the command again, including any additional flags.

releasekit -t $GITHUB_TOKEN -o tombell -r releasekit -p v0.1.0 -n v0.2.0 --attachment docs/api.md

This will update the existing v0.2.0 release created above, it will also attach the docs/api.md file as a release asset when updating.

Draft and Pre-Release Releases

To mark a release as a draft you can use the --draft flag. This will create the release as a draft, and not associate it with a tag name.

releasekit -t $GITHUB_TOKEN -o tombell -r releasekit -p v0.1.0 -n v0.2.0 --draft

There are some limitations when using the --draft flag, if you rerun the command without the --draft flag, it will create a new release but not remove the old draft.

To mark a release as a pre-release you can use the --prerelease flag. This will create or update a release as a pre-release.

releasekit -t $GITHUB_TOKEN -o tombell -r releasekit -p v0.1.0 -n v0.2.0 --prerelease

You can rerun the command without the --prerelease flag, to remove the pre-release mark from the release.

Including Labels

If you would like to highlight specific labels on pull requests/issues in the release notes, you can use the --label flag.

releasekit -t $GITHUB_TOKEN -o tombell -r releasekit -p v0.1.0 -n v0.2.0 --label bug

The release on GitHub would then have bug next to any item that had the bug label.

Attaching Release Assets

When you create or update a release, you can attach any files as release assets using the --attachment flag. This flag can be used multiple times to attach multiple release assets.

releasekit -t $GITHUB_TOKEN -o tombell -r releasekit -p v0.1.0 -n v0.2.0 --attachment docs/file1 --attachment docs/file2

The release on GitHub would then have file1 and file2 as assets available to download.

Watching Specific Files

If you would like to include in the release notes if a specific file has changed in this release, you can use the --watch flag. This flag can be used multiple times to watch multiple files.

releasekit -t $GITHUB_TOKEN -o tombell -r releasekit -p v0.1.0 -n v0.2.0 --watch cmd/releasekit/main.go --watch releasekit.go

This will include an additional section at the bottom of the release listing these files if they've changed, and a link to the compare page on GitHub.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateGitHubClient

func CreateGitHubClient(token string) *github.Client

CreateGitHubClient creates a new GitHub API client with the specified access token for authentication.

func CreateOrEditRelease

func CreateOrEditRelease(c *github.Client, owner, repo string, release *github.RepositoryRelease) (*github.RepositoryRelease, error)

CreateOrEditRelease creates a repository release if it doesn't exist, else it will edit an existing repository release.

func FetchClosedIssuesSince

func FetchClosedIssuesSince(c *github.Client, owner, repo string, since time.Time) ([]*github.Issue, error)

FetchClosedIssuesSince fetches all closed issues since the specified time.

func FilterClosedAfter

func FilterClosedAfter(issues []*github.Issue, d time.Time) []*github.Issue

FilterClosedAfter filters out all issues that were closed before the specified time.

func FilterClosedBefore

func FilterClosedBefore(issues []*github.Issue, d time.Time) []*github.Issue

FilterClosedBefore filters out all issues that were closed after the specified time.

func FilterClosedByCommits

func FilterClosedByCommits(issues []*github.Issue, commits []github.RepositoryCommit) []*github.Issue

FilterClosedByCommits filters out any issues that have not been closed by commit messages.

func FilterClosedByPull

func FilterClosedByPull(issues []*github.Issue) []*github.Issue

FilterClosedByPull filters out all issues that were closed automatically by a pull request.

func FilterMergedPullsAfter

func FilterMergedPullsAfter(issues []*github.Issue, commits []github.RepositoryCommit) []*github.Issue

FilterMergedPullsAfter filters out any issues or pull requests closed outside of the commit comparison range.

func FilterNonMergedPulls

func FilterNonMergedPulls(issues []*github.Issue, c *github.Client, owner, repo string) []*github.Issue

FilterNonMergedPulls filters out all pull requests that were closed and not merged.

func GetCommitForTag

func GetCommitForTag(c *github.Client, owner, repo, tag string) (*github.RepositoryCommit, error)

GetCommitForTag gets the commit a tag is a reference to.

func GetComparison

func GetComparison(c *github.Client, owner, repo, base, head string) (*github.CommitsComparison, error)

GetComparison gets the commit comparison for the given base and head range.

func GetFirstCommit

func GetFirstCommit(c *github.Client, owner, repo string) (*github.RepositoryCommit, error)

GetFirstCommit gets the first commit to the repository.

func GetPullRequest

func GetPullRequest(c *github.Client, owner, repo string, number int) (*github.PullRequest, error)

GetPullRequest gets the pull request with the specified number.

func GetReleaseByTag

func GetReleaseByTag(c *github.Client, owner, repo, tag string) (*github.RepositoryRelease, error)

GetReleaseByTag returns a repository release for the given tag if it exists.

func UploadReleaseAssets

func UploadReleaseAssets(c *github.Client, owner, repo string, id int, attachments []string) error

UploadReleaseAssets uploads the files to the release as assets.

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL