Skip to main content

github-binary-upload is a utility for publishing releases from tags with attached files on GitHub.

Project description

GitHub Binary Upload

Introduction

github-binary-upload is a script for creating GitHub releases from Git tags with attached assets.

Installation

  • From PyPI:

    python3 -m pip install github-binary-upload
    
  • Self-contained executables for Linux x86_64 with glibc >= 2.17 (any recent Linux distribution) and macOS High Sierra and newer are available on the releases page.

  • AUR package for Arch Linux users: python-github-binary-upload

Usage

After installation you can run github-binary-upload:

usage: github-binary-upload [-h] [-g GITHUB_SERVER] [-c CREDENTIALS_FILE] [-l]
                            [-n] [-u USERNAME] [-V]
                            [project] [tag] [assets [assets ...]]

github-binary-upload is a utility for publishing releases from tags with attached files on GitHub.

positional arguments:
  project               GitHub project in the format "<user>/<project name>"
  tag                   tag that will be published as a release, ignored if '
                        --latest' is given
  assets                files that will be attached to the release

optional arguments:
  -h, --help            show this help message and exit
  -g GITHUB_SERVER, --github-server GITHUB_SERVER
                        GitHub server hostname (default: github.com)
  -c CREDENTIALS_FILE, --credentials-file CREDENTIALS_FILE
                        path to a file containing username and password/access
                        token (on two separate lines, default: ~/.github-
                        binary-uploadrc)
  -l, --latest          get the latest tag from the GitHub API
  -n, --dry-run         only print which releases would be published
  -u USERNAME, --user USERNAME
                        user account for querying the GitHub API; the password
                        is read from stdin
  -V, --version         print the version number and exit

Example

Run

github-binary-upload -u ExampleUser -l ExampleUser/ExampleProject MyFirstAsset.zip MySecondAsset.whl

to create a release from the latest tag in the GitHub project ExampleUser/ExampleProject. The files MyFirstAsset.zip and MySecondAsset.whl will be attached as downloadable files.

github-binary-upload can be called multiple times on the same tag. The release will be recreated each time. This is especially useful to CI pipelines which can run more than once.

Python API

github-binary-upload defines a function publish_release_from_tag which can be called from Python code:

from github_binary_upload import publish_release_from_tag


publish_release_from_tag(
    project, tag, assets, github_server, username, password, dry_run
)

If tag is None, the latest tag will be converted to a GitHub release. dry_run is an optional parameter which defaults to False.

Contributing

Please open an issue on GitHub if you experience bugs or miss features. Please consider to send a pull request if you can spend time on fixing the issue yourself. This project uses pre-commit to ensure code quality and a consistent code style. Run

make git-hooks-install

to install all linters as Git hooks in your local clone of github-binary-upload.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

github-binary-upload-0.1.10.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

github_binary_upload-0.1.10-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file github-binary-upload-0.1.10.tar.gz.

File metadata

  • Download URL: github-binary-upload-0.1.10.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.0

File hashes

Hashes for github-binary-upload-0.1.10.tar.gz
Algorithm Hash digest
SHA256 d760fe18b7eeed2f790f6ad238adee2eb4347166f6455abd00516578508dc365
MD5 0046361b44e6c3485321ceee6a3d9ab9
BLAKE2b-256 b3b41207be46119c1ea8aa9b063da2c71386d428a4527016febfeca9db31bea6

See more details on using hashes here.

File details

Details for the file github_binary_upload-0.1.10-py3-none-any.whl.

File metadata

File hashes

Hashes for github_binary_upload-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 c76e50bd54b6b29e571b08b68fc0578a5c59d8498744dcd9658e63c2992e1c82
MD5 da5bceea9512d3296f6a8b5b2be9b1e9
BLAKE2b-256 e23fe2e1ada8e720b892d30faffffd3f7203ad678719fe7d7e49b1def29c4ead

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page