SDK Publishing (NPM & PyPI)
Maintainers can build, verify in clean isolated environments, synchronize versions, and publish both official JetPack SDKs using repeatable user-space Makefile commands:
- Frontend SDK (
@jetpack-desktop/client) —web/packages/jetpack-client, bundling compiledjetpack-wasm(crates/jetpack-wasm) intowasm/and re-exporting it via@jetpack-desktop/client/wasmso external consumers require zero manual WASM path setup. - Python Worker SDK (
jetpack-sdk) —sdks/python, built withhatchling(sdist+py3-none-anywheel) with zero mandatory dependencies (dependencies = []) and optionalmsgpackacceleration (jetpack-sdk[msgpack]).
See Frontend Quickstart and Python Worker SDK for consumer usage.
1. Build Both SDKs (make sdk-build)
make sdk-buildmake sdk-build executes in user space:
- Compiles
crates/jetpack-wasmviawasm-pack --target web(make wasm). - Copies compiled WASM glue and binaries (
jetpack_wasm.js,jetpack_wasm.d.ts,jetpack_wasm_bg.wasm,jetpack_wasm_bg.wasm.d.ts) intoweb/packages/jetpack-client/wasm/and compiles TypeScript todist/. - Cleans
sdks/python/dist/and builds fresh.tar.gz(sdist) and.whl(wheel) packages viauv build --directory sdks/python(orpython3 -m build).
2. Verify Packaging & Isolated Consumers (make sdk-check)
make sdk-checkmake sdk-check runs make sdk-build and executes scripts/sdk_check.sh, verifying:
- Version Parity:
@jetpack-desktop/client(package.json),jetpack-sdk(pyproject.tomlPEP 440), andEMBEDDED_JETPACK_SDK_VERSION(crates/jetpack-daemon/src/python.rs) match. - TypeScript SDK Unit Tests & Tarball Inspection: Runs
npm --prefix web/packages/jetpack-client test, packs the.tgz, and verifiesdist/,wasm/,README.md, andLICENSEare present without leakingsrc/,tests/, ornode_modules/. - Isolated Vite + TypeScript Consumer Smoke Check: Installs the packed
.tgzinto a fresh temporary Vite + TypeScript project, verifiestsc --noEmitandvite buildemitjetpack_wasm_bg-*.wasmintodist/assets/, and confirmsvite devserves/node_modules/@jetpack-desktop/client/wasm/jetpack_wasm_bg.wasmwith200 OKandapplication/wasm. - Python Metadata & Isolated Venv Check: Runs
twine check sdks/python/dist/*, inspects.whlcontents (includingjetpack_sdk/py.typed), installs the wheel into a clean temporaryuv venvwithout host site-packages, and passessdks/python/tests.
3. Version Synchronization (scripts/sync_version.sh)
Before tagging a release, synchronize all workspace and SDK manifests from a single semantic version or tag:
bash scripts/sync_version.sh v0.2.0This updates Cargo.toml, crates/jetpack-daemon/assets/Info.plist, web/package.json, web/packages/jetpack-client/package.json, sdks/python/pyproject.toml (converting SemVer pre-release tags such as -alpha.1 to PEP 440 a1), and EMBEDDED_JETPACK_SDK_VERSION in crates/jetpack-daemon/src/python.rs.
4. Dry-Run & Live Publishing (make sdk-publish)
Always run a non-mutating dry run before publishing:
make sdk-publish DRY_RUN=1DRY_RUN=1 validates the full make sdk-check suite, runs npm publish ./web/packages/jetpack-client --access public --dry-run, checks sdks/python/dist/* with twine check, and skips live uploads (even on a dirty git tree).
When publishing live from a clean git working tree:
| Command | Target Registry | Notes |
|---|---|---|
make sdk-publish | NPM + PyPI | Fails if git tree is dirty unless ALLOW_DIRTY=1 is set |
make sdk-publish-npm | NPM only (@jetpack-desktop/client) | Runs sdk-check first |
make sdk-publish-pypi | PyPI only (jetpack-sdk) | Runs sdk-check first |
Authentication Options
- NPM (
@jetpack-desktop/client): SetNPM_TOKEN(orNODE_AUTH_TOKEN)—written to an ephemeral0600temporary config deleted on exit without modifying~/.npmrc—or log in beforehand vianpm login. - PyPI (
jetpack-sdk): SetUV_PUBLISH_TOKEN(orPYPI_API_TOKEN/TWINE_PASSWORD), or rely on~/.pypirc/ an interactive prompt.
# Non-interactive CI / token-based publish
NPM_TOKEN=... UV_PUBLISH_TOKEN=... make sdk-publish
# Allow publishing while testing uncommitted local edits (not recommended for releases)
ALLOW_DIRTY=1 make sdk-publish-npm5. GitHub Actions Release Integration
.github/workflows/release.yml runs sdk-check on every tag (v*) or manual workflow_dispatch run, gating public desktop releases on SDK packaging verification. When NPM_TOKEN and/or PYPI_API_TOKEN repository secrets are configured, the publish-sdks job publishes both packages automatically after release artifacts succeed; if either secret is omitted, the step logs an informational notice and skips cleanly without failing binary or GitHub Pages releases.
To republish or publish SDKs only without building macOS, Windows, or Linux desktop installers, trigger Release JetPack via workflow_dispatch with publish_sdks_only: true and an optional release_tag (e.g. v0.1.2). This skips build-web, desktop builds, and release, running only sdk-check and publish-sdks.
See also CLI Tools Reference and Store Submission & Catalog Signing.
