Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/upfluence/gh-downloader
https://github.com/upfluence/gh-downloader
kind-cli
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/upfluence/gh-downloader
- Owner: upfluence
- Created: 2015-08-11T22:06:24.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-07-19T00:40:10.000Z (over 1 year ago)
- Last Synced: 2024-11-21T22:35:21.103Z (about 2 months ago)
- Topics: kind-cli
- Language: Go
- Size: 4.59 MB
- Stars: 2
- Watchers: 14
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gh-downloader
Download a GitHub release asset from a semver version template
## Installation
Easy! You can just download the binary from the command line:
* Linux
```shell
curl -sL https://github.com/upfluence/gh-downloader/releases/download/v0.1.0/gh-downloader-linux-amd64 > gh-downloader
```* OSX
```shell
curl -sL https://github.com/upfluence/gh-downloader/releases/download/v0.1.0/gh-downloader-darwin-amd64 > gh-downloader
```If you prefer compiling the binary (assuming buildtools and Go are
installed):```shell
go install github.com/upfluence/gh-downloader/cmd/gh-downloader
```## Usage
### CLI
#### Options
```
usage: gh-downloader [--gh-token] [--repository, -r] [--asset, -a] [--scheme, -s] [--latest] [--output, -o] [--mode]
Arguments:
- GithubToken: string GitHub API token (env: GITHUB_TOKEN, UPF_GITHUB_TOKEN, flag: --gh-token)
- Repository: main.repoConfig Repository (env: REPOSITORY, flag: --repository, -r)
- Asset: string Asset name (env: ASSET, flag: --asset, -a)
- Scheme: string Scheme of the release (env: SCHEME, flag: --scheme, -s)
- Output: string Output location on disk, if left empty the file will be written on stdout (env: OUTPUT, flag: --output, -o)
- FileMode: main.fileMode File mode to create the output file in (default: 0644) (env: FILEMODE, flag: --mode)
```#### Example
Let's say you have a repositiory `upfluence/foo` and all the release are
tagged such as `bar-0.0.1`, `bar-0.1.0` and so on.you can download the latest release with:
```shell
gh-downloader -a mybin -gh-token="GITHUB_TOKEN.." -o mybin -repository upfluence/foo -s "bar-vx.x.x"
```you can also download the latest release with the major version 3
```shell
gh-downloader -a mybin -gh-token="GITHUB_TOKEN.." -o mybin -repository upfluence/foo -s "bar-v3.x.x"
```### GitHub Action
```
on: push
jobs:
gh-downloader:
runs-on: ubuntu-20.04
steps:
- uses: upfluence/gh-downloader@master
with:
repo: upfluence/ubuild
github-token: ${{ secrets.GITHUB_TOKEN }}
asset: ubuild-linux-amd64
output: ~/gh-action
```