ghr

command module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2014 License: MIT Imports: 16 Imported by: 0

README

ghr

GitHub release Wercker MIT License Go Documentation

Easily ship your project to your user using Github Releases.

Description

ghr enable you to create Release on Github and upload your artifacts to it. ghr will parallelize upload multiple artifacts.

Demo

Result is here.

Usage

Run it in your project directory:

$ ghr [option] <tag> <artifacts>

You need to set GITHUB_TOKEN environmental variable:

$ export GITHUB_TOKEN="....."

Or you can set it in github.token in gitconfig:

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

Enviromental variable takes priority over gitconfig value.

GitHub Enterise

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

$ export GITHUB_API=http://github.company.com/api/v3

Example

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/ghr_0.1.0_darwin_386.zip
--> Uploading: pkg/ghr_0.1.0_darwin_amd64.zip
--> Uploading: pkg/ghr_0.1.0_linux_386.zip
--> Uploading: pkg/ghr_0.1.0_linux_amd64.zip
--> Uploading: pkg/ghr_0.1.0_windows_386.zip
--> Uploading: pkg/ghr_0.1.0_windows_amd64.zip

Or if you want to replace artifact which is already uploaded:

$ ghr --replace v0.1.0 pkg/

Options

You can set some options:

$ ghr \
    -t <token> \       # Set Github API Token
    -u <username> \    # Set Github username
    -r <repository> \  # Set repository name
    -p <num> \         # Set amount of parallelism (Default is number of CPU)
    --replace \        # Replace asset if target is already exists
    --delete \         # Delete release and its git tag in advance if it exists
    --draft \          # Release as draft (Unpublish)
    --prerelease \     # Crate prerelease
    <tag> <artifacts>

Install

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 relase page and place it in $PATH directory.

Integration with CI-as-a-Service

You can integrate ghr with CI-as-a-Service to release your artifacts after test passed. It's very easy to provide latest build to your user continuously.

See Integrate ghr with CI as a Service page.

VS.

  • 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.

Contribution

  1. Fork (https://github.com/tcnksm/ghr/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

You can get source with go get:

$ go get -d github.com/tcnksm/ghr
$ cd $GOPATH/src/github.com/tcnksm/cli-init
$ make install

Support

If you have something to ask me or request for new features, feel free to join gitter room.

![Gitter](https://badges.gitter.im/Join Chat.svg)

Author

tcnksm

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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