Skip to content

dworthen/bin-upload

Repository files navigation

Bin Upload

Easily distribute binaries via npm, pypi, and GitHub releases.

bin-upload is a CLI tool built with Bun that packages and publishes pre-built binaries to multiple registries and platforms. It supports:

  • npm — Publishes a main package that depends on platform-specific binary packages using optionalDependencies.
  • PyPI — Builds wheel (.whl) packages for each platform-specific tag.
  • GitHub Releases — Creates releases and uploads archive assets (.tar.gz or .zip).

Full documentation.

Installation

NPM

# Globally
npm install -g @d-dev/bin-upload
# or as a package dep
npm install -D @d-dev/bin-upload
# or run with npx
npx @d-dev/bin-upload <command>

Python

pip install bin-upload
# or with UV
uv tool install bin-upload
# or run with uvx
uvx bin-upload <command>

GitHub Releases

Download the appropriate binary for your platform from the releases page.

Requirements

The following must be installed and available on your path.

  • npm: if publishing to npm
  • uv: if publishing to pypi

1. Init

bin-upload init

This will walk you through an interactive prompt and generate a bin-upload.config.yaml file.

More on configuration here.

2. Pack

Git flow

git add .
git commit -m "..."
git tag -a v1.0.0 -m "Release v1.0.0"
bin-upload pack

Non-git flow

bin-upload pack -s npm.packageJson.version=1.0.0 -s pypi.metadata.Version=1.0.0

This will generate artifacts in .bin-upload that can be published to npm (tarballs), pypi (wheel), and GitHub (tarballs and zips).

More on the pack command, including how to test artifacts prior to publishing, can be viewed here.

3. Publish

Create a .env file with the following tokens.

# NPM granular access token that bypasses 2FA
# https://docs.npmjs.com/about-access-tokens
NPM_TOKEN="YOUR NPM TOKEN"
# GitHub token with repository metadata read and
# contents write permissions
GITHUB_TOKEN="YOUR GITHUB TOKEN"
PYPI_TOKEN="YOUR PYPI TOKEN"

Git flow

git push origin main --follow-tags
bin-upload publish

Non-git flow

bin-upload publish

This publishes the artifacts generated by the pack command.

More on the publish command, including how to publish with GitHub actions, can be viewed here.

Verify

Once published, install from npm or PyPI and confirm:

# npm
npx YOUR_PACKAGE ...

# PyPI
uvx YOUR_PACKAE ...

Full documentation.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors