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.gzor.zip).
# 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>pip install bin-upload
# or with UV
uv tool install bin-upload
# or run with uvx
uvx bin-upload <command>Download the appropriate binary for your platform from the releases page.
The following must be installed and available on your path.
bin-upload initThis will walk you through an interactive prompt and generate a bin-upload.config.yaml file.
More on configuration here.
git add .
git commit -m "..."
git tag -a v1.0.0 -m "Release v1.0.0"
bin-upload pack
bin-upload pack -s npm.packageJson.version=1.0.0 -s pypi.metadata.Version=1.0.0This 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.
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 push origin main --follow-tags
bin-upload publish
bin-upload publishThis publishes the artifacts generated by the pack command.
More on the publish command, including how to publish with GitHub actions, can be viewed here.
Once published, install from npm or PyPI and confirm:
# npm
npx YOUR_PACKAGE ...
# PyPI
uvx YOUR_PACKAE ...