CLI helper to install Github releases on your system.
Project description
Github release installer
gh-release-install is a CLI helper to install Github releases on your system.
It can be used for pretty much anything, to install a formatter in your CI, deploy
some binary using an orcherstration tool, or on your desktop.
This project was mainly created to...
# ...turn this mess:
wget --quiet --output-document=- "https://github.com/koalaman/shellcheck/releases/download/v0.7.1/shellcheck-v0.7.1.linux.x86_64.tar.xz" \
| tar --extract --xz --directory=/usr/local/bin --strip-components=1 --wildcards 'shellcheck*/shellcheck' \
&& chmod +x /usr/local/bin/shellcheck
wget --quiet --output-document=/usr/local/bin/shfmt "https://github.com/mvdan/sh/releases/download/v3.2.1/shfmt_v3.2.1_linux_amd64" \
&& chmod +x /usr/local/bin/shfmt
# Into this:
pip3 install gh-release-install
gh-release-install \
"koalaman/shellcheck" \
"shellcheck-{tag}.linux.x86_64.tar.xz" --extract "shellcheck-{tag}/shellcheck" \
"/usr/bin/shellcheck"
gh-release-install \
"mvdan/sh" \
"shfmt_{tag}_linux_amd64" \
"/usr/bin/shfmt"
Features:
- Download releases from Github.
- Extract zip or tarball on the fly.
- Pin to a desired version or get the
latestversion. - Keep track of the local tools version using a version file.
Installation
Install the package from pip:
pip install gh-release-install
gh-release-install --help
Or with with pipx:
pipx install gh-release-install
gh-release-install --help
Usage
usage: gh-release-install [-h] [--extract <filename>] [--version <version>]
[--version-file <filename>]
[--checksum <hash>:<digest|asset>] [-v] [-q]
REPOSITORY ASSET DESTINATION
Install GitHub release file on your system.
positional arguments:
REPOSITORY Github REPOSITORY org/repo to get the release from.
ASSET Release ASSET filename. May contain variables such as
'{version}' or '{tag}'.
DESTINATION Path to save the downloaded file. If DESTINATION is a
directory, the asset name will be used as filename in
that directory. May contain variables such as
'{version}' or '{tag}'.
optional arguments:
-h, --help show this help message and exit
--extract <filename> Extract the <filename> from the release asset archive
and install the extracted file instead. May contain
variables such as '{version}' or '{tag}'. (default:
None)
--version <version> Desired release version to install. When using 'latest'
the installer will guess the latest version from the
Github API. (default: latest)
--version-file <filename>
Track the version installed on the system using a file.
May contain variables such as '{destination}'. (default:
None)
--checksum <hash>:<digest|asset>
Asset checksum used to verify the downloaded ASSET.
<hash> can be one of md5, sha1, sha224, sha256, sha384,
sha512. <digest|asset> can either be the expected
checksum, or the filename of an checksum file in the
release assets. (default: None)
-v, --verbose Increase the verbosity. (default: 0)
-q, --quiet Disable logging. (default: None)
template variables:
{tag} Release tag name.
{version} Release tag name without leading 'v'.
{destination} DESTINATION path, including the asset filename if path
is a directory.
examples:
gh-release-install 'mvdan/sh' \
'shfmt_{tag}_linux_amd64' \
'/usr/local/bin/shfmt' \
--version 'v3.3.1'
gh-release-install 'prometheus/prometheus' \
'prometheus-{version}.linux-amd64.tar.gz' \
--extract 'prometheus-{version}.linux-amd64/prometheus' \
'/usr/local/bin/prometheus' \
--version-file '{destination}.version' \
--checksum 'sha256:sha256sums.txt'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gh_release_install-0.13.1.tar.gz.
File metadata
- Download URL: gh_release_install-0.13.1.tar.gz
- Upload date:
- Size: 21.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9be7f2060fd90140b1b9f3532f6adb6cd5725a3af747dd4199ab6f847af8d167
|
|
| MD5 |
4becc5903c2af1bff7dea67f38f66582
|
|
| BLAKE2b-256 |
b17a5f3bad2f7bf5c27179a584ae6635f78997c028af0e72a0df78143fed5355
|
Provenance
The following attestation bundles were made for gh_release_install-0.13.1.tar.gz:
Publisher:
release.yml on jooola/gh-release-install
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gh_release_install-0.13.1.tar.gz -
Subject digest:
9be7f2060fd90140b1b9f3532f6adb6cd5725a3af747dd4199ab6f847af8d167 - Sigstore transparency entry: 661269935
- Sigstore integration time:
-
Permalink:
jooola/gh-release-install@9effb855e5ab506cede037b8e7cdc0b536574110 -
Branch / Tag:
refs/tags/v0.13.1 - Owner: https://github.com/jooola
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9effb855e5ab506cede037b8e7cdc0b536574110 -
Trigger Event:
push
-
Statement type:
File details
Details for the file gh_release_install-0.13.1-py3-none-any.whl.
File metadata
- Download URL: gh_release_install-0.13.1-py3-none-any.whl
- Upload date:
- Size: 21.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1c54c34655716fa8bd06c8707992852086b5fe57f4651593feabc936ccaad78
|
|
| MD5 |
de231f83d80088b337c1d691cbded375
|
|
| BLAKE2b-256 |
0f20f7d385102fb0f992c2d502bd2b7ed9f9c48317ad0aff5b14f12778cd3feb
|
Provenance
The following attestation bundles were made for gh_release_install-0.13.1-py3-none-any.whl:
Publisher:
release.yml on jooola/gh-release-install
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gh_release_install-0.13.1-py3-none-any.whl -
Subject digest:
f1c54c34655716fa8bd06c8707992852086b5fe57f4651593feabc936ccaad78 - Sigstore transparency entry: 661269943
- Sigstore integration time:
-
Permalink:
jooola/gh-release-install@9effb855e5ab506cede037b8e7cdc0b536574110 -
Branch / Tag:
refs/tags/v0.13.1 - Owner: https://github.com/jooola
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9effb855e5ab506cede037b8e7cdc0b536574110 -
Trigger Event:
push
-
Statement type: