Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best way to distribute a binary of my project on GitHub?

I have a small github repo to convert MS Word Documents, but most people will just want the binary.

Should I

  • Reorganise my repo to have a src/ and bin/ directories with the most up to date .exe in with the code and expect people to download the whole lot?
  • Compile and place my binary somewhere else on the web and link to it?
  • Include my binary in my repo but link to it seperately?
like image 333
Toby Allen Avatar asked Dec 16 '12 11:12

Toby Allen


People also ask

Can you put binaries in GitHub?

The hubapp command line tool lets you install app binaries from github user's releases. Once installed, simply select the version you require from the dropdown and start using the downloaded github user's app.

What is the best practice for storage of binaries?

Binaries are stored in the filestore and their metadata is stored in a database. While it's possible to store the binaries in the database as a BLOB, it is not recommended because databases have limitations when storing large files and this can lead to performance degradation and negatively impact operational costs.

Is Git good for binary files?

It's no secret that git is terrible at handling binary files out of the box. This can often be addressed with git plugins such as git-lfs and the like which use a centralized server as a host for the files and the git repository simply acts as a collection of pointers to the files used in a specific database.

How do I add binary to GitHub?

You can click the “Upload files” button in the toolbar at the top of the file tree. Or, you can drag and drop files from your desktop onto the file tree.


2 Answers

To host that binary for your application, you now can, since 2nd July 2013, define a release.

Releases, a workflow for shipping software to end users.
Releases are first-class objects with changelogs and binary assets that present a full project history beyond Git artifacts. They're accessible from a repository's homepage:

homepage

  • Releases are accompanied by release notes and links to download the software or source code.
  • Following the conventions of many Git projects, releases are tied to Git tags. You can use an existing tag, or let releases create the tag when it's published.
  • You can also attach binary assets (such as compiled executables, minified scripts, documentation) to a release. Once published, the release details and assets are available to anyone that can view the repository.

release

That replaces the old binary upload service, which was removed in December 2012 (as you mention in your question).

like image 163
VonC Avatar answered Nov 21 '22 21:11

VonC


Probably not what you want to hear, but in your case this is mostly personal preference.

You don't have to store the binary in the repo, because it is no important dependency. It is the other way around: everything you need to recreate the file should be in your repository (including Makefiles/project files).

You can store the binary in the repo because it is fairly small. You should not store it in the repository when the overall size in the repository (base size + diffs, depending how big the diffs are) is overwhelming, but this does not seem to be the case (500 KiB according to your repo).


My personal preference is to never store generated files (binaries, but also generated text files) in the repo. Possibly because I have experience with 2 GiB csv repositories that take ages to pull. (to be fair: it also takes ages to compile)

For my github project I created a subdomain on some webspace where I put all my downloads and the index page of that subdomain forwards to my github-pages. The github pages link to the downloads on my webspace subdomain. Just because I like my github subdomain a bit more for this project.

My tool works for different platforms though, so not every user needs every binary file. The binaries actually are backends (therefore dependencies), but interchangeable/optional

You can have a look at my setup.

like image 25
JonnyJD Avatar answered Nov 21 '22 20:11

JonnyJD