Skip to content

Conversation

@goulvenclech
Copy link
Member

@goulvenclech goulvenclech commented Dec 20, 2025

Add sampo update command to self-update the CLI from GitHub Releases. Only stable versions are proposed by default, use --pre to include pre-releases (alpha, beta, rc).

What has changed?

  • crates/sampo/Cargo.toml: Added self_update dependency with archive and compression features.
  • crates/sampo/src/cli.rs: Added Update command with --yes (skip confirmation) and --pre (include pre-releases) flags.
  • crates/sampo/src/update.rs: New module that fetches releases, filters stable versions by default, and performs binary replacement.
  • crates/sampo/src/version_check.rs: Switched from crates.io to GitHub Releases to align version hints with sampo update availability.
  • crates/sampo/src/main.rs: Integrated update command handler and changed version hint to suggest sampo update.
  • crates/sampo/src/ui.rs: Added log_info function for neutral informational messages.

How is it tested?

  • crates/sampo/src/cli.rs: Unit tests for parsing sampo update and sampo update --yes.
  • crates/sampo/src/update.rs: Unit tests for version parsing from tags and release filtering logic.

How is it documented?

  • crates/sampo/README.md: Documented sampo update in the Commands table.

@goulvenclech goulvenclech self-assigned this Dec 20, 2025
@sampo-s-bot
Copy link

sampo-s-bot bot commented Dec 20, 2025

🧭 Changeset detected

Merging this PR will release the following updates:

sampo (Cargo) — minor version bump

Minor changes

  • Add sampo update command to self-update the CLI from GitHub Releases. By default, only stable versions are proposed, use --pre to include pre-releases (alpha, beta, rc).

@github-actions github-actions bot added documentation Improvements or additions to documentation dependencies WIP. crt:sampo Changes in Sampo CLI crate. devops wip labels Dec 20, 2025
Copy link
Member

@Princesseuh Princesseuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine. I don't know the self-update crate so I can't tell if it has specific needs or anything. Some other tools call this command self-update instead which might be worth it to avoid conflicting with a future command, not sure

@goulvenclech
Copy link
Member Author

Looks fine. I don't know the self-update crate so I can't tell if it has specific needs or anything. Some other tools call this command self-update instead which might be worth it to avoid conflicting with a future command, not sure.

Thanks for bringing that up but, after thinking through it, I still prefer update. It’s more intuitive and easier to remember, even if I agree it’s a bit less explicit.

Also, I don’t expect it to clash with a future command, we generally use « bump » / « version bump » for versioning « update ».

@goulvenclech goulvenclech merged commit 570729b into main Dec 20, 2025
7 checks passed
@goulvenclech goulvenclech deleted the sampo-update branch December 20, 2025 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

crt:sampo Changes in Sampo CLI crate. dependencies WIP. devops wip documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants