command module
Version: v0.5.4 Latest Latest

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

Go to latest
Published: Jan 11, 2017 License: MIT Imports: 20 Imported by: 0



GitHub release Travis MIT License Go Documentation

ghr creates GitHub Release and uploads artifacts in parallel.


This demo creates GitHub Release page with v1.0.0 tag and uploads cross-compiled golang binaries.

You can see release page here.


To use ghr is simple. After setting GitHub API token (see more on GitHub API Token section), change GitHub repository root directory and run the following command,

$ ghr [option] TAG PATH

You must provide TAG (git tag) and PATH to artifacts you want to upload. You can specify a file or a directory. If you provide a directory, all files in that directory uploaded.

ghr assumes that you are in the GitHub repository root when executed. This is because normally the artifacts you want to upload to a GitHub Release page is in that repository or generated there. With this assumption, ghr implicitly reads repository URL from .git/config file. But You can change this kind of information via option, see Options section.

GitHub API Token

To use ghr, you need to get a GitHub token with an account which has enough permissions to to create releases. To get token, first, visit GitHub account settings page, then go to Applications for the user. Here you can create a token in the Personal access tokens section. For a private repository you need repo scope and for a public repository you need public_repo scope.

When using ghr, you can set it via GITHUB_TOKEN env var, -token command line option or github.token property in .gitconfig file.

For instance, to set it via environmental variable:

$ export GITHUB_TOKEN="....."

Or set it in github.token in gitconfig:

$ git config -global github.token "....."

Note that environmental variable takes priority over gitconfig value.

GitHub Enterprise

You can use ghr for GitHub Enterprise. Change API endpoint via the enviromental variable.

$ export GITHUB_API=


To upload all package in pkg directory with tag v0.1.0

$ ghr v0.1.0 pkg/
--> Uploading: pkg/0.1.0_SHASUMS
--> Uploading: pkg/
--> Uploading: pkg/
--> Uploading: pkg/
--> Uploading: pkg/
--> Uploading: pkg/
--> Uploading: pkg/


You can set some options:

$ ghr \
    -t TOKEN \        # Set Github API Token
    -u USERNAME \     # Set Github username
    -r REPO \         # Set repository name
    -c COMMIT \       # Set target commitish, branch or commit SHA
    -b BODY \         # Set text describing the contents of the release
    -p NUM \          # Set amount of parallelism (Default is number of CPU)
    -delete \         # Delete release and its git tag in advance if it exists
    -draft \          # Release as draft (Unpublish)
    -prerelease \     # Crate prerelease


If you are OSX user, you can use Homebrew:

$ brew tap tcnksm/ghr
$ brew install ghr

If you are in another platform, you can download binary from release page and place it in $PATH directory.

Or you can use go get (you need to use go1.7 or later),

$ go get -u


  • aktau/github-release - github-release can also create and edit releases and upload artifacts. It has many options. ghr is a simple alternative. And ghr will parallelize upload artifacts.


  1. Fork (
  2. Create a feature branch
  3. Commit your changes
  4. Rebase your local changes against the master branch
  5. Run test suite with the make test command and confirm that it passes
  6. Run gofmt -s
  7. Create new Pull Request


Taichi Nakashima



Command ghr is a tool to create a Github Release and upload your artifacts in parallel.


Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL