Skip to main content

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.

Metadata

Release files for github-binary-upload 0.1.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for github-binary-upload 0.1.10
File Size Uploaded Provenance Actions
github-binary-upload-0.1.10.tar.gz 8.3 kB Without provenance Details for github-binary-upload-0.1.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for github-binary-upload 0.1.10
File Interpreter ABI Platform Actions
github_binary_upload-0.1.10-py3-none-any.whl Python 3 none any Details for github_binary_upload-0.1.10-py3-none-any.whl

Total release size: 16.6 kB

Release files / github-binary-upload-0.1.10.tar.gz

Download URL github-binary-upload-0.1.10.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d760fe18b7eeed2f790f6ad238adee2eb4347166f6455abd00516578508dc365
BLAKE2b-256 checksum
How to use checksums
b3b41207be46119c1ea8aa9b063da2c71386d428a4527016febfeca9db31bea6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.0

Release files / github_binary_upload-0.1.10-py3-none-any.whl

Download URL github_binary_upload-0.1.10-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c76e50bd54b6b29e571b08b68fc0578a5c59d8498744dcd9658e63c2992e1c82
BLAKE2b-256 checksum
How to use checksums
e23fe2e1ada8e720b892d30faffffd3f7203ad678719fe7d7e49b1def29c4ead
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.0

Security for github-binary-upload 0.1.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page