Extras
Contributor notes for SimpleBLE, covering how to build and preview this documentation site and the checklist for preparing, tagging and publishing a release.
Building documentation
The documentation for SimpleBLE is built using Fumadocs, a Next.js-based documentation framework.
Prerequisites
- Node.js 20.9+ or Bun
- npm, pnpm, or bun package manager
Installation
First, install the dependencies:
cd <path-to-repository>/docs
npm install
# or
bun installDevelopment
To run the documentation site in development mode with hot reload:
npm run dev
# or
bun devThe documentation will be available at http://localhost:3000.
Building for Production
To build the documentation for production:
npm run build
# or
bun run buildTo preview the production build locally:
npm run start
# or
bun startContent Structure
- Content files: Located in
docs/content/docs/ - Components: Located in
docs/src/components/ - API documentation: Generated using custom React components in
docs/src/components/api/
Documentation is written in MDX (Markdown with JSX), allowing you to use React components within your documentation.
Release checklist
The tag of a published GitHub release sets the version of every package that release publishes. Between releases, VERSION names the next release with a -dev suffix, such as 1.3.1-dev, so local builds never carry a published version. CI builds replace the suffix with -dev.N, where N counts the commits since the last tag.
Perform the following steps in order.
Prepare the release
-
Ensure content parity between all readmes and the documentation.
README.rstLICENSE.mdsimpleaible/README.mdsimpledartble/README.mdsimpledelphible/README.mdsimplefltble/README.mdsimpledroidble/README.mdsimplegoble/README.mdsimplejavable/README.mdsimplejsble/README.mdsimplektble/README.mdsimplepyble/README.mdsimplernble/README.mdsimplersble/README.mdsimplesharpble/README.mdsimpleswiftble/README.md
-
Set the release version:
- Remove the
-devsuffix inVERSION,Cargo.toml,Cargo.lock,simpleaible/pyproject.toml,simpledartble/pubspec.yaml, andsimplefltble/pubspec.yaml, including itssimpledartbledependency. - In
docs/content/docs/changelog.mdx, give the release's section its version and date.
For a minor or major release, such as
1.4.0while these files name1.3.1-dev, use its version instead, and search the repository for the previous version withgit grepto catch references such as migration guides. - Remove the
-
Run the Hardware In The Loop tests listed below.
-
Run the pre-release checks from the repository root:
./scripts/check_version.sh cargo build (cd docs && npm run types:check && npm run build) -
Commit and push the release changes, and wait for the branch-triggered
CI Mainworkflow to finish successfully. Like everymainpush, it publishes development packages:X.Y.Z-dev.Nto crates.io, Maven Central, and NuGet,X.Y.Z.devNto PyPI,X.Y.Z-dev.Nto npm under thedevtag, andvX.Y.Z-dev.Ntags tosimpleble/simpleswiftble,simpleble/simplegoble, andsimpleble/simpledelphible.gh run list -R simpleble/simpleble --workflow ci_main.yml --event push --commit <commit> gh run watch <run-id> -R simpleble/simpleble --interval 60 --exit-statusEvery publish job waits for every build job, so one failed build skips all publication. If a job fails for a reason unrelated to the release, such as an interrupted Android SDK download, an error pulling a manylinux image, or a timeout uploading an artifact, use Re-run failed jobs on that run, or
gh run rerun <run-id> -R simpleble/simpleble --failed. It also runs the jobs the failure skipped.
Publish the release
-
Copy the version's changelog section, from its
## [X.Y.Z]heading up to the previous version's, into a file outside the repository. The release notes are that copy and nothing else. Then create and publish a stable GitHub release whose new tagvX.Y.Zpoints at that commit:gh release create vX.Y.Z -R simpleble/simpleble --target <commit> --title "SimpleBLE vX.Y.Z" --notes-file <notes>A draft does not trigger publication, and the release must not be marked as a prerelease. The command creates the tag, so don't push it beforehand: a tag push starts no workflow, and
--targetis ignored for an existing tag. -
Wait for the release-triggered
CI Mainworkflow to finish. It builds every package from the tag, attaches the artifacts to the release, and publishes the stable packages. Itspublish-simpledartblejob runsPublish SimpleDartBLEon the tag, as pub.dev only accepts uploads from runs on a tag, and waits for it to upload SimpleDartBLE and SimpleFltBLE.gh run list -R simpleble/simpleble --workflow ci_main.yml --event release --limit 1 gh run watch <run-id> -R simpleble/simpleble --interval 60 --exit-status gh run view <run-id> -R simpleble/simpleble --log-failed- Do not cancel it, unpublish and republish the release, or run
CI Mainmanually on the tag. Runs for the tag cancel each other. Editing the release notes is safe. - If a job fails, use Re-run failed jobs, never Re-run all jobs. PyPI, NuGet, npm, and pub.dev skip versions that already exist, and the SimpleGoBLE, SimpleSwiftBLE, and SimpleDelphiBLE jobs skip tags that already exist, but crates.io and Maven Central reject an existing version, so repeating their publish jobs after they succeeded fails.
- If only the pub.dev upload failed, run
gh workflow run publish_simpledartble.yml -R simpleble/simpleble --ref vX.Y.Z.
- Do not cancel it, unpublish and republish the release, or run
-
Verify the published release by running the following in bash with its version. Every line should name
X.Y.Z, with the GitHub release neither a draft nor a prerelease and without development filenames, crates.ioyanked=false, Maven CentralHTTP 200, and npm'slatesttag on the release:V=X.Y.Z gh release view "v$V" -R simpleble/simpleble --json isDraft,isPrerelease,assets --jq '"GitHub release: draft=\(.isDraft) prerelease=\(.isPrerelease) assets=\(.assets | length) dev-named=\([.assets[].name | select(test("dev"))] | length)"' for p in simplepyble simpleaible; do echo "PyPI $p: $(curl -s https://pypi.org/pypi/$p/$V/json | jq -r '"\(.info.version // "missing") (\(.urls | length) files)"')"; done echo "crates.io simplersble: $(curl -s -A simpleble-release-check https://crates.io/api/v1/crates/simplersble/$V | jq -r '.version | "\(.num // "missing") yanked=\(.yanked)"')" for a in simplejavable simpledroidble simpledroidbridge simplektble; do echo "Maven Central $a: HTTP $(curl -s -o /dev/null -w '%{http_code}' https://repo1.maven.org/maven2/org/simpleble/$a/$V/)"; done echo "NuGet SimpleSharpBLE: $(curl -s https://api.nuget.org/v3-flatcontainer/simplesharpble/index.json | jq -r --arg v "$V" 'if (.versions | index($v)) then $v else "not listed yet" end')" for p in simplejsble simplernble; do echo "npm $p: $(curl -s https://registry.npmjs.org/$p | jq -r '."dist-tags" | "latest=\(.latest) dev=\(.dev)"')"; done echo "Go proxy simplegoble: $(curl -s https://proxy.golang.org/github.com/simpleble/simplegoble/@v/v$V.info)" for r in simpleswiftble simpledelphible; do echo "$r: $(gh api repos/simpleble/$r/releases/tags/v$V --jq '"\(.tag_name) prerelease=\(.prerelease) assets=\([.assets[].name] | join(","))"')"; done for p in simpledartble simplefltble; do echo "pub.dev $p: $(curl -s https://pub.dev/api/packages/$p/versions/$V | jq -r '.version // "missing"')"; doneMaven Central and NuGet can take 15 minutes or more to list a new version after its publish job succeeds. Check again later rather than rerunning the job.
-
Replace references to development builds outside this repository now that the stable packages are available, such as the SimplePyBLE version pinned by the Dongl quickstart on simpleble.org. Search sibling checkouts for
.devN,-dev.N, and-devNpins, and deploy any site that changes. -
Start the next version: set the files from step 2 to the next patch version with a
-devsuffix, such as1.3.1-dev, add an empty section for it to the changelog, check them with./scripts/check_version.sh, and commit and push them. Until then,CI Mainfails on every new commit, asVERSIONstill names a released version. -
From the documentation root, run
berth app deployto deploy the documentation, as pushing tomaindoesn't update it.berth app statusshows the running image. Berth builds alinux/amd64image with Docker, which on an Apple silicon Mac needs 32 GB of memory for Docker's VM: with Docker Desktop's default of about 8 GB, the build fails with loader timeouts.
Hardware In The Loop - Recommended Tests
- Attempt connecting while already connected.
- Attempt disconnecting while not connected.
Documentation Structure Guide
When adding documentation for new components or language bindings, follow this standardized structure to ensure consistency and a high-quality onboarding experience:
- Usage: Detail installation, system requirements, and how to include the library in a project (CMake, package managers, etc.).
- Platform Notes: Document OS-specific behaviors, limitations, and quirks. This is critical for Bluetooth-related components.
- Tutorial: Provide a narrative, step-by-step guide that takes the user from a basic "Hello World" (e.g., listing adapters) to more advanced interactions (scanning, connecting, reading/writing).
- API Reference: Use the
<ApiSection>,<ApiClass>, and<ApiMethod>components to provide technical details for every public class and method. - Examples: Provide a curated list of use-cases with descriptions and direct links to the source code in the repository.
- FAQ: Address common questions, troubleshooting steps, and platform-specific nuances that don't fit in the tutorial.
Changelog
Release history of SimpleBLE and its bindings, listing the new features, bug fixes and breaking changes in each version together with its release date.
Learn Bluetooth Low Energy: Free BLE Course
A free, hands-on Bluetooth Low Energy course. Every lesson runs on your own computer, with working code in 12 languages and no hardware to buy.
