From ac331a914e3988a721e120470bcbf15bf2770023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Misty=20De=20M=C3=A9o?= Date: Tue, 19 Mar 2024 14:04:25 -0700 Subject: [PATCH 1/4] doc: add updater docs --- book/src/SUMMARY.md | 1 + book/src/installers/updater.md | 30 ++++++++++++++++++++++++++++++ book/src/reference/config.md | 17 +++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 book/src/installers/updater.md diff --git a/book/src/SUMMARY.md b/book/src/SUMMARY.md index f88cb26c8..ee8092a7c 100644 --- a/book/src/SUMMARY.md +++ b/book/src/SUMMARY.md @@ -12,6 +12,7 @@ - [npm](./installers/npm.md) - [homebrew](./installers/homebrew.md) - [msi](./installers/msi.md) + - [updater](./installers/updater.md) - [Artifacts](./artifacts/index.md) - [archives](./artifacts/archives.md) - [checksums](./artifacts/checksums.md) diff --git a/book/src/installers/updater.md b/book/src/installers/updater.md new file mode 100644 index 000000000..4079c877f --- /dev/null +++ b/book/src/installers/updater.md @@ -0,0 +1,30 @@ +# Self-updater + +> since 0.12.0 + +NOTE: This feature is currently experimental. + +Ordinarily, your users will need to visit your website and download an installer for the latest release in order to upgrade. Users who installed your software via a package manager, like Homebrew and npm, can use that package manager to upgrade to the latest release. For users of the [shell] and [PowerShell] installers, you can provide your users with a standalone installation program to upgrade more conveniently. + +If you add `install-updater = true` to your `Cargo.toml`, cargo-dist's shell and PowerShell installers will include an updater program alongside your program itself. This standalone program will be installed as the name `yourpackage-update`, and users can simply run it to poll for new releases and have them installed. The source code for this program is open source in the [axoupdater] repository. + +Users will interact with this updater by running the `yourpackage-update` command. It takes no options or arguments, and will automatically perform an upgrade without further input from the user. If your program supports custom external subcommands via the executable naming structure, like `git` and `cargo` do, then your user can also run `yourpackage update`. Here's a sample `axolotlsay-update` session as a demonstration of what your users will experience: + +``` +$ axolotlsay-update +Checking for updates... +downloading axolotlsay 0.2.114 aarch64-apple-darwin +installing to /Users/mistydemeo/.cargo/bin + axolotlsay + axolotlsay-update +everything's installed! +New release installed! +``` + +If you would prefer to handle polling for updates yourself, for example in order to incorporate it as an internal subcommand of your own software, axoupdater is available as a [crate] which can be used as a library within your program. More information about how to use axoupdater as a library in your own program can be found in its README and in its [API documentation][axoupdater-docs]. + +[axoupdater]: https://github.com/axodotdev/axoupdater +[axoupdater-docs]: https://docs.rs/axoupdater/ +[crate]: https://crates.io/crates/axoupdater +[shell]: ../shell.md +[PowerShell]: ../powershell.md diff --git a/book/src/reference/config.md b/book/src/reference/config.md index e5d39c1f8..8b19b2572 100644 --- a/book/src/reference/config.md +++ b/book/src/reference/config.md @@ -459,6 +459,21 @@ Future Improvements: (Please file an issue if you have other requirements!) +### install-updater + +> since 0.12.0 + +Example: `install-updater = true` + +Defaults to false. + +NOTE: this feature is currently experimental. + +Determines whether to install a standalone updater program alongside your program. This program will be named `yourpackage-update`, and can be run by the user to automatically check for newer versions and install them without needing to visit your website. This updater will only be installed for users who use the shell or Powershell installers; users who received your package from a package manager, such as Homebrew or npm, will need to use the same package manager to perform upgrades. + +This updater is the commandline tool contained in the open source [axoupdater] package. + +For more information, see the [updater] documentation. ### local-artifacts-jobs @@ -734,3 +749,5 @@ Caveat: the default "host" Artifact Mode does something fuzzier with `--target` [platforms]: https://doc.rust-lang.org/nightly/rustc/platform-support.html [scope]: https://docs.npmjs.com/cli/v9/using-npm/scope [crt-static]: https://github.com/rust-lang/rfcs/blob/master/text/1721-crt-static.md#future-work +[axoupdater]: https://github.com/axodotdev/axoupdater +[updater]: ../installers/updater.md From 7b6ea7d321a54b5a4f9b5f3d6a323a37f19d81f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Misty=20De=20M=C3=A9o?= Date: Thu, 21 Mar 2024 14:42:55 -0700 Subject: [PATCH 2/4] release: 0.12.0 --- CHANGELOG.md | 44 ++++++++++++++++++++++++++++++++++++ Cargo.lock | 4 ++-- cargo-dist-schema/Cargo.toml | 2 +- cargo-dist/Cargo.toml | 4 ++-- 4 files changed, 49 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e334e4964..2d44d1757 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,50 @@ Nothing Yet! +# Version 0.12.0 (2024-03-21) + +This release introduces an experimental new feature: an updater which allows your users to install new releases without having to go download a new installer themselves. It also includes a few other bugfixes and improvements. + +## Features + +### cargo-dist updater + +The new cargo-dist updater, [axoupdater](https://github.com/axodotdev/axoupdater), provides a way for your users to easily upgrade your software without needing to check your website for new versions. If you enable the new `install-updater = true` option in cargo-dist, users who install your software via the shell or PowerShell installers will receive a standalone updater program alongside your program itself. Running this program will check for updates and, if necessary, install the new version for them. In addition, axoupdater provides a Rust library with all of its functionality exposed so that you can choose to integrate the updater functionality into your own program directly. + +For more information, see the [cargo-dist documentation](https://opensource.axo.dev/cargo-dist/book/installers/updater.html) or consult the axoupdater repository and [documentation](http://docs.rs/axoupdater/latest/axoupdater/). + +### Homebrew cask dependencies + +Homebrew cask dependencies can now be installed. + +* impl @mistydemeo [feat: support cask deps for Homebrew](https://github.com/axodotdev/cargo-dist/pull/855) + +### PowerShell installer tests + +We now run PowerShell installers end to end in cargo-dist's own tests. + +* impl @Gankra [chore: add ruin_me powershell tests](https://github.com/axodotdev/cargo-dist/pull/862) + +### Invoke `rustup target add` for additional forms of cross-compiling + +We now run `rustup target add` unconditionally when cross-compiling; before, this was limited to macOS or for musl Linux. This is primarily useful for targeting Windows ARM, but may be useful for other cross-compilation targets in the future. + +* impl @AustinWise [feat: always rustup target add in cross](https://github.com/axodotdev/cargo-dist/pull/846) + +### Allow overriding install path in shell and PowerShell installers + +Although some installer configuration allows setting the installation path, there was previously no way to force the installer to install to a location of the user's choosing. We've added a feature to do so via the new `CARGO_DIST_FORCE_INSTALL_DIR` environment variable. + +This is primarily intended for cargo-dist's internal use, and is used by the updater to ensure that new releases are installed in the same location as the previous version; other users may find it useful. + +* impl @mistydemeo [feat: allow overriding install path](https://github.com/axodotdev/cargo-dist/pull/837) + +## Fixes + +* @mistydemeo [fix install path in install receipts in certain circumstances](https://github.com/axodotdev/cargo-dist/pull/863) +* @Gankra [fix: for reals reals utf8 for reals FOR REALS](https://github.com/axodotdev/cargo-dist/pull/852) +* @kbattocchi [feat: enable fallback to x64 in Invoke-Installer](https://github.com/axodotdev/cargo-dist/pull/835) + # Version 0.11.1 (2024-02-23) This release is a few minor improvements, and a new config for homebrew installers. diff --git a/Cargo.lock b/Cargo.lock index 9c170ffbe..2fa011d6e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -409,7 +409,7 @@ dependencies = [ [[package]] name = "cargo-dist" -version = "0.12.0-prerelease.1" +version = "0.12.0" dependencies = [ "axoasset 0.8.0", "axocli", @@ -451,7 +451,7 @@ dependencies = [ [[package]] name = "cargo-dist-schema" -version = "0.12.0-prerelease.1" +version = "0.12.0" dependencies = [ "camino", "gazenot", diff --git a/cargo-dist-schema/Cargo.toml b/cargo-dist-schema/Cargo.toml index 6204c01a1..01f5dc59c 100644 --- a/cargo-dist-schema/Cargo.toml +++ b/cargo-dist-schema/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "cargo-dist-schema" description = "Schema information for cargo-dist's dist-manifest.json" -version = "0.12.0-prerelease.1" +version = "0.12.0" edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/axodotdev/cargo-dist" diff --git a/cargo-dist/Cargo.toml b/cargo-dist/Cargo.toml index 6d971b1fb..10153cc38 100644 --- a/cargo-dist/Cargo.toml +++ b/cargo-dist/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "cargo-dist" description = "Shippable application packaging for Rust" -version = "0.12.0-prerelease.1" +version = "0.12.0" edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/axodotdev/cargo-dist" @@ -34,7 +34,7 @@ axocli = { version = "0.2.0", optional = true } # Features used by the cli and library axotag = "0.1.0" -cargo-dist-schema = { version = "=0.12.0-prerelease.1", path = "../cargo-dist-schema" } +cargo-dist-schema = { version = "=0.12.0", path = "../cargo-dist-schema" } axoasset = { version = "0.8.0", features = ["json-serde", "toml-serde", "toml-edit", "compression"] } axoprocess = { version = "0.2.0" } From b3d406da926c2e4a9cf5cbec9325058b95edc7cb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Mar 2024 10:10:15 +0000 Subject: [PATCH 3/4] chore(deps): bump temp-dir from 0.1.12 to 0.1.13 Bumps [temp-dir](https://gitlab.com/leonhard-llc/ops) from 0.1.12 to 0.1.13. - [Commits](https://gitlab.com/leonhard-llc/ops/compare/temp-dir-v0.1.12...temp-dir-v0.1.13) --- updated-dependencies: - dependency-name: temp-dir dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- cargo-dist/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2fa011d6e..11e5e6dfa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2770,9 +2770,9 @@ dependencies = [ [[package]] name = "temp-dir" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd16aa9ffe15fe021c6ee3766772132c6e98dfa395a167e16864f61a9cfb71d6" +checksum = "1f227968ec00f0e5322f9b8173c7a0cbcff6181a0a5b28e9892491c286277231" [[package]] name = "tempfile" diff --git a/cargo-dist/Cargo.toml b/cargo-dist/Cargo.toml index 10153cc38..aa9a6d1d1 100644 --- a/cargo-dist/Cargo.toml +++ b/cargo-dist/Cargo.toml @@ -62,7 +62,7 @@ mach_object = "0.1" goblin = "0.8.0" similar = "2.4.0" tokio = { version = "1.36.0", features = ["full"] } -temp-dir = "0.1.12" +temp-dir = "0.1.13" [dev-dependencies] insta = { version = "1.36.1", features = ["filters"] } From 23ee6948b1672a7f8e9e9a3470cb8f923c95a9ac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 10:59:45 +0000 Subject: [PATCH 4/4] chore(deps): bump minijinja from 1.0.14 to 1.0.15 Bumps [minijinja](https://github.com/mitsuhiko/minijinja) from 1.0.14 to 1.0.15. - [Changelog](https://github.com/mitsuhiko/minijinja/blob/main/CHANGELOG.md) - [Commits](https://github.com/mitsuhiko/minijinja/compare/1.0.14...1.0.15) --- updated-dependencies: - dependency-name: minijinja dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- cargo-dist/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2fa011d6e..e80236b76 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1679,9 +1679,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "minijinja" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe5b00f90b3542f74bb9aaaccd2627920c16367787de103883461365580e5481" +checksum = "57be929672ea2de446d39b3626c1cd1e55bd1db40f90ebee28d242a3d6baa65f" dependencies = [ "aho-corasick", "memo-map", diff --git a/cargo-dist/Cargo.toml b/cargo-dist/Cargo.toml index 10153cc38..a4505d5ba 100644 --- a/cargo-dist/Cargo.toml +++ b/cargo-dist/Cargo.toml @@ -53,7 +53,7 @@ semver = "1.0.22" newline-converter = "0.3.0" dialoguer = "0.11.0" sha2 = "0.10.6" -minijinja = { version = "1.0.14", features = ["debug", "loader", "builtins", "json", "custom_syntax"] } +minijinja = { version = "1.0.15", features = ["debug", "loader", "builtins", "json", "custom_syntax"] } include_dir = "0.7.3" itertools = "0.12.1" cargo-wix = "0.3.8"