Docs/Ship and operate

Publish the SDKs

Maintainer instructions for building release artifacts and distributing Crawlingo through npm, PyPI and crates.io.

Download .md
Developers4 min read6 sections
Source reference · Match your SDK version. Availability and known issues
In this guide

Prepare one version across three packages

Release v1.0.0-alpha.3 (Python 1.0.0a3) passed the SDK build matrix. Check each registry and release run for current publication status. Prereleases use the npm next channel. Keep Cargo.toml, sdk/nodejs/native/Cargo.toml, sdk/nodejs/package.json, sdk/nodejs/package-lock.json sdk/python/pyproject.toml and sdk/python/crawlingo/__init__.py aligned. The version checker normalizes Python prerelease notation.

Run the Release workflow manually first: workflow_dispatch builds and checks artifacts without uploading packages unless the explicit npm retry input is enabled. Commit both Cargo lockfiles. The workflow prepares all SDK and CLI artifacts, verifies the complete set and creates SHA256SUMS and release-manifest.json before allowing registry uploads. Review a manual run before publishing the matching GitHub prerelease. The tag and prerelease flag must match the package version. Final asset upload runs after all three registries succeed; registry publication is not atomic.

node scripts/check-release.cjs
cargo test --locked --lib --tests
cd sdk/nodejs
npm ci
npm run build
npm test
node --test tests/dataset_job.test.cjs
shell7 lines · copy-ready

Node.js → npm

The package includes JavaScript, declarations and native addons in dist/. The release matrix builds Linux x64 GNU, macOS Intel, macOS ARM64 and Windows x64 addons. These are build targets, not a claim that all platforms have passed the new release.

The release workflow on GitHub main attempts npm trusted publishing using npm 11 and the npm environment. Select Allow npm publish in the trusted publisher allowed actions. New connections permit staged publishing by default. Verify the actual release run and registry version after publication. Prerelease publishing targets next; alpha.2 was separately promoted to latest. Registry versions cannot be replaced, so changed package contents require a new version.

cd sdk/nodejs
npm run build
npm pack --dry-run
# Verify dist/index.js, declarations and the native binary list.
# Local builds contain only the addons you built; CI assembles the matrix.
shell5 lines · copy-ready

Python → PyPI

The workflow targets Python 3.8–3.13 wheels and a source distribution. The current engine does not support Python 3.14; the old published Windows 3.14 wheel is a different artifact. Wheel installation must be checked in a clean environment with the Python version and architecture you intend to support. The current local validation uses CPython 3.12 on Windows x64.

Configure a PyPI trusted publisher for the owner, repository, release.yml and environment pypi. GitHub supplies the publishing identity; a PyPI password is not stored in the repository. TestPyPI uses its own project and publisher configuration if you add a rehearsal upload.

cd sdk/python
python -m pip install maturin
maturin build --locked --release --out dist
maturin sdist --out dist
# In a fresh virtual environment, install the exact generated wheel path.
# Then run: python -c "from crawlingo import DatasetJob; print(DatasetJob)"
shell6 lines · copy-ready

Rust → crates.io

Inspect the crate contents and let Cargo compile the packaged source before uploading. The release workflow runs a dry run, then obtains a short-lived crates.io credential through GitHub OIDC in the crates-io environment for published releases. Configure the trusted publisher for owner Vamshavardhan50, repository crawlingo, workflow release.yml and environment crates-io. The workflow does not require a permanent registry token.

cargo package --locked --list
cargo publish --locked --dry-run
# After reviewing the artifact and signing in as a crate owner:
# cargo publish
shell4 lines · copy-ready

Confirm the installed release

  • Install from each registry in a fresh project, not from this checkout.
  • Run the local product example and verify accepted, duplicate and rejected counts.
  • Repeat the job to confirm resume; check the package reports the intended version.
  • Publish release notes listing tested OS/runtime combinations and link the scale methodology.
  • A registry upload cannot replace the contents of an existing version. Fix a bad artifact with a new version.

Retry an npm release safely

In the updated development workflow, select the explicit npm retry input and an existing release tag. The workflow resolves the tag once, builds every artifact from that pinned commit and checks the tag against the package version. A normal manual run with the retry input off is a build-only rehearsal.

When the workflow commit differs from the pinned release commit, the retry publishes without npm provenance rather than asserting that the workflow commit was the package source. If the release already has assets, the workflow leaves them untouched; review any missing files and their checksums before uploading manually.

These protections are local development changes until the workflow is committed and pushed. Registry releases cannot be overwritten: publish a new version for changed package contents.