tauri icon indicating copy to clipboard operation
tauri copied to clipboard

[feat] CLI command for versioning

Open RyKilleen opened this issue 3 years ago • 6 comments

Describe the problem

We use the very useful Tauri github action to auto build and draft release using semantic versioning.

It's really easy for me to forget a step when manually bumping versions. A normal flow looks lile

  • npm version (major | minor | patch)
  • cd src-tauri
  • cargo bump (major | minor | patch)
  • manually edit tauri.config.json
  • git commit --amend

Describe the solution you'd like

It'd be very nice to run npm run tauri version (major | minor | patch) and have the desired results!

Alternatives considered

It's quite possible I'm over-complicating things and half of this is no longer necessary in post v1.x.x world

Additional context

No response

RyKilleen avatar Jul 10 '22 15:07 RyKilleen

This would be a fun feature, but what's the use case for having 3 versions? Like do you need the all 3? If so, for what?

FabianLars avatar Jul 10 '22 15:07 FabianLars

I guess I just like keeping all the numbers in the configs in sync 😄 In my mind I guess it could be misleading to see different numbers in different configs.

tauri.config.json is the only one with any real effect here, so I suppose if the Tauri CLI handles just that then it's a great step!

RyKilleen avatar Jul 10 '22 16:07 RyKilleen

tauri.config.json already supports specifying a path to a package.json file as the version, and it will get the version number from the package.json

vdvman1 avatar Jul 14 '22 06:07 vdvman1

Could tauri.config.json also read from a Cargo.toml? That would be great

sinistersnare avatar Oct 07 '22 21:10 sinistersnare

@sinistersnare If you don't set any version (or path) in tauri.conf.json it will fall back to the version in Cargo.toml. Same for the name btw.

FabianLars avatar Oct 07 '22 21:10 FabianLars

Oh nice! This behavior isnt mentioned in the docs. Thanks for saying!

sinistersnare avatar Oct 07 '22 21:10 sinistersnare

Hi, are you happy with the mentioned behaviour for your use case or do you think a version command would be helpful?

Zercerium avatar Jul 04 '23 12:07 Zercerium

Can you assign me to this?

gorentbarak avatar Oct 14 '23 17:10 gorentbarak

@gorentbarak, you can work on something for this and then mention this issue in a draft pr.

ahadley1124 avatar Oct 31 '23 04:10 ahadley1124

I made a tool to achieve that , see tauri-version. And I have used it to release a version of my own tauri-app, see example in lethal-company-mods-copier v0.0.5 release

s3xysteak avatar Mar 10 '24 08:03 s3xysteak

I made a tool to achieve that , see tauri-version. And I have used it to release a version of my own tauri-app, see example in lethal-company-mods-copier v0.0.5 release

tauri.conf.json + Cargo.toml + package.json npx tauri-version patch : 0.0.2 -> 0.0.3 npx tauri-version patch -m release: v%s : commit with message "release: v0.0.3" which default if "0.0.3"

s3xysteak avatar Mar 11 '24 14:03 s3xysteak

I'm closing this issue to avoid noise because:

@sinistersnare If you don't set any version (or path) in tauri.conf.json it will fall back to the version in Cargo.toml. Same for the name btw.

This fits my use case. Thanks!

RyKilleen avatar Mar 11 '24 15:03 RyKilleen