From 7ec002ba4476276a4f5a49ed9d3e4b6cf6a53928 Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Wed, 5 Jun 2024 13:25:01 +0100 Subject: chore: switch to cargo dist for releases (#2085) * chore: switch to cargo dist for releases From https://axo.dev cargo-dist handles building releases far better than we can, and do so for several large projects now. We will need to change our install script to use the cargo-dist installer. Historically, we have used the system package manager wherever possible. Once switched to the new installer, this will no longer be the case. If the user wishes to use their package manager, and Atuin is maintained there, then they can choose to do so. This way, we can ensure that users are running a known build, can easily uninstall (just delete the atuin dir), easily update, etc. Builds will use our lockfile, and can have their checksum verified. Later, I'd like to introduce build signing. As Axo are focused on release engineering, they will likely have resolved many more issues than we have - libc versions, etc. I'm not particularly happy with our response of "just use your package manager", as many users seem to have difficulty there. It's unclear what our installer has done, as this behaviour varies massively across systems. It's also unclear how some package maintainers may have patched things I'm hoping that some better release tooling will lead to more confidence in the process, and therefore more frequent releases. Uninstall clarity: #111, #372, #640, #1485, #1546, #2049, #1529 * config * add protobuf * test build * use native arm mac * lol * add toolchain * use 1.78, 2vcpu * nix flake update * 1.77 --- Cargo.toml | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) (limited to 'Cargo.toml') diff --git a/Cargo.toml b/Cargo.toml index dd0aa6ca..9b01e4d4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ exclude = ["ui/backend"] [workspace.package] version = "18.2.0" authors = ["Ellie Huxtable "] -rust-version = "1.74" +rust-version = "1.77" license = "MIT" homepage = "https://atuin.sh" repository = "https://github.com/atuinsh/atuin" @@ -55,3 +55,43 @@ default-features = false [workspace.dependencies.sqlx] version = "0.7" features = ["runtime-tokio-rustls", "time", "postgres", "uuid"] + +# Config for 'cargo dist' +[workspace.metadata.dist] +# The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax) +cargo-dist-version = "0.15.0" +# CI backends to support +ci = "github" +# The installers to generate for each app +installers = ["shell"] +# Target platforms to build apps for (Rust target-triple syntax) +targets = [ + "aarch64-apple-darwin", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "x86_64-apple-darwin", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", +] +# Publish jobs to run in CI +pr-run-mode = "upload" +# Whether to install an updater program +install-updater = true +# The archive format to use for non-windows builds (defaults .tar.xz) +unix-archive = ".tar.gz" + +# The profile that 'cargo dist' will build with +[profile.dist] +inherits = "release" +lto = "thin" + +[workspace.metadata.dist.github-custom-runners] +aarch64-apple-darwin = "macos-14" +aarch64-unknown-linux-gnu = "buildjet-2vcpu-ubuntu-2204-arm" +aarch64-unknown-linux-musl = "buildjet-2vcpu-ubuntu-2204-arm" + +[workspace.metadata.dist.dependencies.homebrew] +protobuf = '*' + +[workspace.metadata.dist.dependencies.apt] +protobuf-compiler = '*' -- cgit v1.3.1