A v-tag releases Luxe with installers, Homebrew and crates.io, SECURITY.md says how to report a hole, and luxe update runs the installer's updater
- release.yml, generated by dist from dist-workspace.toml, builds macOS, Linux and Windows, attests every artifact, and publishes shell and PowerShell installers with their updater, a luxe formula in evanwhittaker/homebrew-tap, and the crates through Trusted Publishing (publish-crates.yml, which skips versions crates.io already has). - luxe update recognizes an installer copy by luxe-cli-update beside it and runs that. - The README, the install guide and the site lead with the installer, Homebrew and Windows. - SECURITY.md: report privately through a GitHub advisory or contact@luxe.dev.
This commit is contained in:
@@ -52,7 +52,9 @@ async fn run_steps(steps: &[&[&str]]) -> anyhow::Result<()> {
|
||||
let Some((program, args)) = step.split_first() else { continue };
|
||||
let line = step.join(" ");
|
||||
println!("Running: {line}");
|
||||
let status = tokio::process::Command::new(program)
|
||||
let beside =
|
||||
std::env::current_exe().ok().and_then(|exe| exe.parent().map(Path::to_path_buf));
|
||||
let status = tokio::process::Command::new(program_path(program, beside.as_deref()))
|
||||
.args(args)
|
||||
.status()
|
||||
.await
|
||||
@@ -64,6 +66,16 @@ async fn run_steps(steps: &[&[&str]]) -> anyhow::Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Where to run `program` from: `beside` this binary when it is there, which is where the
|
||||
/// installer put its updater, whether or not that directory is on `PATH`; by name otherwise.
|
||||
fn program_path(program: &str, beside: Option<&Path>) -> PathBuf {
|
||||
let name = format!("{program}{}", std::env::consts::EXE_SUFFIX);
|
||||
beside
|
||||
.map(|dir| dir.join(name))
|
||||
.filter(|path| path.is_file())
|
||||
.unwrap_or_else(|| PathBuf::from(program))
|
||||
}
|
||||
|
||||
/// How the update landed, read from the `luxe` a shell would run now.
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
enum Outcome {
|
||||
|
||||
@@ -11,6 +11,18 @@ fn copies() -> (tempfile::TempDir, PathBuf, PathBuf) {
|
||||
(dir, updated, other)
|
||||
}
|
||||
|
||||
/// The installer's updater runs from beside the binary even off `PATH`; anything not there, cargo
|
||||
/// or brew, is found by name.
|
||||
#[test]
|
||||
fn a_program_beside_the_binary_runs_from_there() {
|
||||
let dir = tempfile::tempdir().expect("tempdir");
|
||||
let updater = dir.path().join(format!("luxe-cli-update{}", std::env::consts::EXE_SUFFIX));
|
||||
std::fs::write(&updater, b"").expect("a stand-in updater");
|
||||
assert_eq!(program_path("luxe-cli-update", Some(dir.path())), updater);
|
||||
assert_eq!(program_path("brew", Some(dir.path())), PathBuf::from("brew"));
|
||||
assert_eq!(program_path("luxe-cli-update", None), PathBuf::from("luxe-cli-update"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_version_is_the_last_word_when_it_is_semver() {
|
||||
assert_eq!(parse_version("luxe 0.2.0\n").as_deref(), Some("0.2.0"));
|
||||
|
||||
@@ -857,14 +857,15 @@ it, showing each one before it runs:
|
||||
|
||||
| Installed with | `luxe update` runs |
|
||||
| --- | --- |
|
||||
| Cargo | `cargo install --locked --force luxe-cli` |
|
||||
| The install script | `luxe-cli-update`, the updater it put beside `luxe` |
|
||||
| Homebrew | `brew update`, then `brew upgrade luxe` |
|
||||
| Cargo | `cargo install --locked --force luxe-cli` |
|
||||
|
||||
Luxe never downloads or replaces its own program; the package manager that installed it does. A
|
||||
copy your system's package manager owns is left to it, and a downloaded one points you at the
|
||||
releases page. On Windows, Luxe can't be replaced while it runs, so it prints the command to run
|
||||
once it has exited. Afterwards it checks that the `luxe` your shell finds is the new version, and
|
||||
says so if another copy earlier on your `PATH` is in the way. `luxe update --check` only reports.
|
||||
Luxe never downloads or replaces its own program; whatever installed it does. A copy your system's
|
||||
package manager owns is left to it, and a downloaded archive points you at the releases page. On
|
||||
Windows, Luxe can't be replaced while it runs, so it prints the command to run once it has exited.
|
||||
Afterwards it checks that the `luxe` your shell finds is the new version, and says so if another
|
||||
copy earlier on your `PATH` is in the way. `luxe update --check` only reports.
|
||||
|
||||
To stop the daily check:
|
||||
|
||||
@@ -2129,20 +2130,49 @@ order: 1
|
||||
group: "Get started"
|
||||
---
|
||||
|
||||
## Install with Cargo
|
||||
## Install
|
||||
|
||||
On macOS and Linux, the install script puts `luxe` in `~/.local/bin`, or in `$LUXE_INSTALL_DIR`
|
||||
when it is set, and adds that to your `PATH`:
|
||||
|
||||
```bash
|
||||
cargo install luxe-cli
|
||||
luxe --version
|
||||
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/evanwhittaker/luxe/releases/latest/download/luxe-cli-installer.sh | sh
|
||||
```
|
||||
|
||||
This installs the `luxe` command. You need a recent stable Rust; [rustup](https://rustup.rs)
|
||||
installs one.
|
||||
On Windows, in PowerShell:
|
||||
|
||||
```powershell
|
||||
powershell -ExecutionPolicy Bypass -c "irm https://github.com/evanwhittaker/luxe/releases/latest/download/luxe-cli-installer.ps1 | iex"
|
||||
```
|
||||
|
||||
With Homebrew, on macOS or Linux:
|
||||
|
||||
```bash
|
||||
brew install evanwhittaker/tap/luxe
|
||||
```
|
||||
|
||||
With Cargo, which builds it, so you need Rust 1.89 or newer ([rustup](https://rustup.rs) installs
|
||||
one):
|
||||
|
||||
```bash
|
||||
cargo install --locked luxe-cli
|
||||
```
|
||||
|
||||
Any of them installs the `luxe` command; `luxe --version` checks it worked.
|
||||
|
||||
To update, run `luxe update`, or `/update` inside Luxe. Luxe checks once a day for a newer release
|
||||
and says so on the start screen; see [Updates](configuration.md#updates) for how it updates and how
|
||||
to turn the check off.
|
||||
|
||||
### Check a download
|
||||
|
||||
Every file on a release carries a build attestation, so you can confirm it came from this
|
||||
repository's release workflow and nowhere else:
|
||||
|
||||
```bash
|
||||
gh attestation verify luxe-cli-x86_64-unknown-linux-gnu.tar.xz --repo evanwhittaker/luxe
|
||||
```
|
||||
|
||||
## Build from source
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user