Skip to content

Commit

Permalink
Merge branch 'main' into manifest-reform
Browse files Browse the repository at this point in the history
  • Loading branch information
Gankra committed Mar 25, 2024
2 parents aace904 + f8c77f9 commit f7ff740
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 11 deletions.
44 changes: 44 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
30 changes: 30 additions & 0 deletions book/src/installers/updater.md
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions book/src/reference/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion cargo-dist-schema/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "cargo-dist-schema"
description = "Schema information for cargo-dist's dist-manifest.json"
version = "0.12.0-prerelease.4"
version = "0.12.0"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/axodotdev/cargo-dist"
Expand Down
8 changes: 4 additions & 4 deletions cargo-dist/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "cargo-dist"
description = "Shippable application packaging for Rust"
version = "0.12.0-prerelease.4"
version = "0.12.0"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/axodotdev/cargo-dist"
Expand Down Expand Up @@ -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.4", 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" }
Expand All @@ -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"
Expand All @@ -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"] }
Expand Down

0 comments on commit f7ff740

Please sign in to comment.