topgrade-rs / topgrade

Upgrade all the things
GNU General Public License v3.0
2.03k stars 139 forks source link

[Feature] upload the app to the fedora repository and other distros #157

Open Heus-Sueh opened 2 years ago

Heus-Sueh commented 2 years ago

copying the file to the bin folder is not safe as the user needs root and may end up deleting files from the system


Updates from maintainers:

Current progress:

s34m commented 2 years ago

Distro native Installation is a bit tricky because of having to update and manage a lot of packages. Maybe if someone wants to maintain it. In the meantime you can also install topgrade using cargo.

LeSnake04 commented 1 year ago

This might be usefull https://lib.rs/crates/cargo-generate-rpm

LeSnake04 commented 1 year ago

If the tool works I can submit it (I've got a fedora laptop and can use distrobox to maintain it from my arch install on my main pc)

Can you tell me what are the know system requirements (including basic ones like ssh / gpg etc)

s34m commented 1 year ago

If the tool works I can submit it (I've got a fedora laptop and can use distrobox to maintain it from my arch install on my main pc)

I have a RHEL install so I could try it out too.

Can you tell me what are the know system requirements (including basic ones like ssh / gpg etc) Easiest thing would be to install it in a VM/Docker container and install dependencies till it compiles. Or compile it and look to which dependencies it links back. Can't give you an exact list.

LeSnake04 commented 1 year ago

Also, the tool says it detects the requirements

LeSnake04 commented 1 year ago

test.zip A quick test gave me this.

It looks pretty good IMO. Seems to work already.

LeSnake04 commented 1 year ago

The things i changed:

 diff --git a/Cargo.toml b/Cargo.toml
index 63c321c..55cb75c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -3,6 +3,7 @@ name = "topgrade"
 description = "Upgrade all the things"
 categories = ["os"]
 keywords = ["upgrade", "update"]
+license = "GPL-3.0"
 license-file = "LICENSE"
 repository = "https://github.com/topgrade-rs/topgrade"
 version = "10.1.2"
@@ -19,6 +20,9 @@ path = "src/main.rs"
 ##[lib]
 ##name = "topgrade_lib"

+[package.metadata.generate-rpm]
+assets = [{source = "target/release/topgrade", dest="/usr/bin/topgrade"}]
+
 [dependencies]
 home = "~0.5"
 directories = "~4.0"
~

Then ran:

cargo generate-rpm -o test.rpm
LeSnake04 commented 1 year ago

This looks like it could easily be integrated in CI

LeSnake04 commented 1 year ago

test.zip A quick test gave me this.

It looks pretty good IMO. Seems to work already.

@Heus-Sueh can you test please?

LeSnake04 commented 1 year ago

looks like the tool found no dependencies.

LeSnake04 commented 1 year ago

And with deb it looks quite similar: https://crates.io/crates/cargo-deb

Heus-Sueh commented 1 year ago

test.zip A quick test gave me this.

It looks pretty good IMO. Seems to work already.

@Heus-Sueh can you test please?

i can't test now, when i get home i will test

LeSnake04 commented 1 year ago

test_ubuntu.zip And here an ubuntu build made with cargo-deb (no cargo.toml modifications or extra options)

LeSnake04 commented 1 year ago

If the builds don't work, try installing "mold". I use it for faster builds on my systems.

For proper builds I will of course disable it or even better, its integrated into the release workflow.

Heus-Sueh commented 1 year ago

@LeSnake04 Sorry for the delay, I just tested the rpm package and it worked apparently

Heus-Sueh commented 1 year ago

image image

LeSnake04 commented 1 year ago

@DottoDev I can push the cargo.toml rpm configuration, otherwise the workflows just need to install and run cargo-deb and cargo-generate-rpm on release

Then we just need to get in contact with the official repos. Since I use fedora, I can be the contact for the fedora repos:

Tracker for offers of ownership:

LeSnake04 commented 1 year ago

I added git as dependency since its integrated without checks and causes error if not installed.

s34m commented 1 year ago

178

Looks good for me. If you want you(@LeSnake04 )can get in contact with fedora to hopefully include it in the main repo or else maybe into rpm fusion.

LeSnake04 commented 1 year ago

Until it gets put in the repos, it might make sense to publish the rpm/deb via workflows + releases

SteveLauC commented 2 months ago

Updates for the Debian or other Debian-based distros, once #898 is merged, we will have .deb files (x86_64 and aarch64) included in the release assets!