Generate a .torrent file corresponding to a particular Github Release
Why?
Distributing your application over WebTorrent/BitTorrent is cool! 😎
It can improve reliability and save money:
Your application can still be downloaded if Github gets blocked, goes down, or kicks you off*
You save Github 💲 by placing less demand on Github's AWS storage servers! ❤️
* as long as the torrent is being seeded
How?
This tool makes it easy to add a .torrent file to your existing Github Releases!
It downloads the files associated with a particular Github Release and creates a torrent file for them.
If you provide a Github OAuth token in the environment variable, it will add the torrent file to your release for you.
You don't even have to add any new code or change your CI deployment process.
You can try it first and see if you like it, and only automate it later.
If you don't specify owner, repo, or version it will try to obtain them from package.json in the current working directory.
Otherwise
owner is the Github username or name.
repo is the repository name.
version is the release to use. It must exactly match the git tag.
If --upload is used, it will create a Github OAuth token using ghauth or reuse one previously saved by gh-release, and use putasset to upload the .torrent file to your release.
The Github Release files are downloaded to a temporary directory and deleted afterwards.
The torrent file is saved in the current working directory and named ${repo}-${version}.torrent.
If there was a problem it will exit with a non-zero exit code.
Examples
> cd mymodule> webtorrentify-github-releaseDownloading wmhilton/mymodule@v0.0.1...RELEASES ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 0.0sSkipping upload to Github because the --upload flag wasn\'t used.> lsmymodule-v0.0.2.torrent