ghr is a simple tool to create GitHub Release and upload artifacts by one command. ghr uploads multiple artifacts in parallel.
You can see results here.
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.
You can use ghr for GitHub Enterprise. Change API endpoint via the enviromental variable.
$ export GITHUB_API=http://github.company.com/api/v3To 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.zipOr if you want to replace artifact which is already uploaded:
$ ghr --replace v0.1.0 pkg/You can set some options:
$ ghr \
-t <token> \ # Set Github API Token
-u <username> \ # Set Github username
-r <repository> \ # Set repository name
-c <commitish> \ # Set target commitish, branch or commit SHA
-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>If you are OSX user, you can use Homebrew:
$ brew tap tcnksm/ghr
$ brew install ghrIf you are in another platform, you can download binary from release page and place it in $PATH directory.
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.
- aktau/github-release -
github-releasecan also create and edit releases and upload artifacts. It has many options.ghris a simple alternative. Andghrwill parallelize upload artifacts.
- Fork (https://github.com/tcnksm/ghr/fork)
- Create a feature branch
- Commit your changes
- Rebase your local changes against the master branch
- Run test suite with the
make testcommand and confirm that it passes - Run
gofmt -s - Create new Pull Request
You can get source with go get:
$ go get -d github.com/tcnksm/ghr
$ cd $GOPATH/src/github.com/tcnksm/ghr
$ make install