Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to release versions on GitHub through the command line?

GitHub has a feature on their website that allows you to mark particular snapshots of your repository as release versions of software. Sample URL: https://github.com/github/orchestrator/releases

Is there a way I can do this from the command line, without having to log on and use the interface? I realize the feature is not a part of git, but I was hoping there is some kind of api or solution other people use to make the process automated.

like image 971
Trevor Hickey Avatar asked Jan 19 '14 08:01

Trevor Hickey


People also ask

Does GitHub have a CLI?

GitHub CLI is a command-line tool that brings pull requests, issues, GitHub Actions, and other GitHub features to your terminal, so you can do all your work in one place. GitHub CLI is an open source tool for using GitHub from your computer's command line.


1 Answers

There are many projects offering this — the order below is just for the sake indexing things —:

  1. cheton's github-release-cli in Node (JS)
  2. c4milo's github-release in Go (aims simplicity)
  3. aktau's github-release in Go

And you can even do this directly with curl directly:

OWNER=
REPOSITORY=
ACCESS_TOKEN=
VERSION=
curl --data '{"tag_name": "v$VERSION",
                "target_commitish": "master",
                "name": "v$VERSION",
                "body": "Release of version $VERSION",
                "draft": false,
                "prerelease": false}' \
    https://api.github.com/repos/$OWNER/$REPOSITORY/releases?access_token=$ACCESS_TOKEN

from Barry Kooij's Create Github releases via command line.

If you want a full featured answer on StackOverflow: Releasing a build artifact on Github.

like image 55
vaab Avatar answered Nov 16 '22 04:11

vaab