DEV Community

Cover image for Tauri - How to easily bump version
Brian Ng
Brian Ng

Posted on

Tauri - How to easily bump version

When performing tauri builds, we would want to bump the version up for every build.

Please note that you can disregard using the version prop in tauri.conf.json file, as the build version will fallback to the Cargo.toml version value.

Thankfully, we have an awesome cargo we could use, cargo-bump (https://crates.io/crates/cargo-bump).

Installation

  1. In your tauri project, go to src-tauri folder.
  2. Next, install the cargo like cargo install cargo-bump.
  3. Once cargo installation has been completed, you can now bump the version up such as cargo bump.

Examples of using cargo bump

Increment the patch version: cargo bump or cargo bump patch
Increment the minor version: cargo bump minor
Set the version number directly: cargo bump 1.0.1

For updated usage examples, please see https://crates.io/crates/cargo-bump

Before Cargo.toml

[package]
name = "my-tauri-app"
version = "1.0.0"

...
Enter fullscreen mode Exit fullscreen mode

After Cargo.toml

[package]
name = "my-tauri-app"
version = "1.0.1"

...
Enter fullscreen mode Exit fullscreen mode

That's it!

All done, your Cargo.toml file should have version = "1.0.0" updated. Happy coding!

I recommend learning Rust, it is a powerful programming language, with a suite of cargo libraries. I've been enjoying Rust when developing Tauri applications.

Top comments (2)

Collapse
 
1oglop1 profile image
Jan Gazda

As awesome as it is, I'd worried about using something that has received a last commit 5 years ago.

Collapse
 
brifiction profile image
Brian Ng

I agree cause what you said is true - it is a simple crate made by the author to easily update the Cargo.toml. I found this crate to satisfy a temporary convenience.

And there are other ways to achieve this "bump version need", such as utilising bash scripting, which I did implement before learning about cargo-bump crate existence. But of course, the written bash script was for local use only and was not ready for CI/CD use.

Bonus, I think there's a new contender in town, see crates.io/crates/cargo-edit#cargo-... and try out set-version command. I'll try this crate out when I am free, as reading I am unsure if it meant set-version for a dependency installed or the version = "1.0.1" (example).