Compare commits

...

9 Commits

Author SHA1 Message Date
github-actions[bot]
cb279d2b11 chore: release v16.5.0 2025-11-23 12:16:20 +00:00
Filip Czaplicki
50e55dea77 feat: add colors to --help/-h (#1553) 2025-11-23 13:15:50 +01:00
Rubin Bhandari
f7c9e42066 feat(mise): add support for parallel job configuration in mise (#1548)
Co-authored-by: Gideon <87426140+GideonBear@users.noreply.github.com>
2025-11-21 09:08:40 +01:00
Daniil Kulchenko
ef3ee7bea7 feat(brew): add Homebrew cask support for Linux (#1539) 2025-11-20 20:10:47 +01:00
renovate[bot]
8eb300c4fb chore(deps): update rust crate indexmap to v2.12.1 (#1550)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-20 19:33:19 +01:00
renovate[bot]
b7b99a725c chore(deps): update actions/checkout action to v6 (#1551)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-20 19:31:17 +01:00
Gideon
df090a89c4 docs: Add metadata to Python package for PyPI (#1549) 2025-11-20 19:25:56 +01:00
LILAY
856fa0ed5b docs(installation): update copr repo info in readme (#1545) 2025-11-20 17:28:39 +01:00
Rubin Bhandari
9bb5a680ac feat(mise): add mise configuration options for bump and interactive modes (#1546) 2025-11-20 17:28:13 +01:00
19 changed files with 175 additions and 34 deletions

View File

@@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false

View File

@@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false

View File

@@ -24,7 +24,7 @@ jobs:
security-events: write
steps:
- name: Checkout code
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false

View File

@@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
@@ -39,7 +39,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
@@ -135,7 +135,7 @@ jobs:
matrix_target: ${{ matrix.target }}
steps:
- name: Checkout code
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false

View File

@@ -33,7 +33,7 @@ jobs:
env:
tag: ${{ github.event.client_payload.tag }}
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
@@ -169,7 +169,7 @@ jobs:
matrix_target: ${{ matrix.target }}
tag: ${{ github.event.client_payload.tag }}
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false

View File

@@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false

View File

@@ -17,7 +17,7 @@ jobs:
id-token: write # For trusted publishing
steps:
- name: Checkout repository
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6
with:
fetch-depth: 0
persist-credentials: false
@@ -53,7 +53,7 @@ jobs:
cancel-in-progress: false
steps:
- name: Checkout repository
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6
with:
fetch-depth: 0
persist-credentials: false

View File

@@ -15,7 +15,7 @@ jobs:
matrix:
target: [x86_64, x86, aarch64]
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
@@ -37,7 +37,7 @@ jobs:
matrix:
target: [x64, x86]
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
@@ -58,7 +58,7 @@ jobs:
matrix:
target: [x86_64, aarch64]
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
@@ -76,7 +76,7 @@ jobs:
sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false

View File

@@ -36,7 +36,7 @@ jobs:
steps:
- name: "Checkout code"
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false

View File

@@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [16.5.0](https://github.com/topgrade-rs/topgrade/compare/v16.4.2...v16.5.0) - 2025-11-23
### Added
- add colors to --help/-h ([#1553](https://github.com/topgrade-rs/topgrade/pull/1553))
- *(mise)* add support for parallel job configuration in mise ([#1548](https://github.com/topgrade-rs/topgrade/pull/1548))
- *(brew)* add Homebrew cask support for Linux ([#1539](https://github.com/topgrade-rs/topgrade/pull/1539))
- *(mise)* add mise configuration options for bump and interactive modes ([#1546](https://github.com/topgrade-rs/topgrade/pull/1546))
### Other
- *(deps)* update rust crate indexmap to v2.12.1 ([#1550](https://github.com/topgrade-rs/topgrade/pull/1550))
- *(deps)* update actions/checkout action to v6 ([#1551](https://github.com/topgrade-rs/topgrade/pull/1551))
- Add metadata to Python package for PyPI ([#1549](https://github.com/topgrade-rs/topgrade/pull/1549))
- *(installation)* update copr repo info in readme ([#1545](https://github.com/topgrade-rs/topgrade/pull/1545))
## [16.4.2](https://github.com/topgrade-rs/topgrade/compare/v16.4.1...v16.4.2) - 2025-11-20
### Other

23
Cargo.lock generated
View File

@@ -393,6 +393,16 @@ dependencies = [
"clap_derive",
]
[[package]]
name = "clap-cargo"
version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d546f0e84ff2bfa4da1ce9b54be42285767ba39c688572ca32412a09a73851e5"
dependencies = [
"anstyle",
"clap",
]
[[package]]
name = "clap_builder"
version = "4.5.53"
@@ -1118,9 +1128,9 @@ checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
[[package]]
name = "hashbrown"
version = "0.16.0"
version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d"
checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
[[package]]
name = "heck"
@@ -1402,12 +1412,12 @@ checksum = "964de6e86d545b246d84badc0fef527924ace5134f30641c203ef52ba83f58d5"
[[package]]
name = "indexmap"
version = "2.12.0"
version = "2.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6717a8d2a5a929a1a2eb43a12812498ed141a0bcfb7e8f7844fbdbe4303bba9f"
checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2"
dependencies = [
"equivalent",
"hashbrown 0.16.0",
"hashbrown 0.16.1",
"serde",
"serde_core",
]
@@ -2964,11 +2974,12 @@ checksum = "df8b2b54733674ad286d16267dcfc7a71ed5c776e4ac7aa3c3e2561f7c637bf2"
[[package]]
name = "topgrade"
version = "16.4.2"
version = "16.5.0"
dependencies = [
"base64ct",
"chrono",
"clap",
"clap-cargo",
"clap_complete",
"clap_mangen",
"color-eyre",

View File

@@ -6,7 +6,7 @@ keywords = ["upgrade", "update"]
license = "GPL-3.0-or-later"
repository = "https://github.com/topgrade-rs/topgrade"
rust-version = "1.84.1"
version = "16.4.2"
version = "16.5.0"
authors = ["Roey Darwish Dror <roey.ghost@gmail.com>", "Thomas Schönauer <t.schoenauer@hgs-wt.at>"]
exclude = ["doc/screenshot.gif", "BREAKINGCHANGES_dev.md"]
edition = "2021"
@@ -51,6 +51,7 @@ serde_json = "1.0.145"
ignore = "=0.4.23"
globset = "=0.4.16"
base64ct = "<1.8.0"
clap-cargo = "0.15.2"
[patch.crates-io]
mac-notification-sys = { git = "https://github.com/h4llow3En/mac-notification-sys" }

View File

@@ -3,10 +3,10 @@
<img alt="Topgrade" src="doc/topgrade_transparent.png" width="850px">
</h1>
<a href="https://github.com/topgrade-rs/topgrade/releases"><img alt="GitHub Release" src="https://img.shields.io/github/release/topgrade-rs/topgrade.svg"></a>
<a href="https://crates.io/crates/topgrade"><img alt="crates.io" src="https://img.shields.io/crates/v/topgrade.svg"></a>
<a href="https://aur.archlinux.org/packages/topgrade"><img alt="AUR" src="https://img.shields.io/aur/version/topgrade.svg"></a>
<a href="https://formulae.brew.sh/formula/topgrade"><img alt="Homebrew" src="https://img.shields.io/homebrew/v/topgrade.svg"></a>
<a href="https://github.com/topgrade-rs/topgrade/releases"><img alt="GitHub Release" src="https://img.shields.io/github/release/topgrade-rs/topgrade.svg"></a>
<a href="https://crates.io/crates/topgrade"><img alt="crates.io" src="https://img.shields.io/crates/v/topgrade.svg"></a>
<a href="https://aur.archlinux.org/packages/topgrade"><img alt="AUR" src="https://img.shields.io/aur/version/topgrade.svg"></a>
<a href="https://formulae.brew.sh/formula/topgrade"><img alt="Homebrew" src="https://img.shields.io/homebrew/v/topgrade.svg"></a>
<img alt="Demo" src="doc/topgrade_demo.gif">
</div>
@@ -37,6 +37,8 @@ To remedy this, **Topgrade** detects which tools you use and runs the appropriat
- Windows ([Winget](https://learn.microsoft.com/en-us/windows/package-manager/winget/)): [
`winget install --id=topgrade-rs.topgrade -e`](https://winstall.app/apps/topgrade-rs.topgrade)
- macOS or Linux ([Homebrew](https://brew.sh/)): [`brew install topgrade`](https://formulae.brew.sh/formula/topgrade)
- Fedora/RHEL/AlmaLinux/CentOS-Stream ([Copr](https://copr.fedorainfracloud.org/)): [
`sudo dnf copr enable lilay/topgrade && sudo dnf install topgrade`](https://copr.fedorainfracloud.org/coprs/lilay/topgrade/)
### Community-maintained
@@ -46,8 +48,6 @@ To remedy this, **Topgrade** detects which tools you use and runs the appropriat
`scoop bucket add main && scoop install main/topgrade`](https://scoop.sh/#/apps?q=topgrade)
- macOS ([MacPorts](https://www.macports.org/)): [
`sudo port install topgrade`](https://ports.macports.org/port/topgrade/)
- Fedora ([Copr](https://copr.fedorainfracloud.org/)): [
`dnf copr enable lilay/topgrade && dnf install topgrade`](https://copr.fedorainfracloud.org/coprs/lilay/topgrade/)
- NixOS or Nix (nixpkgs): [topgrade](https://search.nixos.org/packages?show=topgrade)
- Void Linux: [`sudo xbps-install -S topgrade`](https://voidlinux.org/packages/?arch=x86_64&q=topgrade)

View File

@@ -291,6 +291,20 @@
# (default: false)
# exclude_encrypted = false
[mise]
# Upgrades to the latest version available, bumping the version in mise.toml
# (default: false)
# bump = false
# Number of jobs to run in parallel
# (default: 4)
# jobs = 4
# Run interactively
# (default: false)
# interactive = false
[npm]
# Use sudo if the NPM directory isn't owned by the current user
# use_sudo = true

View File

@@ -694,6 +694,14 @@ _version: 2
zh_CN: "不是专用的 macOS brew"
zh_TW: "不是專門的 macOS brew"
de: "Kein angepasstes Brew für macOS"
"Homebrew cask support on Linux requires Homebrew 4.5.0 or later (found {version})":
en: "Homebrew cask support on Linux requires Homebrew 4.5.0 or later (found %{version})"
lt: "Homebrew cask palaikymas Linux sistemoje reikalauja Homebrew 4.5.0 arba naujesnes versijos (rasta %{version})"
es: "El soporte de cask de Homebrew en Linux requiere Homebrew 4.5.0 o posterior (encontrado %{version})"
fr: "Le support de cask Homebrew sur Linux nécessite Homebrew 4.5.0 ou supérieur (trouvé %{version})"
zh_CN: "Linux 上的 Homebrew cask 支持需要 Homebrew 4.5.0 或更高版本(找到 %{version}"
zh_TW: "Linux 上的 Homebrew cask 支援需要 Homebrew 4.5.0 或更高版本(找到 %{version}"
de: "Homebrew-Cask-Unterstützung unter Linux erfordert Homebrew 4.5.0 oder höher (gefunden %{version})"
"Guix Pull Failed, Skipping":
en: "Guix Pull Failed, Skipping"
lt: "Guix traukti nepavyko, praleidžiama"

View File

@@ -5,13 +5,20 @@ build-backend = "maturin"
[project]
name = "topgrade"
dynamic = ["version"]
description = "Upgrade all the things"
readme = "README.md"
license = "GPL-3.0-or-later"
requires-python = ">=3.7"
classifiers = [
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Programming Language :: Rust",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
urls.bugs = "https://github.com/topgrade-rs/topgrade/issues"
urls.homepage = "https://github.com/topgrade-rs/topgrade"
[tool.maturin]
bindings = "bin"

View File

@@ -173,6 +173,15 @@ pub struct Chezmoi {
exclude_encrypted: Option<bool>,
}
#[derive(Deserialize, Default, Debug, Merge)]
#[serde(deny_unknown_fields)]
#[allow(clippy::upper_case_acronyms)]
pub struct Mise {
bump: Option<bool>,
interactive: Option<bool>,
jobs: Option<u32>,
}
#[derive(Deserialize, Default, Debug, Merge)]
#[serde(deny_unknown_fields)]
#[allow(clippy::upper_case_acronyms)]
@@ -471,6 +480,9 @@ pub struct ConfigFile {
#[merge(strategy = crate::utils::merge_strategies::inner_merge_opt)]
chezmoi: Option<Chezmoi>,
#[merge(strategy = crate::utils::merge_strategies::inner_merge_opt)]
mise: Option<Mise>,
#[merge(strategy = crate::utils::merge_strategies::inner_merge_opt)]
yarn: Option<Yarn>,
@@ -717,7 +729,7 @@ impl ConfigFile {
// TODO: i18n of clap currently not easily possible. Waiting for https://github.com/clap-rs/clap/issues/380
// Tracking issue for i18n: https://github.com/topgrade-rs/topgrade/issues/859
#[derive(Parser, Debug)]
#[command(name = "topgrade", version)]
#[command(name = "topgrade", version, styles = clap_cargo::style::CLAP_STYLING)]
pub struct CommandLineArgs {
/// Edit the configuration file
#[arg(long = "edit-config")]
@@ -1804,6 +1816,26 @@ impl Config {
.unwrap_or(false)
}
pub fn mise_bump(&self) -> bool {
self.config_file
.mise
.as_ref()
.and_then(|mise| mise.bump)
.unwrap_or(false)
}
pub fn mise_jobs(&self) -> u32 {
self.config_file.mise.as_ref().and_then(|mise| mise.jobs).unwrap_or(4)
}
pub fn mise_interactive(&self) -> bool {
self.config_file
.mise
.as_ref()
.and_then(|mise| mise.interactive)
.unwrap_or(false)
}
pub fn vscode_profile(&self) -> Option<&str> {
let vscode_cfg = self.config_file.vscode.as_ref()?;
let profile = vscode_cfg.profile.as_ref()?;

View File

@@ -225,7 +225,7 @@ impl Step {
Bin => runner.execute(*self, "bin", || generic::bin_update(ctx))?,
Bob => runner.execute(*self, "Bob", || generic::run_bob(ctx))?,
BrewCask => {
#[cfg(target_os = "macos")]
#[cfg(any(target_os = "linux", target_os = "macos"))]
runner.execute(*self, "Brew Cask", || unix::run_brew_cask(ctx, unix::BrewVariant::Path))?;
#[cfg(target_os = "macos")]
runner.execute(*self, "Brew Cask (Intel)", || {
@@ -750,6 +750,7 @@ pub(crate) fn default_steps() -> Vec<Step> {
Restarts,
Flatpak,
BrewFormula,
BrewCask,
Lure,
Waydroid,
AutoCpufreq,

View File

@@ -81,7 +81,6 @@ impl BrewVariant {
/// Execute an "internal" brew command, i.e. one that should always be run
/// even when dry-running. Basically just a wrapper around [`Command::new`]
/// that uses `arch` to run using the correct architecture if needed.
#[cfg(target_os = "macos")]
fn execute_internal(self) -> Command {
match self {
BrewVariant::MacIntel if cfg!(target_arch = "aarch64") => {
@@ -365,12 +364,48 @@ pub fn run_brew_formula(ctx: &ExecutionContext, variant: BrewVariant) -> Result<
Ok(())
}
#[cfg(target_os = "macos")]
#[cfg(any(target_os = "linux", target_os = "macos"))]
pub fn run_brew_cask(ctx: &ExecutionContext, variant: BrewVariant) -> Result<()> {
let binary_name = require(variant.binary_name())?;
#[cfg(target_os = "macos")]
if variant.is_path() && !BrewVariant::is_macos_custom(binary_name) {
return Err(SkipStep(t!("Not a custom brew for macOS").to_string()).into());
}
#[cfg(target_os = "linux")]
{
// Homebrew cask support was added in version 4.5.0
let version_output = Command::new(&binary_name).arg("--version").output_checked_utf8()?;
let version_line = version_output
.stdout
.lines()
.next()
.ok_or_else(|| eyre!(output_changed_message!("brew --version", "no output lines")))?;
let version_str = version_line.split_whitespace().nth(1).ok_or_else(|| {
eyre!(output_changed_message!(
"brew --version",
"Expected version after 'Homebrew'"
))
})?;
let version = Version::parse(version_str)
.wrap_err_with(|| output_changed_message!("brew --version", "Invalid version"))?;
if version < Version::new(4, 5, 0) {
return Err(SkipStep(
t!(
"Homebrew cask support on Linux requires Homebrew 4.5.0 or later (found {version})",
version = version
)
.to_string(),
)
.into());
}
}
print_separator(format!("{} - Cask", variant.step_title()));
let cask_upgrade_exists = variant
@@ -824,7 +859,23 @@ pub fn run_mise(ctx: &ExecutionContext) -> Result<()> {
}
}
ctx.execute(&mise).arg("upgrade").status_checked()
let mut cmd = ctx.execute(&mise);
cmd.arg("upgrade");
if ctx.config().mise_interactive() {
cmd.arg("--interactive");
}
if ctx.config().mise_bump() {
cmd.arg("--bump");
}
if ctx.config().mise_jobs() != 4 {
cmd.args(["--jobs", &ctx.config().mise_jobs().to_string()]);
}
cmd.status_checked()
}
pub fn run_home_manager(ctx: &ExecutionContext) -> Result<()> {