Skip to content
Latchkey

How to Release Non-JS Monorepos: Cargo, Go, and Maven

The monorepo release idea (bump, tag, publish only what changed) applies beyond npm: Cargo, Go modules, and Maven each have workspace-aware release tooling.

Rust workspaces publish crates with cargo publish per member, often via cargo-release. Go multi-module repos version each module with its own module/vX.Y.Z tag. Maven multi-module builds bump with the versions plugin and deploy the reactor.

Rust (Cargo workspace)

Terminal
# cargo-release bumps + tags + publishes workspace crates in order
cargo release --workspace --execute minor

# Or publish a single member crate
cargo publish -p acme-core

Go (multi-module)

Terminal
# Each module is versioned by its own path-prefixed tag
git tag core/v1.4.0
git tag api/v0.9.1
git push --tags
# Consumers: go get example.com/repo/core@v1.4.0

Maven (multi-module)

Terminal
# Set the version across the reactor, then deploy all modules
mvn versions:set -DnewVersion=2.4.0 -DprocessAllModules=true
mvn -B deploy

Gotchas

  • Cargo publishes crates in dependency order and will not publish a crate whose dependency version is not yet on crates.io.
  • Go module tags must be path-prefixed (module/vX.Y.Z) or go get cannot resolve the submodule version.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →