Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: make SelfUpdate a step #585

Merged
merged 2 commits into from
Oct 18, 2023
Merged

Conversation

SteveLauC
Copy link
Member

Standards checklist:

  • The PR title is descriptive.
  • I have read CONTRIBUTING.md
  • The code compiles (cargo build)
  • The code passes rustfmt (cargo fmt)
  • The code passes clippy (cargo clippy)
  • The code passes tests (cargo test)
  • Optional: I have tested the code myself

For new steps

  • Optional: Topgrade skips this step where needed
  • Optional: The --dry-run option works with this step
  • Optional: The --yes option works with this step if it is supported by
    the underlying command

If you developed a feature or a bug fix for someone else and you do not have the
means to test it, please tag this person here.

What does this PR do

Make self_update a step

$ cargo b --features self-update -q

$ ./target/debug/topgrade  --only self_update

── 12:14:01 - Self update ──────────────────────────────────────────────────────
Checking target-arch... x86_64-unknown-linux-gnu
Checking current version... v10.0.2
Checking latest released version... v12.0.2
New release found! v10.0.2 --> v12.0.2
New release is *NOT* compatible

topgrade release status:
  * Current exe: "/tmp/topgrade/target/debug/topgrade"
  * New exe release: "topgrade-v12.0.2-x86_64-unknown-linux-gnu.tar.gz"
  * New exe download url: "https://api.github.com/repos/topgrade-rs/topgrade/releases/assets/118492348"

The new release will be downloaded/extracted and the existing binary will be replaced.
Downloading...
[00:00:01] [========================================] 5.54MiB/5.54MiB (0s) Done
Extracting archive... Done
Replacing binary file... Done

Topgrade upgraded to 12.0.2:

@SteveLauC SteveLauC mentioned this pull request Oct 18, 2023
4 tasks
@SteveLauC SteveLauC merged commit a2fbe92 into topgrade-rs:main Oct 18, 2023
@SteveLauC SteveLauC deleted the self_update branch October 18, 2023 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant