Git Product home page Git Product logo

github-release-1's Introduction

github-release

A small commandline app written in Go that allows you to easily create and delete releases of your projects on Github. In addition it allows you to attach files to those releases.

It interacts with the github releases API. Though it's entirely possibly to do all these things with cURL, It's not really that user-friendly. For example, you need to first query the API to find the id of the release you want, before you can upload an artifact. github-release takes care of those little details.

It might still be a bit rough around the edges, pull requests are welcome!

How to install

If you don't have the Go toolset installed, and you don't want to, but still want to use the app, you can download binaries for your platform on the releases page. Yes, that's dogfooding, check the makefile!

If you have Go installed, you can just do:

go get github.com/aktau/github-release

This will automatically download, compile and install the app.

After that you should have a github-release executable in your $GOPATH/bin.

How to use

NOTE: for these examples I've created a github token and set it as the env variable GITHUB_TOKEN. github-release will automatically pick it up from the environment so that you don't have to pass it as an argument.

# set your token
export GITHUB_TOKEN=...

# check the help
$ github-release --help

# make your tag and upload
$ git tag ... && git push --tags

# check the current tags and existing releases of the repo
$ github-release info -u aktau -r gofinance
git tags:
- v0.1.0 (commit: https://api.github.com/repos/aktau/gofinance/commits/f562727ce83ce8971a8569a1879219e41d56a756)
releases:
- v0.1.0, name: 'hoary ungar', description: 'something something dark side 2', id: 166740, tagged: 29/01/2014 at 14:27, published: 30/01/2014 at 16:20, draft: ✔, prerelease: ✗
  - artifact: github.go, downloads: 0, state: uploaded, type: application/octet-stream, size: 1.9KB, id: 68616

# create a formal release
$ github-release release \
    --user aktau \
    --repo gofinance \
    --tag v0.1.0 \
    --name "the wolf of source street" \
    --description "Not a movie, contrary to popular opinion. Still, my first release!" \
    --pre-release

# you've made a mistake, but you can edit the release without
# having to delete it first (this also means you can edit without having
# to upload your files again)
$ github-release edit \
    --user aktau \
    --repo gofinance \
    --tag v0.1.0 \
    --name "Highlander II: The Quickening" \
    --description "This is the actual description!"

# upload a file, for example the OSX/AMD64 binary of my gofinance app
$ github-release upload \
    --user aktau \
    --repo gofinance \
    --tag v0.1.0 \
    --name "gofinance-osx-amd64" \
    --file bin/darwin/amd64/gofinance

# upload other files...
$ github-release upload ...

# you're not happy with it, so delete it
$ github-release delete \
    --user aktau \
    --repo gofinance \
    --tag v0.1.0

GitHub Enterprise Support

You can point to a different GitHub API endpoint via the environment variable GITHUB_API:

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

Used libraries

Package Description License
github.com/dustin/go-humanize humanize file sizes MIT
github.com/voxelbrain/goptions option parsing BSD

Todo

  • Check if an artifact is already uploaded before starting a new upload

Copyright

Copyright (c) 2014, Nicolas Hillegeer. All rights reserved.

github-release-1's People

Contributors

aktau avatar awh avatar bboreham avatar bilge avatar brb avatar carlsverre avatar jwilder avatar kruton avatar pgokul avatar tenzer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.