From e8714f16dad65b1e53031215e82e77bf6b93d366 Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Sat, 17 Jan 2026 14:32:23 +0800 Subject: [PATCH 01/91] Update README.md --- README.md | 237 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 154 insertions(+), 83 deletions(-) diff --git a/README.md b/README.md index 304433e..f5c1e64 100644 --- a/README.md +++ b/README.md @@ -1,161 +1,232 @@ -# StarFetch +# StarFetch ⭐ -A beautiful system information tool written in Rust, inspired by neofetch. StarFetch displays your system information with an elegant ASCII art banner. +A beautiful and fast system information tool written in Rust, inspired by neofetch. StarFetch displays your system information with elegant ASCII art and smart terminal adaptation. -## Features +![Rust](https://img.shields.io/badge/rust-stable-orange.svg) +![License](https://img.shields.io/badge/license-MIT-blue.svg) -- 🎨 **Adaptive ASCII Art**: Automatically selects between full and compact ASCII art based on terminal width -- 🖥️ **System Information**: Displays hostname, OS, kernel version, and uptime -- 🔗 **Clickable Links**: Developer name with clickable hyperlink support -- 🌈 **Colorful Output**: Beautiful colored terminal output using ANSI colors -- ⚡ **Fast & Lightweight**: Written in Rust for optimal performance +## ✨ Features -## Screenshot +- 🎨 **Adaptive ASCII Art** - Automatically adjusts display based on terminal width +- 🖥️ **Comprehensive System Info** - Shows hostname, OS, kernel, uptime, CPU, memory, and packages +- 🔗 **Smart Hyperlinks** - Clickable developer links with terminal detection +- 🌈 **Beautiful Colors** - ANSI color support for elegant terminal output +- ⚡ **Lightning Fast** - Written in Rust for optimal performance +- 🔧 **Cross-Platform** - Works on macOS, Linux, and Windows -``` -_____/\\\\\\\\\\\_______________________________________________/\\\\\\\\\\\\\\\_____________________________________________/\\\_________ - ___/\\\/////////\\\____________________________________________\/\\\///////////_____________________________________________\/\\\_________ - __\//\\\______\///______/\\\___________________________________\/\\\________________________________/\\\____________________\/\\\_________ - ___\////\\\__________/\\\\\\\\\\\__/\\\\\\\\\_____/\\/\\\\\\\__\/\\\\\\\\\\\_________/\\\\\\\\___/\\\\\\\\\\\_____/\\\\\\\\_\/\\\_________ - ______\////\\\______\////\\\////__\////////\\\___\/\\\/////\\\_\/\\\///////________/\\\/////\\\_\////\\\////____/\\\//////__\/\\\\\\\\\\__ - _________\////\\\______\/\\\________/\\\\\\\\\\__\/\\\___\///__\/\\\______________/\\\\\\\\\\\_____\/\\\_______/\\\_________\/\\\/////\\\_ - __/\\\______\//\\\_____\/\\\_/\\___/\\\/////\\\__\/\\\_________\/\\\_____________\//\\///////______\/\\\_/\\__\//\\\________\/\\\___\/\\\_ - _\///\\\\\\\\\\\/______\//\\\\\___\//\\\\\\\\/\\_\/\\\_________\/\\\______________\//\\\\\\\\\\____\//\\\\\____\///\\\\\\\\_\/\\\___\/\\\_ - ___\///////////_________\/////_____\////////\//__\///__________\///________________\//////////______\/////_______\////////__\///____\///__ +## 📸 Screenshot +``` + ╔════════════════════════════════╗ + ║ ★ STARFETCH ★ ║ + ╚════════════════════════════════╝ + Developed by Linus Shyu hostname -------- OS: macOS Kernel: 25.2.0 -Uptime: 2 Days 5 Hours 30 Minutes +Uptime: 6 Days 14 Hours 32 Minutes +Packages: 30 (brew) +CPU Cores: 10 +CPU Brand: Apple M5 +CPU Frequency: 4608 MHz +CPU Usage: 10.24% +Total Memory: 16 GB +Used Memory: 10.79 GB ``` -## Installation +## 🚀 Installation ### Prerequisites -- Rust (latest stable version) -- Cargo (comes with Rust) +- **Rust** (latest stable version) - [Install Rust](https://www.rust-lang.org/tools/install) +- **Cargo** (comes with Rust) ### Build from Source -1. Clone the repository: -```bash -git clone https://github.com/Linus-Shyu/StarFetch_Core.git -cd StarFetch_Core/StarFetch -``` +1. **Clone the repository:** + ```bash + git clone https://github.com/Linus-Shyu/StarFetch_Core.git + cd StarFetch_Core/StarFetch + ``` -2. Build the project: -```bash -cargo build --release -``` +2. **Build the project:** + ```bash + cargo build --release + ``` -3. Run the executable: -```bash -cargo run --release -``` +3. **Run it:** + ```bash + ./target/release/starfetch + ``` + +### Install Globally + +Install StarFetch globally using Cargo: -Or install it globally: ```bash +cd StarFetch_Core/StarFetch cargo install --path . ``` -## Usage +After installation, you can run `starfetch` from anywhere in your terminal. + +## 📖 Usage Simply run: + ```bash starfetch ``` -Or if you built it locally: +Or if running from source: + ```bash cargo run ``` -## Project Structure +Or from release build: +```bash +cargo run --release ``` -StarFetch/ -├── src/ -│ ├── main.rs # Main entry point -│ ├── art.rs # ASCII art generation and terminal width detection -│ ├── system.rs # System information retrieval -│ └── hyperlink.rs # Hyperlink and text styling utilities -├── Cargo.toml # Project dependencies and metadata -└── README.md # This file -``` -## Dependencies +## 🎯 What It Shows + +StarFetch displays the following system information: -- `ansi_term` - Terminal colors and styling -- `sysinfo` - System information retrieval -- `systemstat` - System statistics (uptime, etc.) -- `terminal_size` - Terminal width detection +- **Hostname** - Your system's hostname +- **OS** - Operating system name (macOS, Linux, Windows, etc.) +- **Kernel** - Kernel version +- **Uptime** - System uptime in days, hours, and minutes +- **Packages** - Installed packages count (Homebrew on macOS) +- **CPU** - CPU cores, brand, frequency, and usage +- **Memory** - Total and used memory in GB -## Features in Detail +## 🛠️ Features in Detail ### Adaptive ASCII Art -StarFetch automatically detects your terminal width: -- **Width ≥ 120 characters**: Displays full "STARFETCH" ASCII art -- **Width < 120 characters**: Displays compact box art -- **Unable to detect**: Falls back to full ASCII art +StarFetch intelligently adapts to your terminal width: +- **Wide terminals (≥147 columns)**: Displays full "STARFETCH" ASCII art +- **Narrow terminals (<147 columns)**: Displays compact box-style art +- **Unknown width**: Falls back to full ASCII art + +### Smart Hyperlinks + +The developer name is displayed as a clickable hyperlink in modern terminals: +- ✅ iTerm2 +- ✅ Apple Terminal +- ✅ Windows Terminal +- ✅ VSCode Integrated Terminal +- ✅ xterm-compatible terminals + +### Colorful Output -### System Information +Beautiful colored output using ANSI escape codes for better readability and aesthetics. -Displays: -- **Hostname**: Your system's hostname -- **OS**: Operating system name -- **Kernel**: Kernel version -- **Uptime**: System uptime in days, hours, and minutes +## 📁 Project Structure -### Clickable Links +``` +StarFetch_Core/ +├── StarFetch/ +│ ├── src/ +│ │ ├── main.rs # Main entry point +│ │ ├── art.rs # ASCII art and terminal width detection +│ │ ├── system.rs # System information retrieval +│ │ ├── hyperlink.rs # Hyperlink and terminal detection +│ │ └── lib.rs # Library module exports +│ ├── Cargo.toml # Project dependencies and metadata +│ └── README.md # Documentation +├── LICENSE +└── README.md # This file +``` + +## 📦 Dependencies -The developer name is displayed as a clickable hyperlink (supported in modern terminals like iTerm2, Windows Terminal, etc.) +- **[ansi_term](https://crates.io/crates/ansi_term)** - Terminal colors and styling +- **[sysinfo](https://crates.io/crates/sysinfo)** - Cross-platform system information retrieval +- **[systemstat](https://crates.io/crates/systemstat)** - System statistics (uptime, etc.) +- **[terminal_size](https://crates.io/crates/terminal_size)** - Terminal width detection -## Development +## 🔧 Development -### Format Code +### Prerequisites + +Make sure you have Rust installed: ```bash -cargo fmt +rustc --version +cargo --version ``` -### Check for Issues +### Common Commands +**Format code:** ```bash -cargo check +cargo fmt ``` -### Build +**Check for errors:** +```bash +cargo check +``` +**Build:** ```bash cargo build ``` -### Run Tests +**Run:** +```bash +cargo run +``` +**Run tests:** ```bash cargo test ``` -## Contributing +**Build for release:** +```bash +cargo build --release +``` + +## 🤝 Contributing -Contributions are welcome! Please feel free to submit a Pull Request. +Contributions are welcome! Here's how you can help: -## License +1. Fork the repository +2. Create your feature branch (`git checkout -b feature/amazing-feature`) +3. Commit your changes (`git commit -m 'Add some amazing feature'`) +4. Push to the branch (`git push origin feature/amazing-feature`) +5. Open a Pull Request -See [LICENSE](LICENSE) file for details. +Please make sure your code follows Rust conventions and passes `cargo fmt` and `cargo clippy`. -## Author +## 📄 License -**Linus Shyu** +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. -- GitHub: [@Linus-Shyu](https://github.com/Linus-Shyu) +## 👥 Authors -## Acknowledgments +- **Linus Shyu** + - GitHub: [@Linus-Shyu](https://github.com/Linus-Shyu) -- Inspired by [neofetch](https://github.com/dylanaraps/neofetch) +- **Dylan Su** + - GitHub: [@xs10l3](https://github.com/xs10l3) + +## 🙏 Acknowledgments + +- Inspired by [neofetch](https://github.com/dylanaraps/neofetch) - A command-line system information tool - Built with ❤️ using Rust + +## 📝 Version + +Current version: **0.1.2** + +--- + +⭐ If you find StarFetch useful, please consider giving it a star on GitHub! \ No newline at end of file From d4096c1d512442150127686db0f41c22e8694cfe Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Sat, 17 Jan 2026 17:19:04 +0800 Subject: [PATCH 02/91] Update Developer information --- StarFetch/src/hyperlink.rs | 3 +++ StarFetch/src/main.rs | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/StarFetch/src/hyperlink.rs b/StarFetch/src/hyperlink.rs index c96cd6a..0f7ddca 100644 --- a/StarFetch/src/hyperlink.rs +++ b/StarFetch/src/hyperlink.rs @@ -74,3 +74,6 @@ pub fn styled_developer_name() -> String { "Linus Shyu".to_string() } +pub fn styled_developer_name_dylan() -> String { + "Dylan Su".to_string() +} diff --git a/StarFetch/src/main.rs b/StarFetch/src/main.rs index 5cf5ce3..7e4875e 100644 --- a/StarFetch/src/main.rs +++ b/StarFetch/src/main.rs @@ -9,13 +9,21 @@ fn main() { // Output link & text print!("Developed by "); - println!( + print!( "{}", hyperlink::hyperlink( &hyperlink::styled_developer_name(), "https://github.com/Linus-Shyu" ) ); + print!(" and "); + print!( + "{}", + hyperlink::hyperlink( + &hyperlink::styled_developer_name_dylan(), + "https://github.com/xs10l3" + ) + ); // Opimization the UI println!(); From f10b6f15e8100fa99596ebbaf6fe22b8a020658b Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Sat, 17 Jan 2026 17:42:49 +0800 Subject: [PATCH 03/91] Fix::Command Line --- StarFetch/src/system.rs | 60 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/StarFetch/src/system.rs b/StarFetch/src/system.rs index 7ffc0e2..2045b61 100644 --- a/StarFetch/src/system.rs +++ b/StarFetch/src/system.rs @@ -10,13 +10,69 @@ pub fn init_system() -> SysInfoSystem { sys } +// Helper function to calculate maximum width across all system info lines +fn calculate_max_info_width() -> usize { + let mut max_len = 0; + let mut sys = SysInfoSystem::new_all(); + sys.refresh_all(); + + // Hostname + let host_name = SysInfoSystem::host_name().unwrap_or_else(|| "Unknown".to_string()); + max_len = max_len.max(host_name.len()); + + // OS line + if let Some(os_name) = SysInfoSystem::name() { + max_len = max_len.max(format!("OS: {}", os_name).len()); + } + + // Kernel line + if let Some(kernel) = SysInfoSystem::kernel_version() { + max_len = max_len.max(format!("Kernel: {}", kernel).len()); + } + + // Uptime line (max estimated) + max_len = max_len.max("Uptime: 999 Days 99 Hours 99 Minutes".len()); + + // Packages (check actual) + if let Ok(output) = Command::new("brew").args(&["list", "--formula"]).output() { + if output.status.success() { + let count = String::from_utf8_lossy(&output.stdout).lines().count(); + if count > 0 { + max_len = max_len.max(format!("Packages: {} (brew)", count).len()); + } + } + } + + // CPU lines + max_len = max_len.max(format!("CPU Cores: {}", sys.cpus().len()).len()); + + if let Some(cpu) = sys.cpus().first() { + max_len = max_len.max(format!("CPU Brand: {}", cpu.brand()).len()); + max_len = max_len.max(format!("CPU Frequency: {} MHz", cpu.frequency()).len()); + } + + max_len = max_len.max("CPU Usage: 100.00%".len()); + + // Memory lines + let total_mem = sys.total_memory() as f64 / 1024.0 / 1024.0 / 1024.0; + max_len = max_len.max(format!("Total Memory: {:.2} GB", total_mem).len()); + + let used_mem = sys.used_memory() as f64 / 1024.0 / 1024.0 / 1024.0; + max_len = max_len.max(format!("Used Memory: {:.2} GB", used_mem).len()); + + max_len +} + pub fn print_hardware_info() { // Setting & Output host name let host_name = SysInfoSystem::host_name().unwrap_or_else(|| "Unknown".to_string()); println!("{}", Cyan.paint(&host_name)); - // Setting & Output "-" - let separator = "-".repeat(host_name.len()); + // Calculate maximum width across ALL system info lines + let max_len = calculate_max_info_width(); + + // Output separator with calculated width + let separator = "-".repeat(max_len); println!("{}", separator); // Setting & Output OS name From 32e9e657b6414231baf342d98157513d7e76bc62 Mon Sep 17 00:00:00 2001 From: dylan su <1526394815@qq.com> Date: Sun, 18 Jan 2026 12:13:17 +0800 Subject: [PATCH 04/91] fix: typo --- .idea/dictionaries/project.xml | 7 +++++++ StarFetch/src/hyperlink.rs | 6 +++--- StarFetch/src/main.rs | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 .idea/dictionaries/project.xml diff --git a/.idea/dictionaries/project.xml b/.idea/dictionaries/project.xml new file mode 100644 index 0000000..4103986 --- /dev/null +++ b/.idea/dictionaries/project.xml @@ -0,0 +1,7 @@ + + + + Shyu + + + \ No newline at end of file diff --git a/StarFetch/src/hyperlink.rs b/StarFetch/src/hyperlink.rs index 0f7ddca..7eeae19 100644 --- a/StarFetch/src/hyperlink.rs +++ b/StarFetch/src/hyperlink.rs @@ -1,4 +1,4 @@ -// Cheak the Terminal type +// Check the Terminal type fn detect_terminal() -> TerminalType { // Terminal variable if let Ok(term_program) = std::env::var("TERM_PROGRAM") { @@ -16,7 +16,7 @@ fn detect_terminal() -> TerminalType { } } - // Cheak Terminal + // Check Terminal if let Ok(term) = std::env::var("TERM") { if term.contains("xterm") || term.contains("screen") { return TerminalType::XTerm; @@ -69,7 +69,7 @@ pub fn hyperlink(text: &str, url: &str) -> String { } } -// Exchange data to string text ans rendering +// Exchange data to string text and rendering pub fn styled_developer_name() -> String { "Linus Shyu".to_string() } diff --git a/StarFetch/src/main.rs b/StarFetch/src/main.rs index 6784fd1..7873f2c 100644 --- a/StarFetch/src/main.rs +++ b/StarFetch/src/main.rs @@ -25,7 +25,7 @@ fn main() { ) ); - // Opimization the UI + // Optimization the UI println!(); // Output system information From 948b18e7f3590aeeb8a724c75595d9ef4fd6842a Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Sun, 18 Jan 2026 12:40:56 +0800 Subject: [PATCH 05/91] Add apt packages calculator --- StarFetch/src/hyperlink.rs | 9 ++++++++ StarFetch/src/system.rs | 47 +++++++++++++++++++++++++++++++++++++- 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/StarFetch/src/hyperlink.rs b/StarFetch/src/hyperlink.rs index 7eeae19..da48514 100644 --- a/StarFetch/src/hyperlink.rs +++ b/StarFetch/src/hyperlink.rs @@ -1,4 +1,9 @@ +<<<<<<< HEAD // Check the Terminal type +======= +// Cheak the Terminal type + +>>>>>>> a2f386d (Add apt packages calculator) fn detect_terminal() -> TerminalType { // Terminal variable if let Ok(term_program) = std::env::var("TERM_PROGRAM") { @@ -16,7 +21,11 @@ fn detect_terminal() -> TerminalType { } } +<<<<<<< HEAD // Check Terminal +======= + // Check Terminal +>>>>>>> a2f386d (Add apt packages calculator) if let Ok(term) = std::env::var("TERM") { if term.contains("xterm") || term.contains("screen") { return TerminalType::XTerm; diff --git a/StarFetch/src/system.rs b/StarFetch/src/system.rs index 39e4e43..949ba25 100644 --- a/StarFetch/src/system.rs +++ b/StarFetch/src/system.rs @@ -34,7 +34,7 @@ fn calculate_max_info_width() -> usize { // Uptime line (max estimated) max_len = max_len.max("Uptime: 999 Days 99 Hours 99 Minutes".len()); - // Packages (check actual) + // Brew Packages (check actual) if let Ok(output) = Command::new("brew").args(&["list", "--formula"]).output() { if output.status.success() { let count = String::from_utf8_lossy(&output.stdout).lines().count(); @@ -43,6 +43,19 @@ fn calculate_max_info_width() -> usize { } } } + + // Brew package + if let Ok(output) = Command::new("dpkg").args(&["-l"]).output() { + if output.status.success() { + let count = String::from_utf8_lossy(&output.stdout) + .lines() + .filter(|line| line.starts_with("ii")) + .count(); + if count > 0 { + max_len = max_len.max(format!("Packages: {} (apt)", count).len()); + } + } +} // CPU lines max_len = max_len.max(format!("CPU Cores: {}", sys.cpus().len()).len()); @@ -137,6 +150,38 @@ pub fn print_packages() { } } + // Linux + if let Ok(output) = Command::new("dpkg") + .args(&["-l"]) + .output() + { + if output.status.success() { + let count = String::from_utf8_lossy(&output.stdout) + .lines() + .filter(|line| line.starts_with("ii")) + .count(); + if count > 0 { + package_managers.push(("apt", count)); + } + } + } + + // Fallback to apt list if dpkg fails + else if let Ok(output) = Command::new("apt") + .args(&["list", "--installed"]) + .output() + { + if output.status.success() { + let count = String::from_utf8_lossy(&output.stdout) + .lines() + .filter(|line| line.contains("/")) // Filter out header lines + .count(); + if count > 0 { + package_managers.push(("apt", count)); + } + } + } + // Output information about packages if !package_managers.is_empty() { let packages_str: Vec = package_managers From 52231315616929d9446cab866b33115edaf80a6f Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Sun, 18 Jan 2026 12:49:41 +0800 Subject: [PATCH 06/91] Resolve merge conflict in hyperlink.rs and prepare for v0.1.5 --- StarFetch/src/hyperlink.rs | 9 --------- 1 file changed, 9 deletions(-) diff --git a/StarFetch/src/hyperlink.rs b/StarFetch/src/hyperlink.rs index da48514..374ad27 100644 --- a/StarFetch/src/hyperlink.rs +++ b/StarFetch/src/hyperlink.rs @@ -1,9 +1,4 @@ -<<<<<<< HEAD // Check the Terminal type -======= -// Cheak the Terminal type - ->>>>>>> a2f386d (Add apt packages calculator) fn detect_terminal() -> TerminalType { // Terminal variable if let Ok(term_program) = std::env::var("TERM_PROGRAM") { @@ -21,11 +16,7 @@ fn detect_terminal() -> TerminalType { } } -<<<<<<< HEAD - // Check Terminal -======= // Check Terminal ->>>>>>> a2f386d (Add apt packages calculator) if let Ok(term) = std::env::var("TERM") { if term.contains("xterm") || term.contains("screen") { return TerminalType::XTerm; From 46b8b5607930118f482ade9bdd87ede65cdbb6f1 Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Sun, 18 Jan 2026 14:27:00 +0800 Subject: [PATCH 07/91] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index f5c1e64..2901f33 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # StarFetch ⭐ + + A beautiful and fast system information tool written in Rust, inspired by neofetch. StarFetch displays your system information with elegant ASCII art and smart terminal adaptation. ![Rust](https://img.shields.io/badge/rust-stable-orange.svg) From aabc0f8cca21849ebfd3bda14717d5f5c925f995 Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Sun, 18 Jan 2026 14:29:05 +0800 Subject: [PATCH 08/91] Fix README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2901f33..195c5da 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # StarFetch ⭐ - +## Star History + +[![Star History Chart](https://api.star-history.com/svg?repos=Linus-Shyu/StarFetch_Core&type=date&legend=top-left)](https://www.star-history.com/#Linus-Shyu/StarFetch_Core&type=date&legend=top-left) A beautiful and fast system information tool written in Rust, inspired by neofetch. StarFetch displays your system information with elegant ASCII art and smart terminal adaptation. @@ -231,4 +233,4 @@ Current version: **0.1.2** --- -⭐ If you find StarFetch useful, please consider giving it a star on GitHub! \ No newline at end of file +⭐ If you find StarFetch useful, please consider giving it a star on GitHub! From c4b80ae18d9b4a710f40e8da9fe3c548444f3194 Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Mon, 19 Jan 2026 21:35:41 +0800 Subject: [PATCH 09/91] Fix code quality issues and improve calculate_max_info_width - Fix Clippy warnings (remove unnecessary borrows) - Fix indentation issues in calculate_max_info_width function - Add swap and disk info to width calculation - Improve apt package detection logic - Fix else-if syntax issue --- StarFetch/src/system.rs | 66 +++++++++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 25 deletions(-) diff --git a/StarFetch/src/system.rs b/StarFetch/src/system.rs index 949ba25..739e64f 100644 --- a/StarFetch/src/system.rs +++ b/StarFetch/src/system.rs @@ -35,7 +35,7 @@ fn calculate_max_info_width() -> usize { max_len = max_len.max("Uptime: 999 Days 99 Hours 99 Minutes".len()); // Brew Packages (check actual) - if let Ok(output) = Command::new("brew").args(&["list", "--formula"]).output() { + if let Ok(output) = Command::new("brew").args(["list", "--formula"]).output() { if output.status.success() { let count = String::from_utf8_lossy(&output.stdout).lines().count(); if count > 0 { @@ -44,18 +44,18 @@ fn calculate_max_info_width() -> usize { } } - // Brew package - if let Ok(output) = Command::new("dpkg").args(&["-l"]).output() { - if output.status.success() { - let count = String::from_utf8_lossy(&output.stdout) - .lines() - .filter(|line| line.starts_with("ii")) - .count(); - if count > 0 { - max_len = max_len.max(format!("Packages: {} (apt)", count).len()); + // APT Packages (check actual) + if let Ok(output) = Command::new("dpkg").args(["-l"]).output() { + if output.status.success() { + let count = String::from_utf8_lossy(&output.stdout) + .lines() + .filter(|line| line.starts_with("ii")) + .count(); + if count > 0 { + max_len = max_len.max(format!("Packages: {} (apt)", count).len()); + } } } -} // CPU lines max_len = max_len.max(format!("CPU Cores: {}", sys.cpus().len()).len()); @@ -74,6 +74,18 @@ fn calculate_max_info_width() -> usize { let used_mem = sys.used_memory() as f64 / 1024.0 / 1024.0 / 1024.0; max_len = max_len.max(format!("Used Memory: {:.2} GB", used_mem).len()); + // Swap lines + let total_swap = sys.total_swap() as f64 / 1024.0 / 1024.0 / 1024.0; + max_len = max_len.max(format!("Total Swap Memory: {:.2} GB", total_swap).len()); + + let used_swap = sys.used_swap() as f64 / 1024.0 / 1024.0 / 1024.0; + max_len = max_len.max(format!("Used Swap Memory: {:.2} GB", used_swap).len()); + + // Disk lines (estimate maximum) + max_len = max_len.max("Total Disk: 9999.99 GB".len()); + max_len = max_len.max("Used Disk: 9999.99 GB".len()); + max_len = max_len.max("Available Disk: 9999.99 GB".len()); + max_len } @@ -137,7 +149,7 @@ pub fn print_packages() { // macOS: Homebrew if let Ok(output) = Command::new("brew") - .args(&["list", "--formula"]) + .args(["list", "--formula"]) .output() { if output.status.success() { @@ -150,9 +162,10 @@ pub fn print_packages() { } } - // Linux + // Linux: APT (try dpkg first) + let mut apt_found = false; if let Ok(output) = Command::new("dpkg") - .args(&["-l"]) + .args(["-l"]) .output() { if output.status.success() { @@ -162,22 +175,25 @@ pub fn print_packages() { .count(); if count > 0 { package_managers.push(("apt", count)); + apt_found = true; } } } // Fallback to apt list if dpkg fails - else if let Ok(output) = Command::new("apt") - .args(&["list", "--installed"]) - .output() - { - if output.status.success() { - let count = String::from_utf8_lossy(&output.stdout) - .lines() - .filter(|line| line.contains("/")) // Filter out header lines - .count(); - if count > 0 { - package_managers.push(("apt", count)); + if !apt_found { + if let Ok(output) = Command::new("apt") + .args(["list", "--installed"]) + .output() + { + if output.status.success() { + let count = String::from_utf8_lossy(&output.stdout) + .lines() + .filter(|line| line.contains("/")) // Filter out header lines + .count(); + if count > 0 { + package_managers.push(("apt", count)); + } } } } From e5f349ff498f9e5d78ee845dfb523aae9ff20057 Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Mon, 19 Jan 2026 22:00:39 +0800 Subject: [PATCH 10/91] Update README.md --- README.md | 212 ++++++++++-------------------------------------------- 1 file changed, 39 insertions(+), 173 deletions(-) diff --git a/README.md b/README.md index 195c5da..b3355de 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,36 @@ # StarFetch ⭐ -## Star History - [![Star History Chart](https://api.star-history.com/svg?repos=Linus-Shyu/StarFetch_Core&type=date&legend=top-left)](https://www.star-history.com/#Linus-Shyu/StarFetch_Core&type=date&legend=top-left) +[![Written in Rust](https://img.shields.io/badge/Written%20in-Rust-CE412B?style=for-the-badge&logo=rust&logoColor=white)](https://www.rust-lang.org/) +[![Mascot](https://img.shields.io/badge/Mascot-Ferris-orange?style=for-the-badge)](https://rustacean.net/) +[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge)](LICENSE) + A beautiful and fast system information tool written in Rust, inspired by neofetch. StarFetch displays your system information with elegant ASCII art and smart terminal adaptation. -![Rust](https://img.shields.io/badge/rust-stable-orange.svg) -![License](https://img.shields.io/badge/license-MIT-blue.svg) +## 💡 Inspiration & Encouragement + +StarFetch was born from a deep respect for the legacy of command-line tools. We are incredibly honored to have received these words of encouragement from **Dylan Araps**, the creator of [neofetch](https://github.com/dylanaraps/neofetch): + +> "Starfetch looks cool. It looks like a lot of care has gone into it. ... I wish you all the best and I hope you succeed in your goals." +> — **Dylan Araps** + +His reminder that "writing software is fun but can also be very draining" and to "look after yourselves" is a core value we carry forward in this project. + +--- ## ✨ Features -- 🎨 **Adaptive ASCII Art** - Automatically adjusts display based on terminal width -- 🖥️ **Comprehensive System Info** - Shows hostname, OS, kernel, uptime, CPU, memory, and packages -- 🔗 **Smart Hyperlinks** - Clickable developer links with terminal detection -- 🌈 **Beautiful Colors** - ANSI color support for elegant terminal output -- ⚡ **Lightning Fast** - Written in Rust for optimal performance -- 🔧 **Cross-Platform** - Works on macOS, Linux, and Windows +- 🎨 **Adaptive ASCII Art** - Automatically adjusts display based on terminal width. +- 🖥️ **Comprehensive System Info** - Hostname, OS, kernel, uptime, CPU, memory, and packages. +- 🔗 **Smart Hyperlinks** - Clickable developer links with terminal detection. +- 🌈 **Beautiful Colors** - ANSI color support for elegant terminal output. +- ⚡ **Lightning Fast** - Written in Rust for optimal performance. +- 🔧 **Cross-Platform** - Works on macOS, Linux, and Windows. ## 📸 Screenshot -``` +```text ╔════════════════════════════════╗ ║ ★ STARFETCH ★ ║ ╚════════════════════════════════╝ @@ -39,197 +49,53 @@ CPU Frequency: 4608 MHz CPU Usage: 10.24% Total Memory: 16 GB Used Memory: 10.79 GB + ``` ## 🚀 Installation ### Prerequisites -- **Rust** (latest stable version) - [Install Rust](https://www.rust-lang.org/tools/install) -- **Cargo** (comes with Rust) +* **Rust** (latest stable version) - [Install Rust](https://www.rust-lang.org/tools/install) +* **Cargo** (comes with Rust) ### Build from Source -1. **Clone the repository:** - ```bash - git clone https://github.com/Linus-Shyu/StarFetch_Core.git - cd StarFetch_Core/StarFetch - ``` - -2. **Build the project:** - ```bash - cargo build --release - ``` - -3. **Run it:** - ```bash - ./target/release/starfetch - ``` - -### Install Globally - -Install StarFetch globally using Cargo: - ```bash +git clone [https://github.com/Linus-Shyu/StarFetch_Core.git](https://github.com/Linus-Shyu/StarFetch_Core.git) cd StarFetch_Core/StarFetch -cargo install --path . -``` - -After installation, you can run `starfetch` from anywhere in your terminal. - -## 📖 Usage - -Simply run: - -```bash -starfetch -``` - -Or if running from source: +cargo build --release -```bash -cargo run ``` -Or from release build: +### Install Globally ```bash -cargo run --release -``` - -## 🎯 What It Shows - -StarFetch displays the following system information: - -- **Hostname** - Your system's hostname -- **OS** - Operating system name (macOS, Linux, Windows, etc.) -- **Kernel** - Kernel version -- **Uptime** - System uptime in days, hours, and minutes -- **Packages** - Installed packages count (Homebrew on macOS) -- **CPU** - CPU cores, brand, frequency, and usage -- **Memory** - Total and used memory in GB - -## 🛠️ Features in Detail - -### Adaptive ASCII Art - -StarFetch intelligently adapts to your terminal width: -- **Wide terminals (≥147 columns)**: Displays full "STARFETCH" ASCII art -- **Narrow terminals (<147 columns)**: Displays compact box-style art -- **Unknown width**: Falls back to full ASCII art - -### Smart Hyperlinks - -The developer name is displayed as a clickable hyperlink in modern terminals: -- ✅ iTerm2 -- ✅ Apple Terminal -- ✅ Windows Terminal -- ✅ VSCode Integrated Terminal -- ✅ xterm-compatible terminals - -### Colorful Output - -Beautiful colored output using ANSI escape codes for better readability and aesthetics. - -## 📁 Project Structure +cargo install --path . -``` -StarFetch_Core/ -├── StarFetch/ -│ ├── src/ -│ │ ├── main.rs # Main entry point -│ │ ├── art.rs # ASCII art and terminal width detection -│ │ ├── system.rs # System information retrieval -│ │ ├── hyperlink.rs # Hyperlink and terminal detection -│ │ └── lib.rs # Library module exports -│ ├── Cargo.toml # Project dependencies and metadata -│ └── README.md # Documentation -├── LICENSE -└── README.md # This file ``` ## 📦 Dependencies -- **[ansi_term](https://crates.io/crates/ansi_term)** - Terminal colors and styling -- **[sysinfo](https://crates.io/crates/sysinfo)** - Cross-platform system information retrieval -- **[systemstat](https://crates.io/crates/systemstat)** - System statistics (uptime, etc.) -- **[terminal_size](https://crates.io/crates/terminal_size)** - Terminal width detection - -## 🔧 Development - -### Prerequisites - -Make sure you have Rust installed: - -```bash -rustc --version -cargo --version -``` - -### Common Commands - -**Format code:** -```bash -cargo fmt -``` - -**Check for errors:** -```bash -cargo check -``` - -**Build:** -```bash -cargo build -``` - -**Run:** -```bash -cargo run -``` - -**Run tests:** -```bash -cargo test -``` - -**Build for release:** -```bash -cargo build --release -``` - -## 🤝 Contributing - -Contributions are welcome! Here's how you can help: - -1. Fork the repository -2. Create your feature branch (`git checkout -b feature/amazing-feature`) -3. Commit your changes (`git commit -m 'Add some amazing feature'`) -4. Push to the branch (`git push origin feature/amazing-feature`) -5. Open a Pull Request - -Please make sure your code follows Rust conventions and passes `cargo fmt` and `cargo clippy`. - -## 📄 License - -This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. +* `ansi_term` - Terminal colors and styling. +* `sysinfo` - Cross-platform system info. +* `systemstat` - System statistics (uptime, etc.). +* `terminal_size` - Terminal width detection. ## 👥 Authors -- **Linus Shyu** - - GitHub: [@Linus-Shyu](https://github.com/Linus-Shyu) - -- **Dylan Su** - - GitHub: [@xs10l3](https://github.com/xs10l3) +* **Linus Shyu** ([@Linus-Shyu](https://github.com/Linus-Shyu)) +* **Dylan Su** ([@xs10l3](https://github.com/xs10l3)) ## 🙏 Acknowledgments -- Inspired by [neofetch](https://github.com/dylanaraps/neofetch) - A command-line system information tool -- Built with ❤️ using Rust +* **Dylan Araps** - For the original inspiration and kind words. +* **Rust Foundation** - For guidance on trademark compliance. We use **Ferris the Crab** (the unofficial-official mascot) to represent our love for the Rust community. 🦀 +* **The Open Source Community** - For the amazing crates that make this project possible. -## 📝 Version +## 📄 License -Current version: **0.1.2** +This project is licensed under the MIT License - see the [LICENSE](https://www.google.com/search?q=LICENSE) file for details. --- From f28475657647c3d13ffe4b8baf689bc8f11a5275 Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Thu, 22 Jan 2026 18:21:09 +0800 Subject: [PATCH 11/91] Update Windows Winget --- StarFetch/src/system.rs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/StarFetch/src/system.rs b/StarFetch/src/system.rs index 739e64f..e495151 100644 --- a/StarFetch/src/system.rs +++ b/StarFetch/src/system.rs @@ -56,6 +56,23 @@ fn calculate_max_info_width() -> usize { } } } + + // Winget Packages + if let Ok(output) = Command::new("winget") + .args(["list", "--accept-source-agreements"]) + .output() + { + if output.status.success() { + let full_output = String::from_utf8_lossy(&output.stdout); + let line_count = full_output.lines() + .filter(|l| !l.trim().is_empty()) + .count(); + if line_count > 2 { + let count = line_count - 2; + max_len = max_len.max(format!("Packages: {} (winget)", count).len()); + } + } + } // CPU lines max_len = max_len.max(format!("CPU Cores: {}", sys.cpus().len()).len()); @@ -198,6 +215,19 @@ pub fn print_packages() { } } + // Winget + if let Ok(output) = Command::new("winget").args(["list", "--accept-source-agreements"]).output() { + if output.status.success() { + let full_output = String::from_utf8_lossy(&output.stdout); + + let line_count = full_output.lines().filter(|l| !l.trim().is_empty()).count(); + + if line_count > 2 { + package_managers.push(("winget", line_count - 2)); + } + } + } + // Output information about packages if !package_managers.is_empty() { let packages_str: Vec = package_managers From f2aad60a08722fcafeb709dfba27fe232bb3d144 Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Sun, 25 Jan 2026 22:21:57 +0800 Subject: [PATCH 12/91] Add the -p command for packages --- StarFetch/Cargo.lock | 127 ++++++++++++++++++++++++++++++++++++++++ StarFetch/Cargo.toml | 1 + StarFetch/src/main.rs | 26 ++++++-- StarFetch/src/system.rs | 123 ++++++++++++++++++++++++++++++-------- 4 files changed, 247 insertions(+), 30 deletions(-) diff --git a/StarFetch/Cargo.lock b/StarFetch/Cargo.lock index b222384..8cc59b4 100644 --- a/StarFetch/Cargo.lock +++ b/StarFetch/Cargo.lock @@ -11,6 +11,56 @@ dependencies = [ "winapi", ] +[[package]] +name = "anstream" +version = "0.6.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" + +[[package]] +name = "anstyle-parse" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.61.2", +] + [[package]] name = "bitflags" version = "2.10.0" @@ -23,6 +73,52 @@ version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e93abca9e28e0a1b9877922aacb20576e05d4679ffa78c3d6dc22a26a216659" +[[package]] +name = "clap" +version = "4.5.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6e6ff9dcd79cff5cd969a17a545d79e84ab086e444102a591e288a8aa3ce394" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa42cf4d2b7a41bc8f663a7cab4031ebafa1bf3875705bfaf8466dc60ab52c00" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.49" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a0b5487afeab2deb2ff4e03a807ad1a03ac532ff5a2cee5d86884440c7f7671" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3e64b0cc0439b12df2fa678eae89a1c56a529fd067a9115f7827f1fffd22b32" + +[[package]] +name = "colorchoice" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" + [[package]] name = "deranged" version = "0.4.0" @@ -42,6 +138,18 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + [[package]] name = "lazy_static" version = "1.5.0" @@ -116,6 +224,12 @@ dependencies = [ "objc2-core-foundation", ] +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + [[package]] name = "powerfmt" version = "0.2.0" @@ -178,11 +292,18 @@ name = "starfetch" version = "0.1.0" dependencies = [ "ansi_term", + "clap", "sysinfo", "systemstat", "terminal_size", ] +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + [[package]] name = "syn" version = "2.0.104" @@ -257,6 +378,12 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + [[package]] name = "winapi" version = "0.3.9" diff --git a/StarFetch/Cargo.toml b/StarFetch/Cargo.toml index 6015cd0..b33c225 100644 --- a/StarFetch/Cargo.toml +++ b/StarFetch/Cargo.toml @@ -8,3 +8,4 @@ ansi_term = "0.12" sysinfo = "0.37.2" systemstat = "0.2" terminal_size = "0.4.3" +clap = { version = "4.5", features = ["derive"] } diff --git a/StarFetch/src/main.rs b/StarFetch/src/main.rs index 7873f2c..c98e6b8 100644 --- a/StarFetch/src/main.rs +++ b/StarFetch/src/main.rs @@ -3,11 +3,29 @@ mod art; mod hyperlink; mod system; +use clap::Parser; + +#[derive(Parser)] +#[command(name = "starfetch")] +#[command(about = "A Beauty & fast system information tool", long_about = None)] +struct Args { + /// Show installed package count (brew, apt, winget, etc.) + #[arg(short, long, alias = "p")] + packages: bool, +} + fn main() { - // Output the ascii painting + let args = Args::parse(); + + // -p / --packages: only show package count, then exit + if args.packages { + system::print_packages(); + return; + } + + // Full interface println!("{}", art::adaptive_art()); - // Output link & text print!("Developed by "); print!( "{}", @@ -25,11 +43,9 @@ fn main() { ) ); - // Optimization the UI println!(); - // Output system information - let _sys = system::init_system(); // Init the library + let _sys = system::init_system(); system::print_hardware_info(); system::system_uptime(); system::print_packages(); diff --git a/StarFetch/src/system.rs b/StarFetch/src/system.rs index e495151..e10dbd2 100644 --- a/StarFetch/src/system.rs +++ b/StarFetch/src/system.rs @@ -129,34 +129,91 @@ pub fn print_hardware_info() { } } -// System uptime +// Format and print uptime from seconds (shared helper) +fn print_uptime_seconds(secs: u64) { + let days = secs / 86400; + let hours = (secs % 86400) / 3600; + let minutes = (secs % 3600) / 60; + println!( + "{} {} {} {} {} {} {}", + Green.paint("Uptime:"), + Cyan.paint(days.to_string()), + Green.paint("Days"), + Cyan.paint(hours.to_string()), + Green.paint("Hours"), + Cyan.paint(minutes.to_string()), + Green.paint("Minutes") + ); +} + +// Max uptime to consider valid (~10 years) to reject boot_time/epoch bugs on some platforms +const MAX_UPTIME_SECS: u64 = 10 * 365 * 24 * 3600; + +/// On macOS/BSD, try "sysctl -n kern.boottime" and parse secs for fallback. +fn uptime_from_sysctl_kern_boottime() -> Option { + let output = Command::new("sysctl") + .args(["-n", "kern.boottime"]) + .output() + .ok()?; + if !output.status.success() { + return None; + } + // e.g. "{ sec = 1234567890, usec = 123456 }" + let s = String::from_utf8_lossy(&output.stdout); + let s = s.trim(); + let prefix = "sec = "; + let start = s.find(prefix).map(|i| i + prefix.len())?; + let rest = &s[start..]; + let end = rest.find(|c: char| !c.is_ascii_digit()).unwrap_or(rest.len()); + let secs_str = &rest[..end]; + let boot_secs: u64 = secs_str.parse().ok()?; + let now = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .ok()? + .as_secs(); + let uptime = now.saturating_sub(boot_secs); + if uptime <= MAX_UPTIME_SECS { + Some(uptime) + } else { + None + } +} + +// System uptime: try systemstat first, then sysctl (macOS), then sysinfo, else N/A. pub fn system_uptime() { - // Init the sys let sys = System::new(); - - // Match the result of uptime retrieval - match sys.uptime() { - // Successful uptime retrieval - Ok(uptime) => { - // Calculate the time - let days = uptime.as_secs() / 86400; - let hours = (uptime.as_secs() % 86400) / 3600; - let minutes = (uptime.as_secs() % 3600) / 60; - - // Output the Data - println!( - "{} {} {} {} {} {} {}", - Green.paint("Uptime:"), - Cyan.paint(days.to_string()), - Green.paint("Days"), - Cyan.paint(hours.to_string()), - Green.paint("Hours"), - Cyan.paint(minutes.to_string()), - Green.paint("Minutes") - ); + let secs = match sys.uptime() { + Ok(duration) => { + let s = duration.as_secs(); + if s <= MAX_UPTIME_SECS { + Some(s) + } else { + None + } + } + Err(_) => None, + }; + + let secs = secs.or_else(uptime_from_sysctl_kern_boottime).or_else(|| { + let now = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .map(|d| d.as_secs()) + .unwrap_or(0); + let boot = SysInfoSystem::boot_time(); + let mut s = now.saturating_sub(boot); + if s == 0 || s > MAX_UPTIME_SECS { + s = SysInfoSystem::uptime(); } - // Error case for uptime retrieval - Err(e) => eprintln!("Error getting uptime: {}", e), + if s > 0 && s <= MAX_UPTIME_SECS { + Some(s) + } else { + None + } + }); + + match secs { + Some(s) => print_uptime_seconds(s), + None => println!("{} {}", Green.paint("Uptime:"), Cyan.paint("N/A")), } } @@ -228,6 +285,22 @@ pub fn print_packages() { } } + // Yum + if let Ok(output) = Command::new("yum") + .args(["list", "installed"]) + .output() + { + if output.status.success() { + let count = String::from_utf8_lossy(&output.stdout) + .lines() + .filter(|line| !line.trim().is_empty() && !line.contains("Installed packages")) + .count(); + if count > 0 { + package_managers.push(("yum", count)); + } + } + } + // Output information about packages if !package_managers.is_empty() { let packages_str: Vec = package_managers From fdf6358f0eab112b779cdfe4db7a8e6fa9a76edf Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Mon, 26 Jan 2026 14:10:29 +0800 Subject: [PATCH 13/91] Update sys_info to new Version & -c command --- StarFetch/Cargo.lock | 59 +++++++++++++++++++------------------------ StarFetch/Cargo.toml | 2 +- StarFetch/src/main.rs | 8 ++++++ 3 files changed, 35 insertions(+), 34 deletions(-) diff --git a/StarFetch/Cargo.lock b/StarFetch/Cargo.lock index 8cc59b4..2d760a0 100644 --- a/StarFetch/Cargo.lock +++ b/StarFetch/Cargo.lock @@ -317,9 +317,9 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.37.2" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16607d5caffd1c07ce073528f9ed972d88db15dd44023fa57142963be3feb11f" +checksum = "fe840c5b1afe259a5657392a4dbb74473a14c8db999c3ec2f4ae812e028a94da" dependencies = [ "libc", "memchr", @@ -408,47 +408,46 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.61.3" +version = "0.62.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" +checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580" dependencies = [ "windows-collections", "windows-core", "windows-future", - "windows-link 0.1.3", "windows-numerics", ] [[package]] name = "windows-collections" -version = "0.2.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" +checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610" dependencies = [ "windows-core", ] [[package]] name = "windows-core" -version = "0.61.2" +version = "0.62.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" dependencies = [ "windows-implement", "windows-interface", - "windows-link 0.1.3", + "windows-link", "windows-result", "windows-strings", ] [[package]] name = "windows-future" -version = "0.2.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" +checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb" dependencies = [ "windows-core", - "windows-link 0.1.3", + "windows-link", "windows-threading", ] @@ -474,12 +473,6 @@ dependencies = [ "syn", ] -[[package]] -name = "windows-link" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" - [[package]] name = "windows-link" version = "0.2.1" @@ -488,30 +481,30 @@ checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" [[package]] name = "windows-numerics" -version = "0.2.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" +checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26" dependencies = [ "windows-core", - "windows-link 0.1.3", + "windows-link", ] [[package]] name = "windows-result" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" dependencies = [ - "windows-link 0.1.3", + "windows-link", ] [[package]] name = "windows-strings" -version = "0.4.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" dependencies = [ - "windows-link 0.1.3", + "windows-link", ] [[package]] @@ -529,7 +522,7 @@ version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ - "windows-link 0.2.1", + "windows-link", ] [[package]] @@ -538,7 +531,7 @@ version = "0.53.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" dependencies = [ - "windows-link 0.2.1", + "windows-link", "windows_aarch64_gnullvm", "windows_aarch64_msvc", "windows_i686_gnu", @@ -551,11 +544,11 @@ dependencies = [ [[package]] name = "windows-threading" -version = "0.1.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" +checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37" dependencies = [ - "windows-link 0.1.3", + "windows-link", ] [[package]] diff --git a/StarFetch/Cargo.toml b/StarFetch/Cargo.toml index b33c225..30661ae 100644 --- a/StarFetch/Cargo.toml +++ b/StarFetch/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" [dependencies] ansi_term = "0.12" -sysinfo = "0.37.2" +sysinfo = "0.38.0" systemstat = "0.2" terminal_size = "0.4.3" clap = { version = "4.5", features = ["derive"] } diff --git a/StarFetch/src/main.rs b/StarFetch/src/main.rs index c98e6b8..4af7015 100644 --- a/StarFetch/src/main.rs +++ b/StarFetch/src/main.rs @@ -12,6 +12,9 @@ struct Args { /// Show installed package count (brew, apt, winget, etc.) #[arg(short, long, alias = "p")] packages: bool, + /// Show System HardWare information + #[arg(short = 'c', long, alias = "c")] + hardware: bool, } fn main() { @@ -23,6 +26,11 @@ fn main() { return; } + if args.hardware { + system::print_cpu_info(); + return; + } + // Full interface println!("{}", art::adaptive_art()); From d5c0bef21b4526d03b66347e759eeaf7523f5c34 Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Mon, 26 Jan 2026 14:42:30 +0800 Subject: [PATCH 14/91] Update -t for system uptime --- StarFetch/src/main.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/StarFetch/src/main.rs b/StarFetch/src/main.rs index 4af7015..3dc4881 100644 --- a/StarFetch/src/main.rs +++ b/StarFetch/src/main.rs @@ -12,9 +12,12 @@ struct Args { /// Show installed package count (brew, apt, winget, etc.) #[arg(short, long, alias = "p")] packages: bool, - /// Show System HardWare information + /// Show cpu information #[arg(short = 'c', long, alias = "c")] - hardware: bool, + cpu: bool, + /// Show time information + #[arg(short = 't', long, alias = "t")] + time: bool, } fn main() { @@ -26,11 +29,18 @@ fn main() { return; } - if args.hardware { + // -c / --cput: show the cpu information + if args.cpu { system::print_cpu_info(); return; } + // -t / --time: show time information + if args.time { + system::system_uptime(); + return ; + } + // Full interface println!("{}", art::adaptive_art()); From e860b083acd5d7e0c05e947ae2d35d41ee6b0a78 Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Wed, 28 Jan 2026 13:49:22 +0800 Subject: [PATCH 15/91] Updtae more command like -s -d and so on --- .DS_Store | Bin 0 -> 6148 bytes StarFetch/src/main.rs | 39 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..f4382d640631410b0c5054969d99edbfadd196b8 GIT binary patch literal 6148 zcmeHKPfrs;6rTrGwji=Vix@T8*oz4yBBl}J!KI*vc!013O90DmJCv1WrtEI1NJx6t z58wyz19@J@^H@c-A+6HlVFnV`N`4^Lw55elz=i+uhkAgg~iTyG4je2r;k; z%=BZ|#Y9}R4(rh)y@(*^ct|LTNtNt)t&Z$;AXOk$;9pZfJiA%q;8W|8keqscqlOo7 z52NqAM&L*B)YNC_>CK!w-)Hn01IDJa!&^@5#?7eYhU?~B_^!9=(^kdI&2bjH zKBJ)|_%(_t8&7;z@YkB;t66(_A?ar$`DI+~dg{_W}Gf2pJdeDg>f)R@34bh=dLR}XY$@G+_Ei)kjcW%~y%3|<^Ehet+-bHn+3 ze(cit<&i5_E9R)@R(I>6xaK(?@URp#X~i6hu=0f}XG3Q;eI7gh3k;3?Mp&k` zrzb-zhYifhoeaoHABB{%^?K;n7Pq$}8kbM`Yhtx($b(>sM}F*cwzeTxkLlh5+vd2U zxPrxo2t}(jj1W6G1!_C0;Xt2miJdXKZ*~coxmCGfahFkSny>S1V(lcAI zZz#_sg+yW_mv|bX@P5A`{T0R;MbeUr6zs=3#UK-87XNS?WS_LjYx0J?B_GHq@|Aoi zKVT5X;5tmeBoyHe*f0yrunt?`!ZXG1NpANwJ)Z`M(CKo!51fz%oYgU!Fn=YU;a^%1 zW8e&Hkd~e*kSfq!0r7sYunDv^wiU`(2X^uZfSAEyY3Pfygy2{jZH;Y(7(oL?MO0MK zM+{JO9Jh3yt+B08(Fy3o2k4bSpHM)qj`LeGoq(+{?NbF(1%6dPeEXxBV*h{e=kvcz zO1o5nRDu6f0m#fd^ChfJ@2wqGioMptwuMcY$ZIQ<6zueNEFG~Gk7JXDF-tgzw#K$X S96?Jz1f&dUmn!gA75E8_Pt7d= literal 0 HcmV?d00001 diff --git a/StarFetch/src/main.rs b/StarFetch/src/main.rs index 3dc4881..18dd959 100644 --- a/StarFetch/src/main.rs +++ b/StarFetch/src/main.rs @@ -18,6 +18,18 @@ struct Args { /// Show time information #[arg(short = 't', long, alias = "t")] time: bool, + /// Hardware information + #[arg(short = 'k', long, alias = "k")] + hardware: bool, + /// memory information + #[arg(short = 'm', long, alias = "m")] + memory: bool, + /// swap information + #[arg(short = 's', long, alias = "s")] + swap: bool, + /// disk information + #[arg(short = 'd', long, alias = "d")] + disk: bool, } fn main() { @@ -29,7 +41,7 @@ fn main() { return; } - // -c / --cput: show the cpu information + // -c / --cpu: show the cpu information if args.cpu { system::print_cpu_info(); return; @@ -40,6 +52,31 @@ fn main() { system::system_uptime(); return ; } + + // -k / --kernel: show system information + if args.hardware { + system::print_hardware_info(); + return ; + } + + // -m / --memory: show memory information + if args.memory { + system::print_memory_info(); + return ; + } + + // -a / --swap: + if args.swap { + system::print_swap_info(); + return ; + } + + // -d / --disk + if args.disk { + system::print_disk_info(); + return ; + } + // Full interface println!("{}", art::adaptive_art()); From b3ba9130a8a9e6de457204624d75b950670946d2 Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Sat, 31 Jan 2026 14:05:54 +0800 Subject: [PATCH 16/91] Add help info --- StarFetch/Cargo.lock | 2 +- StarFetch/Cargo.toml | 2 +- StarFetch/src/main.rs | 14 ++++++++++++-- StarFetch/src/system.rs | 16 ++++++++++++++++ 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/StarFetch/Cargo.lock b/StarFetch/Cargo.lock index 2d760a0..041a9a7 100644 --- a/StarFetch/Cargo.lock +++ b/StarFetch/Cargo.lock @@ -289,7 +289,7 @@ dependencies = [ [[package]] name = "starfetch" -version = "0.1.0" +version = "0.1.9" dependencies = [ "ansi_term", "clap", diff --git a/StarFetch/Cargo.toml b/StarFetch/Cargo.toml index 30661ae..f660f54 100644 --- a/StarFetch/Cargo.toml +++ b/StarFetch/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "starfetch" -version = "0.1.0" +version = "0.1.9" edition = "2021" [dependencies] diff --git a/StarFetch/src/main.rs b/StarFetch/src/main.rs index 18dd959..6d39569 100644 --- a/StarFetch/src/main.rs +++ b/StarFetch/src/main.rs @@ -6,6 +6,7 @@ mod system; use clap::Parser; #[derive(Parser)] +#[command(disable_help_flag = true)] #[command(name = "starfetch")] #[command(about = "A Beauty & fast system information tool", long_about = None)] struct Args { @@ -30,6 +31,8 @@ struct Args { /// disk information #[arg(short = 'd', long, alias = "d")] disk: bool, + #[arg(short = 'h', long, alias = "h")] + help: bool, } fn main() { @@ -65,18 +68,25 @@ fn main() { return ; } - // -a / --swap: + // -s / --swap: show physical RAM information if args.swap { system::print_swap_info(); return ; } - // -d / --disk + // -d / --disk:show disk information if args.disk { system::print_disk_info(); return ; } + // -h / --help + if args.help { + system::print_system_help_info(); + return ; + + } + // Full interface println!("{}", art::adaptive_art()); diff --git a/StarFetch/src/system.rs b/StarFetch/src/system.rs index e10dbd2..86c04c2 100644 --- a/StarFetch/src/system.rs +++ b/StarFetch/src/system.rs @@ -434,3 +434,19 @@ pub fn print_disk_info() { Cyan.paint((available_space as f64 / 1_073_741_824.0).to_string()) ); } + +pub fn print_system_help_info() { + println!( + "{} {} {} {} {} {} {} {}", + Green.paint("All command for starfetch \n"), + Green.paint("-p / --packages: only show package count, then exit \n"), + Green.paint("-c / --cpu: show the cpu information \n"), + Green.paint("-t / --time: show time information \n"), + Green.paint("-k / --kernel: show system information \n"), + Green.paint("-m / --memory: show memory information \n"), + Green.paint("-s / --swap: show physical RAM information \n"), + Green.paint("-d / --disk: show disk information \n"), + + ); + +} From b80dde67814b5ffcacc483643f84bc2be0d676bc Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Sat, 31 Jan 2026 14:14:22 +0800 Subject: [PATCH 17/91] Delete .DS_Store files --- .DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index f4382d640631410b0c5054969d99edbfadd196b8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKPfrs;6rTrGwji=Vix@T8*oz4yBBl}J!KI*vc!013O90DmJCv1WrtEI1NJx6t z58wyz19@J@^H@c-A+6HlVFnV`N`4^Lw55elz=i+uhkAgg~iTyG4je2r;k; z%=BZ|#Y9}R4(rh)y@(*^ct|LTNtNt)t&Z$;AXOk$;9pZfJiA%q;8W|8keqscqlOo7 z52NqAM&L*B)YNC_>CK!w-)Hn01IDJa!&^@5#?7eYhU?~B_^!9=(^kdI&2bjH zKBJ)|_%(_t8&7;z@YkB;t66(_A?ar$`DI+~dg{_W}Gf2pJdeDg>f)R@34bh=dLR}XY$@G+_Ei)kjcW%~y%3|<^Ehet+-bHn+3 ze(cit<&i5_E9R)@R(I>6xaK(?@URp#X~i6hu=0f}XG3Q;eI7gh3k;3?Mp&k` zrzb-zhYifhoeaoHABB{%^?K;n7Pq$}8kbM`Yhtx($b(>sM}F*cwzeTxkLlh5+vd2U zxPrxo2t}(jj1W6G1!_C0;Xt2miJdXKZ*~coxmCGfahFkSny>S1V(lcAI zZz#_sg+yW_mv|bX@P5A`{T0R;MbeUr6zs=3#UK-87XNS?WS_LjYx0J?B_GHq@|Aoi zKVT5X;5tmeBoyHe*f0yrunt?`!ZXG1NpANwJ)Z`M(CKo!51fz%oYgU!Fn=YU;a^%1 zW8e&Hkd~e*kSfq!0r7sYunDv^wiU`(2X^uZfSAEyY3Pfygy2{jZH;Y(7(oL?MO0MK zM+{JO9Jh3yt+B08(Fy3o2k4bSpHM)qj`LeGoq(+{?NbF(1%6dPeEXxBV*h{e=kvcz zO1o5nRDu6f0m#fd^ChfJ@2wqGioMptwuMcY$ZIQ<6zueNEFG~Gk7JXDF-tgzw#K$X S96?Jz1f&dUmn!gA75E8_Pt7d= From 390ba651100fa49a61629e33dae1995718e28b0a Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sat, 31 Jan 2026 14:28:31 +0800 Subject: [PATCH 18/91] Create brew_update.yml Homebrew! --- .github/workflows/brew_update.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/brew_update.yml diff --git a/.github/workflows/brew_update.yml b/.github/workflows/brew_update.yml new file mode 100644 index 0000000..a943180 --- /dev/null +++ b/.github/workflows/brew_update.yml @@ -0,0 +1,19 @@ +name: Update Homebrew Formula + +on: + release: + types: [published] + +jobs: + update-formula: + runs-on: ubuntu-latest + steps: + - name: Update Homebrew formula + uses: mislav/bump-homebrew-formula-action@v3 + with: + formula-name: starfetch + homebrew-tap: Linus-Shyu/homebrew-tap + base-branch: main + download-url: https://github.com/Linus-Shyu/StarFetch_Core/archive/refs/tags/${{ github.event.release.tag_name }}.tar.gz + env: + COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} From 3998932aef7148b913cf6b32faf876fba0d0110d Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sat, 31 Jan 2026 14:35:05 +0800 Subject: [PATCH 19/91] update --- .github/workflows/brew_update.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/brew_update.yml b/.github/workflows/brew_update.yml index a943180..5f6f8da 100644 --- a/.github/workflows/brew_update.yml +++ b/.github/workflows/brew_update.yml @@ -1,11 +1,11 @@ -name: Update Homebrew Formula +name: Auto Update Homebrew Formula on: release: - types: [published] - + types: [published] + jobs: - update-formula: + homebrew: runs-on: ubuntu-latest steps: - name: Update Homebrew formula @@ -13,7 +13,6 @@ jobs: with: formula-name: starfetch homebrew-tap: Linus-Shyu/homebrew-tap - base-branch: main download-url: https://github.com/Linus-Shyu/StarFetch_Core/archive/refs/tags/${{ github.event.release.tag_name }}.tar.gz env: COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} From ca3ad3f04a8b0f50b6aaf6cc44054af02eb6f11e Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sat, 31 Jan 2026 14:38:01 +0800 Subject: [PATCH 20/91] update --- .github/workflows/brew_update.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/brew_update.yml b/.github/workflows/brew_update.yml index 5f6f8da..42ec1f1 100644 --- a/.github/workflows/brew_update.yml +++ b/.github/workflows/brew_update.yml @@ -1,11 +1,11 @@ -name: Auto Update Homebrew Formula +name: Update Homebrew on: release: - types: [published] + types: [published] # 关键:只有当 Release 真正发布成功后才触发 jobs: - homebrew: + update-formula: runs-on: ubuntu-latest steps: - name: Update Homebrew formula @@ -13,6 +13,7 @@ jobs: with: formula-name: starfetch homebrew-tap: Linus-Shyu/homebrew-tap + # 使用触发该流程的 tag 名 download-url: https://github.com/Linus-Shyu/StarFetch_Core/archive/refs/tags/${{ github.event.release.tag_name }}.tar.gz env: COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} From 3fd9fae2b7f74a58e578bcfc01dd8d60b58f900d Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Sat, 31 Jan 2026 14:51:07 +0800 Subject: [PATCH 21/91] Update homebrew --- README.md | 7 +++++++ StarFetch/src/main.rs | 2 ++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index b3355de..fc158d3 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,13 @@ Used Memory: 10.79 GB ## 🚀 Installation +### HomeBrew + +```bash +brew tap Linus-Shyu/tap +brew install starfetch +``` + ### Prerequisites * **Rust** (latest stable version) - [Install Rust](https://www.rust-lang.org/tools/install) diff --git a/StarFetch/src/main.rs b/StarFetch/src/main.rs index 6d39569..445bf2c 100644 --- a/StarFetch/src/main.rs +++ b/StarFetch/src/main.rs @@ -119,3 +119,5 @@ fn main() { system::print_swap_info(); system::print_disk_info(); } + +// Just wanna test homebrew. From 7a9ee339c65f48e5f83fcdc690529a19f5a0e800 Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sat, 31 Jan 2026 15:01:16 +0800 Subject: [PATCH 22/91] Update brew_update.yml --- .github/workflows/brew_update.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/brew_update.yml b/.github/workflows/brew_update.yml index 42ec1f1..0866736 100644 --- a/.github/workflows/brew_update.yml +++ b/.github/workflows/brew_update.yml @@ -1,11 +1,15 @@ -name: Update Homebrew +name: Homebrew Update on: - release: - types: [published] # 关键:只有当 Release 真正发布成功后才触发 + workflow_run: + workflows: ["Release Build"] # 必须完全对应主角本的 name + types: + - completed jobs: update-formula: + # 只有当主角本成功完成时才运行 + if: ${{ github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-latest steps: - name: Update Homebrew formula @@ -13,7 +17,7 @@ jobs: with: formula-name: starfetch homebrew-tap: Linus-Shyu/homebrew-tap - # 使用触发该流程的 tag 名 - download-url: https://github.com/Linus-Shyu/StarFetch_Core/archive/refs/tags/${{ github.event.release.tag_name }}.tar.gz + # 自动获取触发主角本的那个标签名(如 v0.2.0) + download-url: https://github.com/Linus-Shyu/StarFetch_Core/archive/refs/tags/${{ github.event.workflow_run.head_branch }}.tar.gz env: COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} From 62a69aeea7fd9394818d4426a3eff13569c9f27a Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Sat, 31 Jan 2026 15:02:19 +0800 Subject: [PATCH 23/91] Test --- StarFetch/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/StarFetch/Cargo.toml b/StarFetch/Cargo.toml index f660f54..fc47434 100644 --- a/StarFetch/Cargo.toml +++ b/StarFetch/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "starfetch" -version = "0.1.9" +version = "0.2.1" edition = "2021" [dependencies] From f7f81e8fcf503b72fce2bf2dc5c31ec9740e4592 Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sat, 31 Jan 2026 15:07:33 +0800 Subject: [PATCH 24/91] Delete .github/workflows/brew_update.yml --- .github/workflows/brew_update.yml | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 .github/workflows/brew_update.yml diff --git a/.github/workflows/brew_update.yml b/.github/workflows/brew_update.yml deleted file mode 100644 index 0866736..0000000 --- a/.github/workflows/brew_update.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Homebrew Update - -on: - workflow_run: - workflows: ["Release Build"] # 必须完全对应主角本的 name - types: - - completed - -jobs: - update-formula: - # 只有当主角本成功完成时才运行 - if: ${{ github.event.workflow_run.conclusion == 'success' }} - runs-on: ubuntu-latest - steps: - - name: Update Homebrew formula - uses: mislav/bump-homebrew-formula-action@v3 - with: - formula-name: starfetch - homebrew-tap: Linus-Shyu/homebrew-tap - # 自动获取触发主角本的那个标签名(如 v0.2.0) - download-url: https://github.com/Linus-Shyu/StarFetch_Core/archive/refs/tags/${{ github.event.workflow_run.head_branch }}.tar.gz - env: - COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} From f3e3fe21a2ad25717f9d4fba0e18bed89197773a Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sat, 31 Jan 2026 15:08:37 +0800 Subject: [PATCH 25/91] Update Release.yml --- .github/workflows/Release.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index c478fa9..c754198 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -3,9 +3,10 @@ name: Release Build on: push: tags: - - 'v*.*.*' # 当推送版本标签时触发,如 v0.2.0 + - 'v*.*.*' # 当推送版本标签时触发,如 v0.2.1 jobs: + # 第一阶段:多平台编译 build: name: Build for ${{ matrix.os }} strategy: @@ -86,6 +87,7 @@ jobs: name: ${{ matrix.artifact_name }} path: StarFetch/${{ matrix.artifact_name }}.${{ matrix.archive_format }} + # 第二阶段:创建 GitHub Release release: name: Create Release needs: build @@ -111,7 +113,6 @@ jobs: ## Changes in ${{ steps.tag.outputs.TAG }} ### Downloads - - **Linux (x86_64)**: [starfetch-linux-x86_64.tar.gz](https://github.com/${{ github.repository }}/releases/download/${{ steps.tag.outputs.TAG }}/starfetch-linux-x86_64.tar.gz) - **Windows (x86_64)**: [starfetch-windows-x86_64.zip](https://github.com/${{ github.repository }}/releases/download/${{ steps.tag.outputs.TAG }}/starfetch-windows-x86_64.zip) - **macOS (Intel)**: [starfetch-macos-x86_64.tar.gz](https://github.com/${{ github.repository }}/releases/download/${{ steps.tag.outputs.TAG }}/starfetch-macos-x86_64.tar.gz) @@ -122,3 +123,19 @@ jobs: artifacts/*/starfetch-*.zip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # 第三阶段:全自动更新 Homebrew Tap + homebrew: + name: Update Homebrew Formula + needs: release # 确保 Release 发布成功后再更新 + runs-on: ubuntu-latest + steps: + - name: Update Homebrew formula + uses: mislav/bump-homebrew-formula-action@v3 + with: + formula-name: starfetch + homebrew-tap: Linus-Shyu/homebrew-tap + download-url: https://github.com/Linus-Shyu/StarFetch_Core/archive/refs/tags/${{ github.ref_name }}.tar.gz + env: + # 必须使用你之前生成的具备 repo 权限的个人 Token + COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} From 35de59284888471a70d760838ffa59eab4353f60 Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Sat, 31 Jan 2026 15:10:09 +0800 Subject: [PATCH 26/91] V0.2.0 --- StarFetch/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/StarFetch/Cargo.toml b/StarFetch/Cargo.toml index fc47434..9910ddd 100644 --- a/StarFetch/Cargo.toml +++ b/StarFetch/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "starfetch" -version = "0.2.1" +version = "0.2.0" edition = "2021" [dependencies] From 1292e1619910a4845b741df0f0ce3e3610e2b8f2 Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sat, 31 Jan 2026 21:13:08 +0800 Subject: [PATCH 27/91] Update Release.yml --- .github/workflows/Release.yml | 36 ++++++----------------------------- 1 file changed, 6 insertions(+), 30 deletions(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index c754198..3b69b37 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -3,10 +3,9 @@ name: Release Build on: push: tags: - - 'v*.*.*' # 当推送版本标签时触发,如 v0.2.1 + - 'v*.*.*' jobs: - # 第一阶段:多平台编译 build: name: Build for ${{ matrix.os }} strategy: @@ -45,14 +44,7 @@ jobs: with: targets: ${{ matrix.target }} - - name: Setup MSVC (Windows only) - if: runner.os == 'Windows' - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: x64 - toolset: 14.29 - - - name: Cache cargo dependencies + - name: Cache cargo uses: actions/cache@v4 with: path: | @@ -64,21 +56,20 @@ jobs: key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Build release binary + # 确保在子目录下执行编译 working-directory: StarFetch run: cargo build --release --target ${{ matrix.target }} - name: Create archive (Linux/macOS) if: runner.os != 'Windows' working-directory: StarFetch/target/${{ matrix.target }}/release - run: | - tar czf ../../../${{ matrix.artifact_name }}.${{ matrix.archive_format }} ${{ matrix.binary_name }} + run: tar czf ../../../${{ matrix.artifact_name }}.${{ matrix.archive_format }} ${{ matrix.binary_name }} shell: bash - name: Create archive (Windows) if: runner.os == 'Windows' working-directory: StarFetch/target/${{ matrix.target }}/release - run: | - Compress-Archive -Path ${{ matrix.binary_name }} -DestinationPath ../../../${{ matrix.artifact_name }}.${{ matrix.archive_format }} + run: Compress-Archive -Path ${{ matrix.binary_name }} -DestinationPath ../../../${{ matrix.artifact_name }}.${{ matrix.archive_format }} shell: pwsh - name: Upload artifact @@ -87,47 +78,33 @@ jobs: name: ${{ matrix.artifact_name }} path: StarFetch/${{ matrix.artifact_name }}.${{ matrix.archive_format }} - # 第二阶段:创建 GitHub Release release: name: Create Release needs: build runs-on: ubuntu-latest permissions: contents: write - steps: - name: Download all artifacts uses: actions/download-artifact@v4 with: path: ./artifacts - - name: Extract tag name id: tag run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT - - name: Create Release uses: softprops/action-gh-release@v1 with: name: Release ${{ steps.tag.outputs.TAG }} - body: | - ## Changes in ${{ steps.tag.outputs.TAG }} - - ### Downloads - - **Linux (x86_64)**: [starfetch-linux-x86_64.tar.gz](https://github.com/${{ github.repository }}/releases/download/${{ steps.tag.outputs.TAG }}/starfetch-linux-x86_64.tar.gz) - - **Windows (x86_64)**: [starfetch-windows-x86_64.zip](https://github.com/${{ github.repository }}/releases/download/${{ steps.tag.outputs.TAG }}/starfetch-windows-x86_64.zip) - - **macOS (Intel)**: [starfetch-macos-x86_64.tar.gz](https://github.com/${{ github.repository }}/releases/download/${{ steps.tag.outputs.TAG }}/starfetch-macos-x86_64.tar.gz) - - **macOS (Apple Silicon)**: [starfetch-macos-aarch64.tar.gz](https://github.com/${{ github.repository }}/releases/download/${{ steps.tag.outputs.TAG }}/starfetch-macos-aarch64.tar.gz) - files: | artifacts/*/starfetch-*.tar.gz artifacts/*/starfetch-*.zip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # 第三阶段:全自动更新 Homebrew Tap homebrew: name: Update Homebrew Formula - needs: release # 确保 Release 发布成功后再更新 + needs: release runs-on: ubuntu-latest steps: - name: Update Homebrew formula @@ -137,5 +114,4 @@ jobs: homebrew-tap: Linus-Shyu/homebrew-tap download-url: https://github.com/Linus-Shyu/StarFetch_Core/archive/refs/tags/${{ github.ref_name }}.tar.gz env: - # 必须使用你之前生成的具备 repo 权限的个人 Token COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} From b991d766beef705d46752c575bc57d193fab0f64 Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Sun, 1 Feb 2026 14:00:11 +0800 Subject: [PATCH 28/91] Update about info --- StarFetch/Cargo.lock | 2 +- StarFetch/src/main.rs | 7 +++++++ StarFetch/src/system.rs | 8 ++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/StarFetch/Cargo.lock b/StarFetch/Cargo.lock index 041a9a7..4d97822 100644 --- a/StarFetch/Cargo.lock +++ b/StarFetch/Cargo.lock @@ -289,7 +289,7 @@ dependencies = [ [[package]] name = "starfetch" -version = "0.1.9" +version = "0.2.0" dependencies = [ "ansi_term", "clap", diff --git a/StarFetch/src/main.rs b/StarFetch/src/main.rs index 445bf2c..c485760 100644 --- a/StarFetch/src/main.rs +++ b/StarFetch/src/main.rs @@ -33,6 +33,8 @@ struct Args { disk: bool, #[arg(short = 'h', long, alias = "h")] help: bool, + #[arg(short = 'a', long, alias = "a")] + about: bool, } fn main() { @@ -86,6 +88,11 @@ fn main() { return ; } + // -a / --about + if args.about { + system::print_about(); + return ; + } // Full interface diff --git a/StarFetch/src/system.rs b/StarFetch/src/system.rs index 86c04c2..eea4279 100644 --- a/StarFetch/src/system.rs +++ b/StarFetch/src/system.rs @@ -450,3 +450,11 @@ pub fn print_system_help_info() { ); } + +pub fn print_about() { + println!( + "{} {}", + Green.paint("Github Address:https://github.com/Linus-Shyu/StarFetch_Core \n"), + Green.paint("Thanks all users! \n"), + ); +} From 86d41c0640ed890cca9b376b67fb20a68602a696 Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 14:30:56 +0800 Subject: [PATCH 29/91] Update Release.yml --- .github/workflows/Release.yml | 48 ++++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 3b69b37..e6498e8 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -6,6 +6,7 @@ on: - 'v*.*.*' jobs: + # 1. 跨平台二进制构建 build: name: Build for ${{ matrix.os }} strategy: @@ -56,7 +57,6 @@ jobs: key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Build release binary - # 确保在子目录下执行编译 working-directory: StarFetch run: cargo build --release --target ${{ matrix.target }} @@ -78,8 +78,9 @@ jobs: name: ${{ matrix.artifact_name }} path: StarFetch/${{ matrix.artifact_name }}.${{ matrix.archive_format }} + # 2. 创建 GitHub Release 并上传附件 release: - name: Create Release + name: Create GitHub Release needs: build runs-on: ubuntu-latest permissions: @@ -102,6 +103,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # 3. 自动更新 Homebrew Tap (复用 HOMEBREW_TAP_TOKEN) homebrew: name: Update Homebrew Formula needs: release @@ -112,6 +114,46 @@ jobs: with: formula-name: starfetch homebrew-tap: Linus-Shyu/homebrew-tap - download-url: https://github.com/Linus-Shyu/StarFetch_Core/archive/refs/tags/${{ github.ref_name }}.tar.gz + download-url: https://github.com/Linus-Shyu/StarFetch_Core/releases/download/${{ github.ref_name }}/starfetch-macos-x86_64.tar.gz env: COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} + + # 4. 发布到 APT (Cloudsmith) + apt: + name: Push to APT Repository + needs: release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + - name: Install cargo-deb + run: cargo install cargo-deb + - name: Build .deb package + working-directory: StarFetch + run: cargo deb --target x86_64-unknown-linux-gnu + - name: Push to Cloudsmith + uses: cloudsmith-io/cloudsmith-action@v1 + with: + api-key: ${{ secrets.CLOUDSMITH_API_KEY }} + command: push + format: deb + owner: starlakeai + repo: starfetch + distro: any-distro + release: any-version + file: StarFetch/target/x86_64-unknown-linux-gnu/debian/*.deb + + # 5. 发布到 WinGet (复用 HOMEBREW_TAP_TOKEN) + winget: + name: Submit to WinGet + needs: release + runs-on: ubuntu-latest + steps: + - name: Submit to WinGet + uses: vedantmgoyal2009/winget-releaser@v2 + with: + identifier: StarLakeAI.StarFetch + installers-regex: '.*-windows-x86_64\.zip$' + token: ${{ secrets.HOMEBREW_TAP_TOKEN }} From 9608481010f10b0c89194dfaf2ca2cc6852ff2bd Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 14:38:59 +0800 Subject: [PATCH 30/91] Update Release.yml --- .github/workflows/Release.yml | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index e6498e8..d1aa9c1 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -6,7 +6,6 @@ on: - 'v*.*.*' jobs: - # 1. 跨平台二进制构建 build: name: Build for ${{ matrix.os }} strategy: @@ -78,7 +77,6 @@ jobs: name: ${{ matrix.artifact_name }} path: StarFetch/${{ matrix.artifact_name }}.${{ matrix.archive_format }} - # 2. 创建 GitHub Release 并上传附件 release: name: Create GitHub Release needs: build @@ -103,7 +101,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # 3. 自动更新 Homebrew Tap (复用 HOMEBREW_TAP_TOKEN) homebrew: name: Update Homebrew Formula needs: release @@ -118,7 +115,6 @@ jobs: env: COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} - # 4. 发布到 APT (Cloudsmith) apt: name: Push to APT Repository needs: release @@ -133,19 +129,16 @@ jobs: - name: Build .deb package working-directory: StarFetch run: cargo deb --target x86_64-unknown-linux-gnu - - name: Push to Cloudsmith - uses: cloudsmith-io/cloudsmith-action@v1 + # 核心修正:使用官方的 Setup Action 安装 CLI + - name: Setup Cloudsmith CLI + uses: cloudsmith-io/setup-cloudsmith@v1 with: api-key: ${{ secrets.CLOUDSMITH_API_KEY }} - command: push - format: deb - owner: starlakeai - repo: starfetch - distro: any-distro - release: any-version - file: StarFetch/target/x86_64-unknown-linux-gnu/debian/*.deb + # 核心修正:执行推送命令 + - name: Push to Cloudsmith + run: | + cloudsmith push deb starlakeai/starfetch/any-distro/any-version StarFetch/target/x86_64-unknown-linux-gnu/debian/*.deb - # 5. 发布到 WinGet (复用 HOMEBREW_TAP_TOKEN) winget: name: Submit to WinGet needs: release From 6380f6e3b593e9d9dbe6b64650c4dcd8f61d881e Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 14:42:27 +0800 Subject: [PATCH 31/91] Create winget-init.yml --- .github/workflows/winget-init.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/winget-init.yml diff --git a/.github/workflows/winget-init.yml b/.github/workflows/winget-init.yml new file mode 100644 index 0000000..2b9515b --- /dev/null +++ b/.github/workflows/winget-init.yml @@ -0,0 +1,15 @@ +name: WinGet First Submission + +on: + workflow_dispatch: # 允许你手动点击按钮触发 + +jobs: + komac: + runs-on: ubuntu-latest + steps: + - name: Submit to WinGet via Komac + uses: xet7/komac-action@v1 # 使用 Komac 动作 + with: + # 你的 Release 下载地址 + args: update StarLakeAI.StarFetch --version 0.2.3 --urls https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.3/starfetch-windows-x86_64.zip + token: ${{ secrets.HOMEBREW_TAP_TOKEN }} From 6c10d8fb0fd78b4bc1ce8fa81be7ff5a8580ff6a Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 14:43:58 +0800 Subject: [PATCH 32/91] Update winget-init.yml --- .github/workflows/winget-init.yml | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/winget-init.yml b/.github/workflows/winget-init.yml index 2b9515b..2e84838 100644 --- a/.github/workflows/winget-init.yml +++ b/.github/workflows/winget-init.yml @@ -1,15 +1,27 @@ -name: WinGet First Submission +name: WinGet First Submission (Manual) on: workflow_dispatch: # 允许你手动点击按钮触发 jobs: - komac: + submit: runs-on: ubuntu-latest steps: - - name: Submit to WinGet via Komac - uses: xet7/komac-action@v1 # 使用 Komac 动作 - with: - # 你的 Release 下载地址 - args: update StarLakeAI.StarFetch --version 0.2.3 --urls https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.3/starfetch-windows-x86_64.zip - token: ${{ secrets.HOMEBREW_TAP_TOKEN }} + - name: Checkout code + uses: actions/checkout@v4 + + # 1. 直接下载并安装 Komac (用 Rust 写的跨平台 WinGet 提交工具) + - name: Install Komac + run: | + curl -L https://github.com/EdwardG-W/komac/releases/latest/download/komac-x86_64-unknown-linux-musl.tar.gz | tar -xz + sudo mv komac /usr/local/bin/ + komac --version + + # 2. 执行首发提交 + # 这会生成清单、验证哈希并直接给微软提交 PR + - name: Submit New Package to WinGet + run: | + komac new StarLakeAI.StarFetch \ + --version 0.2.3 \ + --url https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.3/starfetch-windows-x86_64.zip \ + --token ${{ secrets.HOMEBREW_TAP_TOKEN }} From 8b46021d6cc47273371c000581c8361050c2fcf9 Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 14:45:44 +0800 Subject: [PATCH 33/91] Update winget-init.yml --- .github/workflows/winget-init.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/winget-init.yml b/.github/workflows/winget-init.yml index 2e84838..ebdc3fd 100644 --- a/.github/workflows/winget-init.yml +++ b/.github/workflows/winget-init.yml @@ -1,7 +1,7 @@ name: WinGet First Submission (Manual) on: - workflow_dispatch: # 允许你手动点击按钮触发 + workflow_dispatch: jobs: submit: @@ -10,15 +10,18 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - # 1. 直接下载并安装 Komac (用 Rust 写的跨平台 WinGet 提交工具) + # 1. 使用 GitHub 官方 CLI 稳健下载 Komac - name: Install Komac + env: + GH_TOKEN: ${{ github.token }} run: | - curl -L https://github.com/EdwardG-W/komac/releases/latest/download/komac-x86_64-unknown-linux-musl.tar.gz | tar -xz + # 自动寻找最新版并下载对应的 linux-musl 包 + gh release download --repo EdwardG-W/komac --pattern "*x86_64-unknown-linux-musl.tar.gz" + tar -xzf *.tar.gz sudo mv komac /usr/local/bin/ komac --version # 2. 执行首发提交 - # 这会生成清单、验证哈希并直接给微软提交 PR - name: Submit New Package to WinGet run: | komac new StarLakeAI.StarFetch \ From 9212063ee7b52933e15977366bf156a9d5eafa2a Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 14:47:10 +0800 Subject: [PATCH 34/91] Update winget-init.yml --- .github/workflows/winget-init.yml | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/.github/workflows/winget-init.yml b/.github/workflows/winget-init.yml index ebdc3fd..5aca12e 100644 --- a/.github/workflows/winget-init.yml +++ b/.github/workflows/winget-init.yml @@ -10,21 +10,13 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - # 1. 使用 GitHub 官方 CLI 稳健下载 Komac - - name: Install Komac - env: - GH_TOKEN: ${{ github.token }} - run: | - # 自动寻找最新版并下载对应的 linux-musl 包 - gh release download --repo EdwardG-W/komac --pattern "*x86_64-unknown-linux-musl.tar.gz" - tar -xzf *.tar.gz - sudo mv komac /usr/local/bin/ - komac --version - - # 2. 执行首发提交 - - name: Submit New Package to WinGet - run: | - komac new StarLakeAI.StarFetch \ - --version 0.2.3 \ - --url https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.3/starfetch-windows-x86_64.zip \ + # 1. 使用专用的 Komac Action (自动处理安装) + - name: Run Komac New + uses: michidk/run-komac@v2 + with: + # 执行“创建新包”指令 + args: > + new StarLakeAI.StarFetch + --version 0.2.3 + --url https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.3/starfetch-windows-x86_64.zip --token ${{ secrets.HOMEBREW_TAP_TOKEN }} From 7aa3cbed25da3a76e1e62b8b786940bb34d4459a Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 14:48:24 +0800 Subject: [PATCH 35/91] Update winget-init.yml --- .github/workflows/winget-init.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/winget-init.yml b/.github/workflows/winget-init.yml index 5aca12e..f5a2f08 100644 --- a/.github/workflows/winget-init.yml +++ b/.github/workflows/winget-init.yml @@ -10,13 +10,11 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - # 1. 使用专用的 Komac Action (自动处理安装) - name: Run Komac New uses: michidk/run-komac@v2 with: - # 执行“创建新包”指令 args: > new StarLakeAI.StarFetch --version 0.2.3 - --url https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.3/starfetch-windows-x86_64.zip + --urls https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.3/starfetch-windows-x86_64.zip --token ${{ secrets.HOMEBREW_TAP_TOKEN }} From f0fa6d6ff8283b3511ce597c098a95de32ebc138 Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 14:49:46 +0800 Subject: [PATCH 36/91] Update winget-init.yml --- .github/workflows/winget-init.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/winget-init.yml b/.github/workflows/winget-init.yml index f5a2f08..f5923a3 100644 --- a/.github/workflows/winget-init.yml +++ b/.github/workflows/winget-init.yml @@ -18,3 +18,9 @@ jobs: --version 0.2.3 --urls https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.3/starfetch-windows-x86_64.zip --token ${{ secrets.HOMEBREW_TAP_TOKEN }} + --submit + --interactive false + --publisher "Star Lake AI" + --name "StarFetch" + --description "A fast and beautiful system information fetch tool written in Rust." + --license "MIT" From 92b6bfda9ff3130559c37ba140bc63d3513efbdd Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 14:51:00 +0800 Subject: [PATCH 37/91] Refactor arguments for Komac New command --- .github/workflows/winget-init.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/winget-init.yml b/.github/workflows/winget-init.yml index f5923a3..57de3c9 100644 --- a/.github/workflows/winget-init.yml +++ b/.github/workflows/winget-init.yml @@ -14,13 +14,13 @@ jobs: uses: michidk/run-komac@v2 with: args: > - new StarLakeAI.StarFetch + new --version 0.2.3 --urls https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.3/starfetch-windows-x86_64.zip --token ${{ secrets.HOMEBREW_TAP_TOKEN }} - --submit - --interactive false --publisher "Star Lake AI" --name "StarFetch" --description "A fast and beautiful system information fetch tool written in Rust." --license "MIT" + --submit + StarLakeAI.StarFetch From 7130a48c9d028cc8b6d34421a07b95aeb84051a6 Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 14:52:19 +0800 Subject: [PATCH 38/91] Update winget-init.yml --- .github/workflows/winget-init.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/winget-init.yml b/.github/workflows/winget-init.yml index 57de3c9..37ed000 100644 --- a/.github/workflows/winget-init.yml +++ b/.github/workflows/winget-init.yml @@ -19,8 +19,5 @@ jobs: --urls https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.3/starfetch-windows-x86_64.zip --token ${{ secrets.HOMEBREW_TAP_TOKEN }} --publisher "Star Lake AI" - --name "StarFetch" - --description "A fast and beautiful system information fetch tool written in Rust." - --license "MIT" --submit StarLakeAI.StarFetch From 62481e4a7cd5696ff6087b9a9480aa3542df14b1 Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 14:53:52 +0800 Subject: [PATCH 39/91] Update winget-init.yml --- .github/workflows/winget-init.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/winget-init.yml b/.github/workflows/winget-init.yml index 37ed000..aa01e67 100644 --- a/.github/workflows/winget-init.yml +++ b/.github/workflows/winget-init.yml @@ -13,7 +13,9 @@ jobs: - name: Run Komac New uses: michidk/run-komac@v2 with: + # 核心修复:将 --interactive false 放在最前面作为全局参数 args: > + --interactive false new --version 0.2.3 --urls https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.3/starfetch-windows-x86_64.zip From d58bc3f6a8c06485a92851a44ae841f47ff5338f Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 14:56:10 +0800 Subject: [PATCH 40/91] Update winget-init.yml --- .github/workflows/winget-init.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/winget-init.yml b/.github/workflows/winget-init.yml index aa01e67..3c2d3c6 100644 --- a/.github/workflows/winget-init.yml +++ b/.github/workflows/winget-init.yml @@ -13,13 +13,15 @@ jobs: - name: Run Komac New uses: michidk/run-komac@v2 with: - # 核心修复:将 --interactive false 放在最前面作为全局参数 + # 这次一次性喂饱它所有的必填字段,杜绝交互 args: > - --interactive false new + --publisher "Star Lake AI" + --name "StarFetch" + --description "A fast and beautiful system information fetch tool written in Rust." + --license "MIT" + --urls "https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.3/starfetch-windows-x86_64.zip" --version 0.2.3 - --urls https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.3/starfetch-windows-x86_64.zip --token ${{ secrets.HOMEBREW_TAP_TOKEN }} - --publisher "Star Lake AI" --submit StarLakeAI.StarFetch From 704896b6077b1d4cc83ea3327bde265352bceefa Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 15:02:41 +0800 Subject: [PATCH 41/91] Update winget-init.yml --- .github/workflows/winget-init.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/winget-init.yml b/.github/workflows/winget-init.yml index 3c2d3c6..4c76d21 100644 --- a/.github/workflows/winget-init.yml +++ b/.github/workflows/winget-init.yml @@ -12,16 +12,16 @@ jobs: - name: Run Komac New uses: michidk/run-komac@v2 + env: + GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} with: - # 这次一次性喂饱它所有的必填字段,杜绝交互 args: > new + StarLakeAI.StarFetch --publisher "Star Lake AI" - --name "StarFetch" - --description "A fast and beautiful system information fetch tool written in Rust." + --package-name "StarFetch" + --short-description "A fast and beautiful system information fetch tool written in Rust." --license "MIT" --urls "https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.3/starfetch-windows-x86_64.zip" --version 0.2.3 - --token ${{ secrets.HOMEBREW_TAP_TOKEN }} --submit - StarLakeAI.StarFetch From 77852a370a8a941171111540e6c3df738ecd41dd Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 15:09:24 +0800 Subject: [PATCH 42/91] Update winget-init.yml --- .github/workflows/winget-init.yml | 38 +++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/.github/workflows/winget-init.yml b/.github/workflows/winget-init.yml index 4c76d21..e0e9b91 100644 --- a/.github/workflows/winget-init.yml +++ b/.github/workflows/winget-init.yml @@ -1,5 +1,6 @@ name: WinGet First Submission (Manual) +# 若 CI 运行失败(komac 需要 TTY),请在本地终端运行下方命令完成首次提交。 on: workflow_dispatch: @@ -10,18 +11,31 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Run Komac New - uses: michidk/run-komac@v2 + - name: Install Komac + uses: cargo-bins/cargo-binstall@main + - run: cargo binstall komac --no-confirm + env: + GITHUB_TOKEN: ${{ github.token }} + + - name: Run Komac New (with pseudo-TTY) + shell: script -q -e -c "bash -c '{0}'" env: GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} - with: - args: > - new - StarLakeAI.StarFetch - --publisher "Star Lake AI" - --package-name "StarFetch" - --short-description "A fast and beautiful system information fetch tool written in Rust." - --license "MIT" - --urls "https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.3/starfetch-windows-x86_64.zip" - --version 0.2.3 + KOMAC_FORK_OWNER: ${{ github.repository_owner }} + run: | + komac new StarLakeAI.StarFetch \ + --publisher "Star Lake AI" \ + --package-name "StarFetch" \ + --short-description "A fast and beautiful system information fetch tool written in Rust." \ + --license "MIT" \ + --urls "https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.3/starfetch-windows-x86_64.zip" \ + --version 0.2.3 \ + --package-locale en-US \ + --skip-pr-check \ --submit + + - name: Fallback - Manual instructions + if: failure() + run: | + echo "::notice::若 CI 报 TTY 错误,请在本地运行:" + echo " komac new StarLakeAI.StarFetch --publisher \"Star Lake AI\" --package-name \"StarFetch\" --short-description \"A fast and beautiful system information fetch tool written in Rust.\" --license \"MIT\" --urls \"https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.3/starfetch-windows-x86_64.zip\" --version 0.2.3 --package-locale en-US --submit" From 15382c8ecb52c336727bf72b09711fda1938447d Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 15:11:13 +0800 Subject: [PATCH 43/91] Update winget-init.yml --- .github/workflows/winget-init.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/winget-init.yml b/.github/workflows/winget-init.yml index e0e9b91..dd49bd1 100644 --- a/.github/workflows/winget-init.yml +++ b/.github/workflows/winget-init.yml @@ -18,7 +18,7 @@ jobs: GITHUB_TOKEN: ${{ github.token }} - name: Run Komac New (with pseudo-TTY) - shell: script -q -e -c "bash -c '{0}'" + shell: script -q -e -c "bash {0}" env: GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} KOMAC_FORK_OWNER: ${{ github.repository_owner }} From 95e49e81041fdb1646e86d396a3a352ad0ee8dae Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 15:13:30 +0800 Subject: [PATCH 44/91] Update winget-init.yml --- .github/workflows/winget-init.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/winget-init.yml b/.github/workflows/winget-init.yml index dd49bd1..b4629be 100644 --- a/.github/workflows/winget-init.yml +++ b/.github/workflows/winget-init.yml @@ -17,13 +17,18 @@ jobs: env: GITHUB_TOKEN: ${{ github.token }} + - name: Install expect (for unbuffer) + run: sudo apt-get update && sudo apt-get install -y expect + - name: Run Komac New (with pseudo-TTY) shell: script -q -e -c "bash {0}" env: GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} KOMAC_FORK_OWNER: ${{ github.repository_owner }} run: | - komac new StarLakeAI.StarFetch \ + # unbuffer 提供伪 TTY;管道输入自动应答 zip 嵌套选择(空格选中 + 回车确认) + # 若后续有更多提示,可追加更多回车 + printf ' \n\n\n\n\n' | unbuffer -p komac new StarLakeAI.StarFetch \ --publisher "Star Lake AI" \ --package-name "StarFetch" \ --short-description "A fast and beautiful system information fetch tool written in Rust." \ From 66f57548d1b532e04c49b5a45ecd03c83b12ceaa Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Sun, 1 Feb 2026 14:31:40 +0800 Subject: [PATCH 45/91] build: finalize multi-platform distribution pipeline --- StarFetch/Cargo.toml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/StarFetch/Cargo.toml b/StarFetch/Cargo.toml index 9910ddd..d4cb64c 100644 --- a/StarFetch/Cargo.toml +++ b/StarFetch/Cargo.toml @@ -9,3 +9,20 @@ sysinfo = "0.38.0" systemstat = "0.2" terminal_size = "0.4.3" clap = { version = "4.5", features = ["derive"] } + +[package.metadata.deb] +name = "starfetch" +maintainer = "Linus Shyu <0x11@linusshyu.dev>" +section = "utils" +priority = "optional" +description = "A fast and stylish system information fetch tool." +extended-description = """ +StarFetch is a high-performance system information tool written in Rust. +Part of the Star Lake AI ecosystem, designed for speed and aesthetic. +""" + +assets = [ + ["target/release/starfetch", "/usr/bin/starfetch", "755"], +] + +depends = "$auto" From a29087f401d3bdb39d8b8d24fafde35e9cc7a20c Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Sun, 1 Feb 2026 15:16:02 +0800 Subject: [PATCH 46/91] chore: prepare for v0.2.4 full-platform release --- .github/workflows/Release.yml | 2 +- .github/workflows/WinGet-First-Submission.yml | 46 +++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/WinGet-First-Submission.yml diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index d1aa9c1..749b8fe 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -145,7 +145,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Submit to WinGet - uses: vedantmgoyal2009/winget-releaser@v2 + uses: vedantmgoyal9/winget-releaser@main with: identifier: StarLakeAI.StarFetch installers-regex: '.*-windows-x86_64\.zip$' diff --git a/.github/workflows/WinGet-First-Submission.yml b/.github/workflows/WinGet-First-Submission.yml new file mode 100644 index 0000000..b4629be --- /dev/null +++ b/.github/workflows/WinGet-First-Submission.yml @@ -0,0 +1,46 @@ +name: WinGet First Submission (Manual) + +# 若 CI 运行失败(komac 需要 TTY),请在本地终端运行下方命令完成首次提交。 +on: + workflow_dispatch: + +jobs: + submit: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Komac + uses: cargo-bins/cargo-binstall@main + - run: cargo binstall komac --no-confirm + env: + GITHUB_TOKEN: ${{ github.token }} + + - name: Install expect (for unbuffer) + run: sudo apt-get update && sudo apt-get install -y expect + + - name: Run Komac New (with pseudo-TTY) + shell: script -q -e -c "bash {0}" + env: + GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} + KOMAC_FORK_OWNER: ${{ github.repository_owner }} + run: | + # unbuffer 提供伪 TTY;管道输入自动应答 zip 嵌套选择(空格选中 + 回车确认) + # 若后续有更多提示,可追加更多回车 + printf ' \n\n\n\n\n' | unbuffer -p komac new StarLakeAI.StarFetch \ + --publisher "Star Lake AI" \ + --package-name "StarFetch" \ + --short-description "A fast and beautiful system information fetch tool written in Rust." \ + --license "MIT" \ + --urls "https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.3/starfetch-windows-x86_64.zip" \ + --version 0.2.3 \ + --package-locale en-US \ + --skip-pr-check \ + --submit + + - name: Fallback - Manual instructions + if: failure() + run: | + echo "::notice::若 CI 报 TTY 错误,请在本地运行:" + echo " komac new StarLakeAI.StarFetch --publisher \"Star Lake AI\" --package-name \"StarFetch\" --short-description \"A fast and beautiful system information fetch tool written in Rust.\" --license \"MIT\" --urls \"https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.3/starfetch-windows-x86_64.zip\" --version 0.2.3 --package-locale en-US --submit" From 02397cc156fad86b66f62e946dfe41e58f14604d Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 15:24:17 +0800 Subject: [PATCH 47/91] Update Release.yml --- .github/workflows/Release.yml | 47 +++++++++++++---------------------- 1 file changed, 17 insertions(+), 30 deletions(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 749b8fe..d056334 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -6,8 +6,9 @@ on: - 'v*.*.*' jobs: + # 1. 跨平台构建 (Linux, Windows, macOS) build: - name: Build for ${{ matrix.os }} + name: Build for ${{ matrix.target }} strategy: fail-fast: false matrix: @@ -44,32 +45,19 @@ jobs: with: targets: ${{ matrix.target }} - - name: Cache cargo - uses: actions/cache@v4 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - StarFetch/target/ - key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - name: Build release binary working-directory: StarFetch run: cargo build --release --target ${{ matrix.target }} - - name: Create archive (Linux/macOS) + - name: Create archive (Unix) if: runner.os != 'Windows' working-directory: StarFetch/target/${{ matrix.target }}/release run: tar czf ../../../${{ matrix.artifact_name }}.${{ matrix.archive_format }} ${{ matrix.binary_name }} - shell: bash - name: Create archive (Windows) if: runner.os == 'Windows' working-directory: StarFetch/target/${{ matrix.target }}/release run: Compress-Archive -Path ${{ matrix.binary_name }} -DestinationPath ../../../${{ matrix.artifact_name }}.${{ matrix.archive_format }} - shell: pwsh - name: Upload artifact uses: actions/upload-artifact@v4 @@ -77,6 +65,7 @@ jobs: name: ${{ matrix.artifact_name }} path: StarFetch/${{ matrix.artifact_name }}.${{ matrix.archive_format }} + # 2. 创建 GitHub Release release: name: Create GitHub Release needs: build @@ -88,21 +77,18 @@ jobs: uses: actions/download-artifact@v4 with: path: ./artifacts - - name: Extract tag name - id: tag - run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT - name: Create Release uses: softprops/action-gh-release@v1 with: - name: Release ${{ steps.tag.outputs.TAG }} files: | artifacts/*/starfetch-*.tar.gz artifacts/*/starfetch-*.zip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # 3. 发布到 Homebrew homebrew: - name: Update Homebrew Formula + name: Update Homebrew needs: release runs-on: ubuntu-latest steps: @@ -115,6 +101,7 @@ jobs: env: COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} + # 4. 发布到 APT (使用 Python Pip 强攻,最稳方案) apt: name: Push to APT Repository needs: release @@ -122,30 +109,30 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install Cloudsmith CLI + run: pip install cloudsmith-cli - name: Install cargo-deb run: cargo install cargo-deb - name: Build .deb package working-directory: StarFetch run: cargo deb --target x86_64-unknown-linux-gnu - # 核心修正:使用官方的 Setup Action 安装 CLI - - name: Setup Cloudsmith CLI - uses: cloudsmith-io/setup-cloudsmith@v1 - with: - api-key: ${{ secrets.CLOUDSMITH_API_KEY }} - # 核心修正:执行推送命令 - name: Push to Cloudsmith run: | - cloudsmith push deb starlakeai/starfetch/any-distro/any-version StarFetch/target/x86_64-unknown-linux-gnu/debian/*.deb + cloudsmith push deb starlakeai/starfetch/any-distro/any-version StarFetch/target/x86_64-unknown-linux-gnu/debian/*.deb \ + --api-key ${{ secrets.CLOUDSMITH_API_KEY }} + # 5. 发布到 WinGet winget: name: Submit to WinGet needs: release runs-on: ubuntu-latest steps: - name: Submit to WinGet - uses: vedantmgoyal9/winget-releaser@main + uses: vedantmgoyal2009/winget-releaser@v2 with: identifier: StarLakeAI.StarFetch installers-regex: '.*-windows-x86_64\.zip$' From 02ee56f3352e039acd930a9a54ea2f74af9a6aa5 Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 18:23:09 +0800 Subject: [PATCH 48/91] Update Release.yml --- .github/workflows/Release.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index d056334..c7154fc 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -97,11 +97,12 @@ jobs: with: formula-name: starfetch homebrew-tap: Linus-Shyu/homebrew-tap + # 注意:这里路径引用的是 StarFetch_Core 仓库的 release download-url: https://github.com/Linus-Shyu/StarFetch_Core/releases/download/${{ github.ref_name }}/starfetch-macos-x86_64.tar.gz env: COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} - # 4. 发布到 APT (使用 Python Pip 强攻,最稳方案) + # 4. 发布到 APT (修复了环境配置) apt: name: Push to APT Repository needs: release @@ -109,17 +110,27 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + targets: x86_64-unknown-linux-gnu + - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.x' + - name: Install Cloudsmith CLI run: pip install cloudsmith-cli + - name: Install cargo-deb run: cargo install cargo-deb + - name: Build .deb package working-directory: StarFetch run: cargo deb --target x86_64-unknown-linux-gnu + - name: Push to Cloudsmith run: | cloudsmith push deb starlakeai/starfetch/any-distro/any-version StarFetch/target/x86_64-unknown-linux-gnu/debian/*.deb \ From 60442f3847a9ad89750c3961b677563deac56fd3 Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Sun, 1 Feb 2026 18:27:18 +0800 Subject: [PATCH 49/91] Update install way --- StarFetch/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/StarFetch/Cargo.toml b/StarFetch/Cargo.toml index d4cb64c..0e154c1 100644 --- a/StarFetch/Cargo.toml +++ b/StarFetch/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "starfetch" -version = "0.2.0" +version = "0.2.2" edition = "2021" [dependencies] From ad570f6336e8d910bec8237ae3d26f54ee711468 Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Sun, 1 Feb 2026 18:34:54 +0800 Subject: [PATCH 50/91] Fix Cargo.toml --- StarFetch/Cargo.toml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/StarFetch/Cargo.toml b/StarFetch/Cargo.toml index 0e154c1..6471427 100644 --- a/StarFetch/Cargo.toml +++ b/StarFetch/Cargo.toml @@ -2,6 +2,9 @@ name = "starfetch" version = "0.2.2" edition = "2021" +description = "A fast and stylish system information fetch tool." +authors = ["Linus Shyu <0x11@linusshyu.dev>"] +license = "MIT" [dependencies] ansi_term = "0.12" @@ -11,18 +14,16 @@ terminal_size = "0.4.3" clap = { version = "4.5", features = ["derive"] } [package.metadata.deb] -name = "starfetch" maintainer = "Linus Shyu <0x11@linusshyu.dev>" section = "utils" priority = "optional" -description = "A fast and stylish system information fetch tool." extended-description = """ StarFetch is a high-performance system information tool written in Rust. Part of the Star Lake AI ecosystem, designed for speed and aesthetic. """ assets = [ - ["target/release/starfetch", "/usr/bin/starfetch", "755"], + ["target/x86_64-unknown-linux-gnu/release/starfetch", "/usr/bin/starfetch", "755"], ] depends = "$auto" From 6d0ac8759569a6894063fa696f6067f894eecd73 Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Sun, 1 Feb 2026 18:41:22 +0800 Subject: [PATCH 51/91] Fix cargo.toml --- StarFetch/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/StarFetch/Cargo.toml b/StarFetch/Cargo.toml index 6471427..333550b 100644 --- a/StarFetch/Cargo.toml +++ b/StarFetch/Cargo.toml @@ -23,7 +23,7 @@ Part of the Star Lake AI ecosystem, designed for speed and aesthetic. """ assets = [ - ["target/x86_64-unknown-linux-gnu/release/starfetch", "/usr/bin/starfetch", "755"], + ["target/release/starfetch", "/usr/bin/starfetch", "755"], ] depends = "$auto" From d8348708cba33480017555d3e2c11929e428175e Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 19:00:22 +0800 Subject: [PATCH 52/91] Update winget-init.yml --- .github/workflows/winget-init.yml | 33 ++++++++++--------------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/.github/workflows/winget-init.yml b/.github/workflows/winget-init.yml index b4629be..2fb547e 100644 --- a/.github/workflows/winget-init.yml +++ b/.github/workflows/winget-init.yml @@ -1,46 +1,33 @@ -name: WinGet First Submission (Manual) +name: WinGet Initial Submission -# 若 CI 运行失败(komac 需要 TTY),请在本地终端运行下方命令完成首次提交。 on: - workflow_dispatch: + workflow_dispatch: # 手动触发 jobs: submit: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Install Komac uses: cargo-bins/cargo-binstall@main - run: cargo binstall komac --no-confirm env: - GITHUB_TOKEN: ${{ github.token }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Install expect (for unbuffer) run: sudo apt-get update && sudo apt-get install -y expect - - name: Run Komac New (with pseudo-TTY) - shell: script -q -e -c "bash {0}" + - name: Run Komac New + shell: bash env: GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} - KOMAC_FORK_OWNER: ${{ github.repository_owner }} run: | - # unbuffer 提供伪 TTY;管道输入自动应答 zip 嵌套选择(空格选中 + 回车确认) - # 若后续有更多提示,可追加更多回车 - printf ' \n\n\n\n\n' | unbuffer -p komac new StarLakeAI.StarFetch \ + # 针对你的 zip 文件名进行提交 + # printf 里的空格是为了在 komac 弹出列表时选中 starfetch.exe + printf ' \n\n\n\n' | unbuffer -p komac new StarLakeAI.StarFetch \ --publisher "Star Lake AI" \ --package-name "StarFetch" \ - --short-description "A fast and beautiful system information fetch tool written in Rust." \ --license "MIT" \ - --urls "https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.3/starfetch-windows-x86_64.zip" \ - --version 0.2.3 \ + --urls "https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.2/starfetch-windows-x86_64.zip" \ + --version 0.2.2 \ --package-locale en-US \ - --skip-pr-check \ --submit - - - name: Fallback - Manual instructions - if: failure() - run: | - echo "::notice::若 CI 报 TTY 错误,请在本地运行:" - echo " komac new StarLakeAI.StarFetch --publisher \"Star Lake AI\" --package-name \"StarFetch\" --short-description \"A fast and beautiful system information fetch tool written in Rust.\" --license \"MIT\" --urls \"https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.3/starfetch-windows-x86_64.zip\" --version 0.2.3 --package-locale en-US --submit" From e404589f83c36c6f83d3eb47c34812b50e3c70f0 Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 19:00:32 +0800 Subject: [PATCH 53/91] Update WinGet-First-Submission.yml --- .github/workflows/WinGet-First-Submission.yml | 33 ++++++------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/.github/workflows/WinGet-First-Submission.yml b/.github/workflows/WinGet-First-Submission.yml index b4629be..2fb547e 100644 --- a/.github/workflows/WinGet-First-Submission.yml +++ b/.github/workflows/WinGet-First-Submission.yml @@ -1,46 +1,33 @@ -name: WinGet First Submission (Manual) +name: WinGet Initial Submission -# 若 CI 运行失败(komac 需要 TTY),请在本地终端运行下方命令完成首次提交。 on: - workflow_dispatch: + workflow_dispatch: # 手动触发 jobs: submit: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Install Komac uses: cargo-bins/cargo-binstall@main - run: cargo binstall komac --no-confirm env: - GITHUB_TOKEN: ${{ github.token }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Install expect (for unbuffer) run: sudo apt-get update && sudo apt-get install -y expect - - name: Run Komac New (with pseudo-TTY) - shell: script -q -e -c "bash {0}" + - name: Run Komac New + shell: bash env: GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} - KOMAC_FORK_OWNER: ${{ github.repository_owner }} run: | - # unbuffer 提供伪 TTY;管道输入自动应答 zip 嵌套选择(空格选中 + 回车确认) - # 若后续有更多提示,可追加更多回车 - printf ' \n\n\n\n\n' | unbuffer -p komac new StarLakeAI.StarFetch \ + # 针对你的 zip 文件名进行提交 + # printf 里的空格是为了在 komac 弹出列表时选中 starfetch.exe + printf ' \n\n\n\n' | unbuffer -p komac new StarLakeAI.StarFetch \ --publisher "Star Lake AI" \ --package-name "StarFetch" \ - --short-description "A fast and beautiful system information fetch tool written in Rust." \ --license "MIT" \ - --urls "https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.3/starfetch-windows-x86_64.zip" \ - --version 0.2.3 \ + --urls "https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.2/starfetch-windows-x86_64.zip" \ + --version 0.2.2 \ --package-locale en-US \ - --skip-pr-check \ --submit - - - name: Fallback - Manual instructions - if: failure() - run: | - echo "::notice::若 CI 报 TTY 错误,请在本地运行:" - echo " komac new StarLakeAI.StarFetch --publisher \"Star Lake AI\" --package-name \"StarFetch\" --short-description \"A fast and beautiful system information fetch tool written in Rust.\" --license \"MIT\" --urls \"https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.3/starfetch-windows-x86_64.zip\" --version 0.2.3 --package-locale en-US --submit" From e6d3e5586f02b12c3da314ac3456e7e3f6f5c2c8 Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 19:06:29 +0800 Subject: [PATCH 54/91] Update WinGet-First-Submission.yml --- .github/workflows/WinGet-First-Submission.yml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/WinGet-First-Submission.yml b/.github/workflows/WinGet-First-Submission.yml index 2fb547e..e8cc56c 100644 --- a/.github/workflows/WinGet-First-Submission.yml +++ b/.github/workflows/WinGet-First-Submission.yml @@ -1,7 +1,7 @@ name: WinGet Initial Submission on: - workflow_dispatch: # 手动触发 + workflow_dispatch: jobs: submit: @@ -13,21 +13,17 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Install expect (for unbuffer) - run: sudo apt-get update && sudo apt-get install -y expect - - - name: Run Komac New + - name: Run Komac New (Direct EXE) shell: bash env: GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} run: | - # 针对你的 zip 文件名进行提交 - # printf 里的空格是为了在 komac 弹出列表时选中 starfetch.exe - printf ' \n\n\n\n' | unbuffer -p komac new StarLakeAI.StarFetch \ + # 只要后缀是 .exe,komac 就会自动识别为 Portable 模式并直接提交 + komac new StarLakeAI.StarFetch \ --publisher "Star Lake AI" \ --package-name "StarFetch" \ --license "MIT" \ - --urls "https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.2/starfetch-windows-x86_64.zip" \ + --urls "https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.2/starfetch.exe" \ --version 0.2.2 \ - --package-locale en-US \ - --submit + --submit \ + --interactive-mode never From 118a52095783cb97b44ca8c428061779e048090d Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 19:06:39 +0800 Subject: [PATCH 55/91] Update winget-init.yml --- .github/workflows/winget-init.yml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/winget-init.yml b/.github/workflows/winget-init.yml index 2fb547e..e8cc56c 100644 --- a/.github/workflows/winget-init.yml +++ b/.github/workflows/winget-init.yml @@ -1,7 +1,7 @@ name: WinGet Initial Submission on: - workflow_dispatch: # 手动触发 + workflow_dispatch: jobs: submit: @@ -13,21 +13,17 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Install expect (for unbuffer) - run: sudo apt-get update && sudo apt-get install -y expect - - - name: Run Komac New + - name: Run Komac New (Direct EXE) shell: bash env: GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} run: | - # 针对你的 zip 文件名进行提交 - # printf 里的空格是为了在 komac 弹出列表时选中 starfetch.exe - printf ' \n\n\n\n' | unbuffer -p komac new StarLakeAI.StarFetch \ + # 只要后缀是 .exe,komac 就会自动识别为 Portable 模式并直接提交 + komac new StarLakeAI.StarFetch \ --publisher "Star Lake AI" \ --package-name "StarFetch" \ --license "MIT" \ - --urls "https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.2/starfetch-windows-x86_64.zip" \ + --urls "https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.2/starfetch.exe" \ --version 0.2.2 \ - --package-locale en-US \ - --submit + --submit \ + --interactive-mode never From 9d37e61df5c7c575bf61eb8cf021a964db1c9b37 Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 19:07:50 +0800 Subject: [PATCH 56/91] Update WinGet-First-Submission.yml --- .github/workflows/WinGet-First-Submission.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/WinGet-First-Submission.yml b/.github/workflows/WinGet-First-Submission.yml index e8cc56c..240aab1 100644 --- a/.github/workflows/WinGet-First-Submission.yml +++ b/.github/workflows/WinGet-First-Submission.yml @@ -1,12 +1,15 @@ name: WinGet Initial Submission on: - workflow_dispatch: + workflow_dispatch: # 手动触发 jobs: submit: runs-on: ubuntu-latest steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Install Komac uses: cargo-bins/cargo-binstall@main - run: cargo binstall komac --no-confirm @@ -16,14 +19,13 @@ jobs: - name: Run Komac New (Direct EXE) shell: bash env: + # 请确保这个 Token 拥有 public_repo 权限 GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} run: | - # 只要后缀是 .exe,komac 就会自动识别为 Portable 模式并直接提交 komac new StarLakeAI.StarFetch \ --publisher "Star Lake AI" \ --package-name "StarFetch" \ --license "MIT" \ - --urls "https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.2/starfetch.exe" \ --version 0.2.2 \ - --submit \ - --interactive-mode never + --urls "https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.2/starfetch.exe" \ + --submit From 8fae702fabadc344f5ec1df6e7be7efa9b2ea8de Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 19:07:59 +0800 Subject: [PATCH 57/91] Update winget-init.yml --- .github/workflows/winget-init.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/winget-init.yml b/.github/workflows/winget-init.yml index e8cc56c..240aab1 100644 --- a/.github/workflows/winget-init.yml +++ b/.github/workflows/winget-init.yml @@ -1,12 +1,15 @@ name: WinGet Initial Submission on: - workflow_dispatch: + workflow_dispatch: # 手动触发 jobs: submit: runs-on: ubuntu-latest steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Install Komac uses: cargo-bins/cargo-binstall@main - run: cargo binstall komac --no-confirm @@ -16,14 +19,13 @@ jobs: - name: Run Komac New (Direct EXE) shell: bash env: + # 请确保这个 Token 拥有 public_repo 权限 GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} run: | - # 只要后缀是 .exe,komac 就会自动识别为 Portable 模式并直接提交 komac new StarLakeAI.StarFetch \ --publisher "Star Lake AI" \ --package-name "StarFetch" \ --license "MIT" \ - --urls "https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.2/starfetch.exe" \ --version 0.2.2 \ - --submit \ - --interactive-mode never + --urls "https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.2/starfetch.exe" \ + --submit From 401aac348820a3e7357b65091eb226cebe8229eb Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 21:58:50 +0800 Subject: [PATCH 58/91] Delete .github/workflows/WinGet-First-Submission.yml --- .github/workflows/WinGet-First-Submission.yml | 31 ------------------- 1 file changed, 31 deletions(-) delete mode 100644 .github/workflows/WinGet-First-Submission.yml diff --git a/.github/workflows/WinGet-First-Submission.yml b/.github/workflows/WinGet-First-Submission.yml deleted file mode 100644 index 240aab1..0000000 --- a/.github/workflows/WinGet-First-Submission.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: WinGet Initial Submission - -on: - workflow_dispatch: # 手动触发 - -jobs: - submit: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install Komac - uses: cargo-bins/cargo-binstall@main - - run: cargo binstall komac --no-confirm - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Run Komac New (Direct EXE) - shell: bash - env: - # 请确保这个 Token 拥有 public_repo 权限 - GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} - run: | - komac new StarLakeAI.StarFetch \ - --publisher "Star Lake AI" \ - --package-name "StarFetch" \ - --license "MIT" \ - --version 0.2.2 \ - --urls "https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.2/starfetch.exe" \ - --submit From 7130320f16870d50e1aaed55051ab7888ff9df72 Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 21:59:01 +0800 Subject: [PATCH 59/91] Delete .github/workflows/winget-init.yml --- .github/workflows/winget-init.yml | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 .github/workflows/winget-init.yml diff --git a/.github/workflows/winget-init.yml b/.github/workflows/winget-init.yml deleted file mode 100644 index 240aab1..0000000 --- a/.github/workflows/winget-init.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: WinGet Initial Submission - -on: - workflow_dispatch: # 手动触发 - -jobs: - submit: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install Komac - uses: cargo-bins/cargo-binstall@main - - run: cargo binstall komac --no-confirm - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Run Komac New (Direct EXE) - shell: bash - env: - # 请确保这个 Token 拥有 public_repo 权限 - GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} - run: | - komac new StarLakeAI.StarFetch \ - --publisher "Star Lake AI" \ - --package-name "StarFetch" \ - --license "MIT" \ - --version 0.2.2 \ - --urls "https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.2/starfetch.exe" \ - --submit From e5338c3a86728796ff2b2a1b06fce76ea797ada1 Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 22:25:36 +0800 Subject: [PATCH 60/91] Update Release.yml --- .github/workflows/Release.yml | 82 +++++------------------------------ 1 file changed, 10 insertions(+), 72 deletions(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index c7154fc..5f46861 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -6,7 +6,6 @@ on: - 'v*.*.*' jobs: - # 1. 跨平台构建 (Linux, Windows, macOS) build: name: Build for ${{ matrix.target }} strategy: @@ -37,35 +36,28 @@ jobs: runs-on: ${{ matrix.os }} steps: - - name: Checkout code - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable + - uses: dtolnay/rust-toolchain@stable with: targets: ${{ matrix.target }} - - name: Build release binary - working-directory: StarFetch + - working-directory: StarFetch run: cargo build --release --target ${{ matrix.target }} - - name: Create archive (Unix) - if: runner.os != 'Windows' + - if: runner.os != 'Windows' working-directory: StarFetch/target/${{ matrix.target }}/release run: tar czf ../../../${{ matrix.artifact_name }}.${{ matrix.archive_format }} ${{ matrix.binary_name }} - - name: Create archive (Windows) - if: runner.os == 'Windows' + - if: runner.os == 'Windows' working-directory: StarFetch/target/${{ matrix.target }}/release run: Compress-Archive -Path ${{ matrix.binary_name }} -DestinationPath ../../../${{ matrix.artifact_name }}.${{ matrix.archive_format }} - - name: Upload artifact - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v4 with: name: ${{ matrix.artifact_name }} path: StarFetch/${{ matrix.artifact_name }}.${{ matrix.archive_format }} - # 2. 创建 GitHub Release release: name: Create GitHub Release needs: build @@ -73,12 +65,10 @@ jobs: permissions: contents: write steps: - - name: Download all artifacts - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v4 with: path: ./artifacts - - name: Create Release - uses: softprops/action-gh-release@v1 + - uses: softprops/action-gh-release@v1 with: files: | artifacts/*/starfetch-*.tar.gz @@ -86,65 +76,13 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # 3. 发布到 Homebrew homebrew: name: Update Homebrew needs: release runs-on: ubuntu-latest steps: - - name: Update Homebrew formula - uses: mislav/bump-homebrew-formula-action@v3 + - uses: mislav/bump-homebrew-formula-action@v3 with: formula-name: starfetch homebrew-tap: Linus-Shyu/homebrew-tap - # 注意:这里路径引用的是 StarFetch_Core 仓库的 release - download-url: https://github.com/Linus-Shyu/StarFetch_Core/releases/download/${{ github.ref_name }}/starfetch-macos-x86_64.tar.gz - env: - COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} - - # 4. 发布到 APT (修复了环境配置) - apt: - name: Push to APT Repository - needs: release - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable - with: - targets: x86_64-unknown-linux-gnu - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.x' - - - name: Install Cloudsmith CLI - run: pip install cloudsmith-cli - - - name: Install cargo-deb - run: cargo install cargo-deb - - - name: Build .deb package - working-directory: StarFetch - run: cargo deb --target x86_64-unknown-linux-gnu - - - name: Push to Cloudsmith - run: | - cloudsmith push deb starlakeai/starfetch/any-distro/any-version StarFetch/target/x86_64-unknown-linux-gnu/debian/*.deb \ - --api-key ${{ secrets.CLOUDSMITH_API_KEY }} - - # 5. 发布到 WinGet - winget: - name: Submit to WinGet - needs: release - runs-on: ubuntu-latest - steps: - - name: Submit to WinGet - uses: vedantmgoyal2009/winget-releaser@v2 - with: - identifier: StarLakeAI.StarFetch - installers-regex: '.*-windows-x86_64\.zip$' - token: ${{ secrets.HOMEBREW_TAP_TOKEN }} + download- From f62273a6df97194b49af3c08b27ba7e405c57f54 Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 22:34:16 +0800 Subject: [PATCH 61/91] Update Release.yml --- .github/workflows/Release.yml | 103 ++++++++++++++++++++++++++++++---- 1 file changed, 93 insertions(+), 10 deletions(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 5f46861..c793405 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -1,11 +1,15 @@ name: Release Build +# 触发条件:当推送格式为 v*.*.* 的标签时触发 on: push: tags: - 'v*.*.*' jobs: + # --------------------------------------------------------- + # 1. 跨平台二进制构建 + # --------------------------------------------------------- build: name: Build for ${{ matrix.target }} strategy: @@ -36,28 +40,37 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable with: targets: ${{ matrix.target }} - - working-directory: StarFetch + - name: Build release binary + working-directory: StarFetch run: cargo build --release --target ${{ matrix.target }} - - if: runner.os != 'Windows' + - name: Create archive (Unix) + if: runner.os != 'Windows' working-directory: StarFetch/target/${{ matrix.target }}/release run: tar czf ../../../${{ matrix.artifact_name }}.${{ matrix.archive_format }} ${{ matrix.binary_name }} - - if: runner.os == 'Windows' + - name: Create archive (Windows) + if: runner.os == 'Windows' working-directory: StarFetch/target/${{ matrix.target }}/release run: Compress-Archive -Path ${{ matrix.binary_name }} -DestinationPath ../../../${{ matrix.artifact_name }}.${{ matrix.archive_format }} - - uses: actions/upload-artifact@v4 + - name: Upload artifact + uses: actions/upload-artifact@v4 with: name: ${{ matrix.artifact_name }} path: StarFetch/${{ matrix.artifact_name }}.${{ matrix.archive_format }} + # --------------------------------------------------------- + # 2. 创建 GitHub Release 并上传附件 + # --------------------------------------------------------- release: name: Create GitHub Release needs: build @@ -65,10 +78,13 @@ jobs: permissions: contents: write steps: - - uses: actions/download-artifact@v4 + - name: Download all artifacts + uses: actions/download-artifact@v4 with: path: ./artifacts - - uses: softprops/action-gh-release@v1 + + - name: Create Release + uses: softprops/action-gh-release@v1 with: files: | artifacts/*/starfetch-*.tar.gz @@ -76,13 +92,80 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # --------------------------------------------------------- + # 3. 自动更新 Homebrew Formula + # --------------------------------------------------------- homebrew: name: Update Homebrew needs: release runs-on: ubuntu-latest steps: - - uses: mislav/bump-homebrew-formula-action@v3 + - name: Update Homebrew formula + uses: mislav/bump-homebrew-formula-action@v3 with: formula-name: starfetch homebrew-tap: Linus-Shyu/homebrew-tap - download- + # 默认使用 macOS x86_64 的包作为 Formula 源 + download-url: https://github.com/Linus-Shyu/StarFetch_Core/releases/download/${{ github.ref_name }}/starfetch-macos-x86_64.tar.gz + env: + COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} + + # --------------------------------------------------------- + # 4. 构建并推送到 APT 仓库 (Cloudsmith) + # --------------------------------------------------------- + apt: + name: Push to APT Repository + needs: release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Rust toolchain (Multi-arch) + uses: dtolnay/rust-toolchain@stable + with: + targets: x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu + + - name: Install AArch64 linker + run: | + sudo apt-get update + sudo apt-get install -y gcc-aarch64-linux-gnu + + - name: Set up Python & Cloudsmith CLI + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - run: pip install cloudsmith-cli + + - name: Install cargo-deb + run: curl -LsSf https://github.com/kornelski/cargo-deb/releases/latest/download/cargo-deb-x86_64-unknown-linux-gnu.tar.gz | tar xz -C /usr/local/bin + + - name: Build .deb packages (amd64 & arm64) + working-directory: StarFetch + run: | + # 构建 x86_64 (amd64) 版本 + cargo deb --target x86_64-unknown-linux-gnu + # 交叉编译 aarch64 (arm64) 版本 + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc cargo deb --target aarch64-unknown-linux-gnu + + - name: Push to Cloudsmith + run: | + # 使用 --republish 强制覆盖同版本,解决同步冲突 + cloudsmith push deb starlakeai/starfetch/any-distro/any-version StarFetch/target/*/debian/*.deb \ + --api-key ${{ secrets.CLOUDSMITH_API_KEY }} \ + --republish + + # --------------------------------------------------------- + # 5. 提交到 WinGet 官方仓库 + # --------------------------------------------------------- + winget: + name: Submit to WinGet + needs: release + runs-on: ubuntu-latest + steps: + - name: Submit to WinGet + uses: vedantmgoyal2009/winget-releaser@v2 + with: + identifier: StarLakeAI.StarFetch + installers-regex: '.*-windows-x86_64\.zip$' + token: ${{ secrets.HOMEBREW_TAP_TOKEN }} From 87d00f7b9981a429a6061896589cb8638801bfe7 Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 22:40:25 +0800 Subject: [PATCH 62/91] Update Release.yml --- .github/workflows/Release.yml | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index c793405..a1dca21 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -1,15 +1,11 @@ name: Release Build -# 触发条件:当推送格式为 v*.*.* 的标签时触发 on: push: tags: - 'v*.*.*' jobs: - # --------------------------------------------------------- - # 1. 跨平台二进制构建 - # --------------------------------------------------------- build: name: Build for ${{ matrix.target }} strategy: @@ -68,9 +64,6 @@ jobs: name: ${{ matrix.artifact_name }} path: StarFetch/${{ matrix.artifact_name }}.${{ matrix.archive_format }} - # --------------------------------------------------------- - # 2. 创建 GitHub Release 并上传附件 - # --------------------------------------------------------- release: name: Create GitHub Release needs: build @@ -92,9 +85,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # --------------------------------------------------------- - # 3. 自动更新 Homebrew Formula - # --------------------------------------------------------- homebrew: name: Update Homebrew needs: release @@ -105,14 +95,10 @@ jobs: with: formula-name: starfetch homebrew-tap: Linus-Shyu/homebrew-tap - # 默认使用 macOS x86_64 的包作为 Formula 源 download-url: https://github.com/Linus-Shyu/StarFetch_Core/releases/download/${{ github.ref_name }}/starfetch-macos-x86_64.tar.gz env: COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} - # --------------------------------------------------------- - # 4. 构建并推送到 APT 仓库 (Cloudsmith) - # --------------------------------------------------------- apt: name: Push to APT Repository needs: release @@ -138,26 +124,21 @@ jobs: - run: pip install cloudsmith-cli - name: Install cargo-deb - run: curl -LsSf https://github.com/kornelski/cargo-deb/releases/latest/download/cargo-deb-x86_64-unknown-linux-gnu.tar.gz | tar xz -C /usr/local/bin + # 回归最稳的方法:直接通过 cargo 安装 + run: cargo install cargo-deb - name: Build .deb packages (amd64 & arm64) working-directory: StarFetch run: | - # 构建 x86_64 (amd64) 版本 cargo deb --target x86_64-unknown-linux-gnu - # 交叉编译 aarch64 (arm64) 版本 CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc cargo deb --target aarch64-unknown-linux-gnu - name: Push to Cloudsmith run: | - # 使用 --republish 强制覆盖同版本,解决同步冲突 cloudsmith push deb starlakeai/starfetch/any-distro/any-version StarFetch/target/*/debian/*.deb \ --api-key ${{ secrets.CLOUDSMITH_API_KEY }} \ --republish - # --------------------------------------------------------- - # 5. 提交到 WinGet 官方仓库 - # --------------------------------------------------------- winget: name: Submit to WinGet needs: release From 1a0456435751f287e00edb2723642081990f63e6 Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 22:49:59 +0800 Subject: [PATCH 63/91] Update Release.yml --- .github/workflows/Release.yml | 111 ++++++++++++++++++++++------------ 1 file changed, 72 insertions(+), 39 deletions(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index a1dca21..55ee1c1 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -6,6 +6,9 @@ on: - 'v*.*.*' jobs: + # --------------------------------------------------------- + # 1. 跨平台二进制构建 (tar.gz / zip) + # --------------------------------------------------------- build: name: Build for ${{ matrix.target }} strategy: @@ -64,9 +67,47 @@ jobs: name: ${{ matrix.artifact_name }} path: StarFetch/${{ matrix.artifact_name }}.${{ matrix.archive_format }} + # --------------------------------------------------------- + # 2. 构建 Linux .deb 安装包 (amd64 & arm64) + # --------------------------------------------------------- + build-deb: + name: Build .deb packages + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Rust toolchain (Multi-arch) + uses: dtolnay/rust-toolchain@stable + with: + targets: x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu + + - name: Install AArch64 linker + run: | + sudo apt-get update + sudo apt-get install -y gcc-aarch64-linux-gnu + + - name: Install cargo-deb + run: cargo install cargo-deb + + - name: Build .deb packages + working-directory: StarFetch + run: | + cargo deb --target x86_64-unknown-linux-gnu + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc cargo deb --target aarch64-unknown-linux-gnu + + - name: Upload .deb artifacts + uses: actions/upload-artifact@v4 + with: + name: linux-deb-packages + path: StarFetch/target/*/debian/*.deb + + # --------------------------------------------------------- + # 3. 创建 GitHub Release (包含所有二进制文件和 .deb 包) + # --------------------------------------------------------- release: name: Create GitHub Release - needs: build + needs: [build, build-deb] runs-on: ubuntu-latest permissions: contents: write @@ -82,40 +123,23 @@ jobs: files: | artifacts/*/starfetch-*.tar.gz artifacts/*/starfetch-*.zip + artifacts/linux-deb-packages/*.deb env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - homebrew: - name: Update Homebrew - needs: release - runs-on: ubuntu-latest - steps: - - name: Update Homebrew formula - uses: mislav/bump-homebrew-formula-action@v3 - with: - formula-name: starfetch - homebrew-tap: Linus-Shyu/homebrew-tap - download-url: https://github.com/Linus-Shyu/StarFetch_Core/releases/download/${{ github.ref_name }}/starfetch-macos-x86_64.tar.gz - env: - COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} - + # --------------------------------------------------------- + # 4. 发布到 APT 仓库 (从 Release 产物中推送) + # --------------------------------------------------------- apt: name: Push to APT Repository needs: release runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install Rust toolchain (Multi-arch) - uses: dtolnay/rust-toolchain@stable + - name: Download .deb artifacts + uses: actions/download-artifact@v4 with: - targets: x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu - - - name: Install AArch64 linker - run: | - sudo apt-get update - sudo apt-get install -y gcc-aarch64-linux-gnu + name: linux-deb-packages + path: ./debs - name: Set up Python & Cloudsmith CLI uses: actions/setup-python@v5 @@ -123,21 +147,30 @@ jobs: python-version: '3.x' - run: pip install cloudsmith-cli - - name: Install cargo-deb - # 回归最稳的方法:直接通过 cargo 安装 - run: cargo install cargo-deb - - - name: Build .deb packages (amd64 & arm64) - working-directory: StarFetch - run: | - cargo deb --target x86_64-unknown-linux-gnu - CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc cargo deb --target aarch64-unknown-linux-gnu - - name: Push to Cloudsmith run: | - cloudsmith push deb starlakeai/starfetch/any-distro/any-version StarFetch/target/*/debian/*.deb \ - --api-key ${{ secrets.CLOUDSMITH_API_KEY }} \ - --republish + for deb in ./debs/*.deb; do + cloudsmith push deb starlakeai/starfetch/any-distro/any-version "$deb" \ + --api-key ${{ secrets.CLOUDSMITH_API_KEY }} \ + --republish + done + + # --------------------------------------------------------- + # 5. 更新 Homebrew 和 WinGet + # --------------------------------------------------------- + homebrew: + name: Update Homebrew + needs: release + runs-on: ubuntu-latest + steps: + - name: Update Homebrew formula + uses: mislav/bump-homebrew-formula-action@v3 + with: + formula-name: starfetch + homebrew-tap: Linus-Shyu/homebrew-tap + download-url: https://github.com/Linus-Shyu/StarFetch_Core/releases/download/${{ github.ref_name }}/starfetch-macos-x86_64.tar.gz + env: + COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} winget: name: Submit to WinGet From aef91ab557129a29cbef54cb253cae359b71793e Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 22:55:21 +0800 Subject: [PATCH 64/91] Update Release.yml --- .github/workflows/Release.yml | 107 +++++++++++++++------------------- 1 file changed, 46 insertions(+), 61 deletions(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 55ee1c1..520335f 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -7,7 +7,7 @@ on: jobs: # --------------------------------------------------------- - # 1. 跨平台二进制构建 (tar.gz / zip) + # 1. 跨平台二进制构建 # --------------------------------------------------------- build: name: Build for ${{ matrix.target }} @@ -68,46 +68,11 @@ jobs: path: StarFetch/${{ matrix.artifact_name }}.${{ matrix.archive_format }} # --------------------------------------------------------- - # 2. 构建 Linux .deb 安装包 (amd64 & arm64) - # --------------------------------------------------------- - build-deb: - name: Build .deb packages - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install Rust toolchain (Multi-arch) - uses: dtolnay/rust-toolchain@stable - with: - targets: x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu - - - name: Install AArch64 linker - run: | - sudo apt-get update - sudo apt-get install -y gcc-aarch64-linux-gnu - - - name: Install cargo-deb - run: cargo install cargo-deb - - - name: Build .deb packages - working-directory: StarFetch - run: | - cargo deb --target x86_64-unknown-linux-gnu - CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc cargo deb --target aarch64-unknown-linux-gnu - - - name: Upload .deb artifacts - uses: actions/upload-artifact@v4 - with: - name: linux-deb-packages - path: StarFetch/target/*/debian/*.deb - - # --------------------------------------------------------- - # 3. 创建 GitHub Release (包含所有二进制文件和 .deb 包) + # 2. 创建 GitHub Release 并上传附件 # --------------------------------------------------------- release: name: Create GitHub Release - needs: [build, build-deb] + needs: build runs-on: ubuntu-latest permissions: contents: write @@ -123,23 +88,46 @@ jobs: files: | artifacts/*/starfetch-*.tar.gz artifacts/*/starfetch-*.zip - artifacts/linux-deb-packages/*.deb env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # --------------------------------------------------------- - # 4. 发布到 APT 仓库 (从 Release 产物中推送) + # 3. 自动更新 Homebrew Formula + # --------------------------------------------------------- + homebrew: + name: Update Homebrew + needs: release + runs-on: ubuntu-latest + steps: + - name: Update Homebrew formula + uses: mislav/bump-homebrew-formula-action@v3 + with: + formula-name: starfetch + homebrew-tap: Linus-Shyu/homebrew-tap + download-url: https://github.com/Linus-Shyu/StarFetch_Core/releases/download/${{ github.ref_name }}/starfetch-macos-x86_64.tar.gz + env: + COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} + + # --------------------------------------------------------- + # 4. 构建并推送到 APT 仓库 (Cloudsmith) # --------------------------------------------------------- apt: name: Push to APT Repository needs: release runs-on: ubuntu-latest steps: - - name: Download .deb artifacts - uses: actions/download-artifact@v4 + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Rust toolchain (Multi-arch) + uses: dtolnay/rust-toolchain@stable with: - name: linux-deb-packages - path: ./debs + targets: x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu + + - name: Install AArch64 linker + run: | + sudo apt-get update + sudo apt-get install -y gcc-aarch64-linux-gnu - name: Set up Python & Cloudsmith CLI uses: actions/setup-python@v5 @@ -147,31 +135,28 @@ jobs: python-version: '3.x' - run: pip install cloudsmith-cli + - name: Install cargo-deb + run: cargo install cargo-deb + + - name: Build .deb packages (amd64 & arm64) + working-directory: StarFetch + run: | + cargo deb --target x86_64-unknown-linux-gnu + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc cargo deb --target aarch64-unknown-linux-gnu + - name: Push to Cloudsmith run: | - for deb in ./debs/*.deb; do - cloudsmith push deb starlakeai/starfetch/any-distro/any-version "$deb" \ + # 动态寻找所有生成的 deb 包并逐个推送 + find StarFetch/target -name "*.deb" | while read -r deb_file; do + echo "Pushing $deb_file..." + cloudsmith push deb starlakeai/starfetch/any-distro/any-version "$deb_file" \ --api-key ${{ secrets.CLOUDSMITH_API_KEY }} \ --republish done # --------------------------------------------------------- - # 5. 更新 Homebrew 和 WinGet + # 5. 提交到 WinGet 官方仓库 # --------------------------------------------------------- - homebrew: - name: Update Homebrew - needs: release - runs-on: ubuntu-latest - steps: - - name: Update Homebrew formula - uses: mislav/bump-homebrew-formula-action@v3 - with: - formula-name: starfetch - homebrew-tap: Linus-Shyu/homebrew-tap - download-url: https://github.com/Linus-Shyu/StarFetch_Core/releases/download/${{ github.ref_name }}/starfetch-macos-x86_64.tar.gz - env: - COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} - winget: name: Submit to WinGet needs: release From 2ae849c719dba735de97ecd79fcc5e461f109d69 Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 23:58:52 +0800 Subject: [PATCH 65/91] Update Release.yml --- .github/workflows/Release.yml | 180 +++++++++------------------------- 1 file changed, 48 insertions(+), 132 deletions(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 520335f..52564c6 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -1,170 +1,86 @@ -name: Release Build +name: Release on: push: tags: - - 'v*.*.*' + - 'v*' # 当你推送形如 v0.2.2 的 tag 时触发 jobs: - # --------------------------------------------------------- - # 1. 跨平台二进制构建 - # --------------------------------------------------------- build: - name: Build for ${{ matrix.target }} + name: Build - ${{ matrix.target }} + runs-on: ubuntu-latest strategy: - fail-fast: false matrix: include: - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu - artifact_name: starfetch-linux-x86_64 - binary_name: starfetch - archive_format: tar.gz - - os: windows-latest - target: x86_64-pc-windows-msvc - artifact_name: starfetch-windows-x86_64 - binary_name: starfetch.exe - archive_format: zip - - os: macos-latest - target: x86_64-apple-darwin - artifact_name: starfetch-macos-x86_64 - binary_name: starfetch - archive_format: tar.gz - - os: macos-latest - target: aarch64-apple-darwin - artifact_name: starfetch-macos-aarch64 - binary_name: starfetch - archive_format: tar.gz - - runs-on: ${{ matrix.os }} + - target: x86_64-unknown-linux-gnu + arch: amd64 + - target: aarch64-unknown-linux-gnu + arch: arm64 steps: - - name: Checkout code - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Install Rust toolchain + - name: Install Rust uses: dtolnay/rust-toolchain@stable with: targets: ${{ matrix.target }} - - name: Build release binary - working-directory: StarFetch - run: cargo build --release --target ${{ matrix.target }} + - name: Install cargo-deb + run: cargo install cargo-deb + + # 使用 Cross 编译以支持 ARM64 交叉编译 + - name: Install Cross + run: cargo install cross --git https://github.com/cross-rs/cross.git - - name: Create archive (Unix) - if: runner.os != 'Windows' - working-directory: StarFetch/target/${{ matrix.target }}/release - run: tar czf ../../../${{ matrix.artifact_name }}.${{ matrix.archive_format }} ${{ matrix.binary_name }} + - name: Build Debian Package + run: | + cross deb --target ${{ matrix.target }} + # 将生成的包移动到一个统一的目录方便后续上传 + mkdir -p ./dist + mv target/${{ matrix.target }}/debian/*.deb ./dist/ - - name: Create archive (Windows) - if: runner.os == 'Windows' - working-directory: StarFetch/target/${{ matrix.target }}/release - run: Compress-Archive -Path ${{ matrix.binary_name }} -DestinationPath ../../../${{ matrix.artifact_name }}.${{ matrix.archive_format }} + - name: Archive Binary + run: | + cd target/${{ matrix.target }}/release + tar -czvf ../../../dist/starfetch-${{ matrix.target }}.tar.gz starfetch + cd ../../../ - - name: Upload artifact + - name: Upload Artifacts uses: actions/upload-artifact@v4 with: - name: ${{ matrix.artifact_name }} - path: StarFetch/${{ matrix.artifact_name }}.${{ matrix.archive_format }} + name: packages-${{ matrix.arch }} + path: ./dist/* - # --------------------------------------------------------- - # 2. 创建 GitHub Release 并上传附件 - # --------------------------------------------------------- - release: - name: Create GitHub Release + publish: + name: Publish to Release & Cloudsmith needs: build runs-on: ubuntu-latest - permissions: - contents: write steps: - - name: Download all artifacts + - uses: actions/checkout@v4 + + - name: Download All Artifacts uses: actions/download-artifact@v4 with: - path: ./artifacts + path: ./all-packages + merge-multiple: true - - name: Create Release + # 1. 发布到 GitHub Release + - name: Release to GitHub uses: softprops/action-gh-release@v1 with: - files: | - artifacts/*/starfetch-*.tar.gz - artifacts/*/starfetch-*.zip + files: ./all-packages/* env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # --------------------------------------------------------- - # 3. 自动更新 Homebrew Formula - # --------------------------------------------------------- - homebrew: - name: Update Homebrew - needs: release - runs-on: ubuntu-latest - steps: - - name: Update Homebrew formula - uses: mislav/bump-homebrew-formula-action@v3 - with: - formula-name: starfetch - homebrew-tap: Linus-Shyu/homebrew-tap - download-url: https://github.com/Linus-Shyu/StarFetch_Core/releases/download/${{ github.ref_name }}/starfetch-macos-x86_64.tar.gz - env: - COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} - - # --------------------------------------------------------- - # 4. 构建并推送到 APT 仓库 (Cloudsmith) - # --------------------------------------------------------- - apt: - name: Push to APT Repository - needs: release - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install Rust toolchain (Multi-arch) - uses: dtolnay/rust-toolchain@stable - with: - targets: x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu - - - name: Install AArch64 linker - run: | - sudo apt-get update - sudo apt-get install -y gcc-aarch64-linux-gnu - - - name: Set up Python & Cloudsmith CLI - uses: actions/setup-python@v5 - with: - python-version: '3.x' - - run: pip install cloudsmith-cli - - - name: Install cargo-deb - run: cargo install cargo-deb - - - name: Build .deb packages (amd64 & arm64) - working-directory: StarFetch - run: | - cargo deb --target x86_64-unknown-linux-gnu - CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc cargo deb --target aarch64-unknown-linux-gnu + # 2. 推送到 Cloudsmith (可选,建议保留以支持 apt install) + - name: Install Cloudsmith CLI + run: pip install --upgrade cloudsmith-cli - name: Push to Cloudsmith + env: + CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} run: | - # 动态寻找所有生成的 deb 包并逐个推送 - find StarFetch/target -name "*.deb" | while read -r deb_file; do - echo "Pushing $deb_file..." - cloudsmith push deb starlakeai/starfetch/any-distro/any-version "$deb_file" \ - --api-key ${{ secrets.CLOUDSMITH_API_KEY }} \ - --republish + # 循环推送所有下载的 .deb 文件 + for file in ./all-packages/*.deb; do + cloudsmith push deb starlakeai/starfetch/any-distro/any-version "$file" done - - # --------------------------------------------------------- - # 5. 提交到 WinGet 官方仓库 - # --------------------------------------------------------- - winget: - name: Submit to WinGet - needs: release - runs-on: ubuntu-latest - steps: - - name: Submit to WinGet - uses: vedantmgoyal2009/winget-releaser@v2 - with: - identifier: StarLakeAI.StarFetch - installers-regex: '.*-windows-x86_64\.zip$' - token: ${{ secrets.HOMEBREW_TAP_TOKEN }} From 9a6f8f0b65e584c7bd8e37279513138ce5a06df2 Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Mon, 2 Feb 2026 01:02:49 +0800 Subject: [PATCH 66/91] Update release config --- .github/RELEASE_SETUP.md | 147 ++++++++++++++++++ .github/workflows/Release.yml | 278 +++++++++++++++++++++++++++++----- README.md | 42 ++++- StarFetch/Cargo.toml | 9 +- StarFetch/src/main.rs | 10 +- 5 files changed, 440 insertions(+), 46 deletions(-) create mode 100644 .github/RELEASE_SETUP.md diff --git a/.github/RELEASE_SETUP.md b/.github/RELEASE_SETUP.md new file mode 100644 index 0000000..a80903b --- /dev/null +++ b/.github/RELEASE_SETUP.md @@ -0,0 +1,147 @@ +# Release Workflow 配置说明 + +推送 `v*` tag 后,自动完成:**打包全平台/全架构 → 发布到 GitHub Release → 更新 APT / Homebrew / Winget**。 + +## 流程概述 + +1. **Build**:只跑 **3 个 job**(不再用 24 个 matrix job),避免账号并发限制导致“只跑 2 个”: + - **build-linux**(ubuntu):本机 x86_64 + cargo deb,其余用 cross 串行打(Linux/BSD/Windows-GNU 共十几项),产出 `.deb`、`.tar.gz`、`.zip`。 + - **build-macos**(macos):x86_64-apple-darwin、aarch64-apple-darwin。 + - **build-windows**(windows):x86_64/aarch64/i686-pc-windows-msvc。 +2. **GitHub Release**:合并 3 个 artifact 后,将所有产物上传到当前 tag 的 Release 页面。 +3. **APT**:将 `.deb` 推送到 Cloudsmith(需 `CLOUDSMITH_API_KEY`)。 +4. **Homebrew**:更新 `Linus-Shyu/homebrew-tap`(需 `HOMEBREW_TAP_TOKEN`)。 +5. **Winget**:推送到你的 `winget-pkgs` fork(需 `WINGET_PKGS_TOKEN`),再向官方提 PR。 + +## 功能特性 + +✅ **全平台构建** (共 24 个平台) + +**Linux (GNU libc)** - 8 个平台 +- x86_64-unknown-linux-gnu - 生成 `.deb` + `.tar.gz` +- aarch64-unknown-linux-gnu - 生成 `.deb` + `.tar.gz` +- armv7-unknown-linux-gnueabihf - 生成 `.tar.gz` +- i686-unknown-linux-gnu - 生成 `.tar.gz` +- riscv64gc-unknown-linux-gnu - 生成 `.tar.gz` +- powerpc64le-unknown-linux-gnu - 生成 `.tar.gz` +- s390x-unknown-linux-gnu - 生成 `.tar.gz` +- mips64el-unknown-linux-gnuabi64 - 生成 `.tar.gz` + +**Linux (musl - Alpine)** - 3 个平台 +- x86_64-unknown-linux-musl - 生成 `.tar.gz` +- aarch64-unknown-linux-musl - 生成 `.tar.gz` +- armv7-unknown-linux-musleabihf - 生成 `.tar.gz` + +**macOS** - 2 个平台 +- x86_64-apple-darwin - 生成 `.tar.gz` +- aarch64-apple-darwin (Apple Silicon) - 生成 `.tar.gz` + +**Windows (MSVC)** - 3 个平台 +- x86_64-pc-windows-msvc - 生成 `.zip` +- aarch64-pc-windows-msvc - 生成 `.zip` +- i686-pc-windows-msvc - 生成 `.zip` + +**Windows (GNU)** - 2 个平台 +- x86_64-pc-windows-gnu - 生成 `.zip` +- i686-pc-windows-gnu - 生成 `.zip` + +**FreeBSD** - 2 个平台 +- x86_64-unknown-freebsd - 生成 `.tar.gz` +- aarch64-unknown-freebsd - 生成 `.tar.gz` + +**OpenBSD** - 2 个平台 +- x86_64-unknown-openbsd - 生成 `.tar.gz` +- aarch64-unknown-openbsd - 生成 `.tar.gz` + +**NetBSD** - 2 个平台 +- x86_64-unknown-netbsd - 生成 `.tar.gz` +- aarch64-unknown-netbsd - 生成 `.tar.gz` + +✅ **通用安装脚本** + +项目根目录提供跨平台安装脚本: +- `install.sh`(Linux/macOS/BSD) +- `install.ps1`(Windows) + +脚本会根据 `uname`/系统架构自动选择对应的 release 资产,并在找不到预编译包时回退到源码编译(需要 Rust + Git)。 + +✅ **自动发布** +- GitHub Release +- Cloudsmith (APT 仓库) +- Homebrew Formula +- Winget Manifest + +## 必需的 Secrets 配置 + +在 GitHub 仓库的 Settings > Secrets and variables > Actions 中添加以下 secrets: + +### 1. CLOUDSMITH_API_KEY (已有) +用于推送到 Cloudsmith APT 仓库。 + +### 2. HOMEBREW_TAP_TOKEN (新增) +用于更新 Homebrew Formula。 + +**创建步骤:** +1. 前往 https://github.com/settings/tokens +2. 创建 Personal Access Token (Classic) +3. 权限:`repo` (完整仓库访问权限) +4. 将 token 添加到仓库 secrets 中,命名为 `HOMEBREW_TAP_TOKEN` + +**注意:** 确保你的 homebrew tap 仓库 (`Linus-Shyu/homebrew-tap`) 存在,并且该 token 有权限推送。 + +### 3. WINGET_PKGS_TOKEN +用于向你的 **winget-pkgs fork** 推送 manifest。 + +**步骤:** +1. Fork [microsoft/winget-pkgs](https://github.com/microsoft/winget-pkgs) 到你的账户(如 `Linus-Shyu/winget-pkgs`)。 +2. 创建有 `repo` 权限的 Personal Access Token,写入仓库 secret `WINGET_PKGS_TOKEN`。 +3. 每次发版后 workflow 会推送到你的 fork;你再从 fork 向 `microsoft/winget-pkgs` 提 PR,合并后用户即可 `winget install Linus-Shyu.StarFetch`。 + +## Homebrew Formula 仓库设置 + +1. 创建或确认 `Linus-Shyu/homebrew-tap` 仓库存在 +2. 如果不存在 Formula 文件,workflow 会自动创建 +3. 如果已存在,workflow 会自动更新版本和 SHA256 + +## Winget Manifest 设置 + +1. Fork `microsoft/winget-pkgs` 仓库 +2. 或者创建自己的 winget 仓库 +3. 如果使用 microsoft/winget-pkgs,workflow 会推送到你的 fork,然后你需要创建 PR + +## 使用方法 + +1. 确保所有 secrets 已配置 +2. 创建并推送 tag: + ```bash + git tag v0.2.3 + git push origin v0.2.3 + ``` +3. Workflow 会自动: + - 构建所有平台的二进制文件 + - 发布到 GitHub Release + - 推送到 Cloudsmith + - 更新 Homebrew Formula + - 更新 Winget Manifest + +## 故障排除 + +### Homebrew 更新失败 +- 检查 `HOMEBREW_TAP_TOKEN` 是否正确配置 +- 确认 homebrew tap 仓库存在且有写入权限 +- 检查 Formula 文件格式是否正确 + +### Winget 更新失败 +- 检查 `WINGET_PKGS_TOKEN` 是否正确配置 +- 确认已 fork `microsoft/winget-pkgs` 仓库 +- 检查 manifest 文件格式是否符合 winget 规范 + +### Cloudsmith 更新失败 +- 检查 `CLOUDSMITH_API_KEY` 是否正确配置 +- 确认 Cloudsmith 仓库路径正确 + +## 注意事项 + +- 所有更新步骤都有 `|| true` 或 `|| exit 0`,确保单个步骤失败不会影响整体流程 +- 如果某个包管理器更新失败,其他步骤仍会继续执行 +- 建议在首次使用前手动测试各个步骤 diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 52564c6..89748a4 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -3,84 +3,282 @@ name: Release on: push: tags: - - 'v*' # 当你推送形如 v0.2.2 的 tag 时触发 + - 'v*' + +permissions: + contents: write jobs: - build: - name: Build - ${{ matrix.target }} + # ========================================== + # Job 1: Linux 构建 (x86 & ARM) + # ========================================== + build-linux: + name: Build Linux (${{ matrix.target }}) runs-on: ubuntu-latest strategy: + fail-fast: false matrix: include: + # 原生 x86_64 (生成 deb) - target: x86_64-unknown-linux-gnu - arch: amd64 + deb: true + use_cross: false + # ARM64 (生成 deb) - target: aarch64-unknown-linux-gnu - arch: arm64 + deb: true + use_cross: true + # Musl (静态链接) + - target: x86_64-unknown-linux-musl + deb: false + use_cross: true steps: - uses: actions/checkout@v4 - - - name: Install Rust - uses: dtolnay/rust-toolchain@stable + - uses: dtolnay/rust-toolchain@stable with: targets: ${{ matrix.target }} - - name: Install cargo-deb - run: cargo install cargo-deb + - name: Install Tools + run: | + cargo install cargo-deb + if [[ "${{ matrix.use_cross }}" == "true" ]]; then + curl -L https://github.com/cross-rs/cross/releases/download/v0.2.5/cross-x86_64-unknown-linux-musl.tar.gz | tar xz + sudo mv cross /usr/local/bin/ + fi - # 使用 Cross 编译以支持 ARM64 交叉编译 - - name: Install Cross - run: cargo install cross --git https://github.com/cross-rs/cross.git + - name: Build and Collect + working-directory: . + run: | + set -e + mkdir -p dist + + # 1. 编译 + echo "🔨 Building ${{ matrix.target }}..." + if [[ "${{ matrix.use_cross }}" == "true" ]]; then + cross build --release --target ${{ matrix.target }} + else + cargo build --release --target ${{ matrix.target }} + fi + + # 2. 打包 .deb + if [[ "${{ matrix.deb }}" == "true" ]]; then + echo "📦 Packaging .deb..." + # --no-build: 直接使用刚才编译好的二进制 + cargo deb --target ${{ matrix.target }} --no-build --no-strip + mv target/${{ matrix.target }}/debian/*.deb dist/ + fi - - name: Build Debian Package + # 3. 打包 .tar.gz + echo "📦 Packaging .tar.gz..." + name="starfetch-${{ matrix.target }}" + cd "target/${{ matrix.target }}/release" + tar -czvf "../../../dist/${name}.tar.gz" starfetch + cd ../../.. + + # 4. 生成 SHA256 + cd dist + for file in *; do + sha256sum "$file" | awk '{print $1}' > "$file.sha256" + done + + - uses: actions/upload-artifact@v4 + with: + name: artifacts-linux-${{ matrix.target }} + path: dist/* + + # ========================================== + # Job 2: macOS 构建 + # ========================================== + build-macos: + name: Build macOS + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + targets: x86_64-apple-darwin,aarch64-apple-darwin + - name: Build and Collect run: | - cross deb --target ${{ matrix.target }} - # 将生成的包移动到一个统一的目录方便后续上传 - mkdir -p ./dist - mv target/${{ matrix.target }}/debian/*.deb ./dist/ + mkdir -p dist + for target in x86_64-apple-darwin aarch64-apple-darwin; do + cargo build --release --target "$target" + + filename="starfetch-$target.tar.gz" + tar -czvf "dist/$filename" -C "target/$target/release" starfetch + + cd dist + shasum -a 256 "$filename" | awk '{print $1}' > "$filename.sha256" + cd .. + done + - uses: actions/upload-artifact@v4 + with: + name: artifacts-macos + path: dist/* - - name: Archive Binary + # ========================================== + # Job 3: Windows 构建 + # ========================================== + build-windows: + name: Build Windows + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + targets: x86_64-pc-windows-msvc + - name: Build and Collect + shell: pwsh run: | - cd target/${{ matrix.target }}/release - tar -czvf ../../../dist/starfetch-${{ matrix.target }}.tar.gz starfetch - cd ../../../ + New-Item -ItemType Directory -Force -Path dist + cargo build --release --target x86_64-pc-windows-msvc + + $zipName = "starfetch-x86_64-pc-windows-msvc.zip" + $zipPath = "dist/$zipName" + + Compress-Archive -Path "target/x86_64-pc-windows-msvc/release/starfetch.exe" -DestinationPath $zipPath -Force + (Get-FileHash -Path $zipPath -Algorithm SHA256).Hash.ToLower() | Out-File -FilePath "$zipPath.sha256" -NoNewline - - name: Upload Artifacts - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v4 with: - name: packages-${{ matrix.arch }} - path: ./dist/* + name: artifacts-windows + path: dist/* + # ========================================== + # Job 4: 发布与分发 + # ========================================== publish: - name: Publish to Release & Cloudsmith - needs: build + name: Publish Release + needs: [build-linux, build-macos, build-windows] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - + + # 1. 下载所有产物 - name: Download All Artifacts uses: actions/download-artifact@v4 with: - path: ./all-packages + path: ./release-assets merge-multiple: true - # 1. 发布到 GitHub Release - - name: Release to GitHub + - name: Get Version + id: get_ver + run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT + + # 2. GitHub Release (上传所有文件) + - name: Create GitHub Release uses: softprops/action-gh-release@v1 with: - files: ./all-packages/* + files: release-assets/* + draft: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # 2. 推送到 Cloudsmith (可选,建议保留以支持 apt install) - - name: Install Cloudsmith CLI - run: pip install --upgrade cloudsmith-cli - + # 3. Cloudsmith (APT) - name: Push to Cloudsmith + if: ${{ secrets.CLOUDSMITH_API_KEY != '' }} env: CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} run: | - # 循环推送所有下载的 .deb 文件 - for file in ./all-packages/*.deb; do - cloudsmith push deb starlakeai/starfetch/any-distro/any-version "$file" + pip install --upgrade cloudsmith-cli + for f in release-assets/*.deb; do + cloudsmith push deb starlakeai/starfetch/any-distro/any-version "$f" || true done + + # 4. Homebrew Tap + - name: Update Homebrew + if: ${{ secrets.HOMEBREW_TAP_TOKEN != '' }} + env: + GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} + run: | + V=${{ steps.get_ver.outputs.version }} + # 读取文件内容作为哈希值 + ARM_SHA=$(cat release-assets/starfetch-aarch64-apple-darwin.tar.gz.sha256) + X64_SHA=$(cat release-assets/starfetch-x86_64-apple-darwin.tar.gz.sha256) + + git clone https://x-access-token:$GH_TOKEN@github.com/Linus-Shyu/homebrew-tap.git /tmp/tap + cd /tmp/tap + mkdir -p Formula + + cat > Formula/starfetch.rb << EOF + class Starfetch < Formula + desc "A fast and stylish system information fetch tool" + homepage "https://github.com/Linus-Shyu/StarFetch_Core" + version "$V" + license "MIT" + + if Hardware::CPU.arm? + url "https://github.com/${{ github.repository }}/releases/download/v$V/starfetch-aarch64-apple-darwin.tar.gz" + sha256 "$ARM_SHA" + else + url "https://github.com/${{ github.repository }}/releases/download/v$V/starfetch-x86_64-apple-darwin.tar.gz" + sha256 "$X64_SHA" + end + + def install + bin.install "starfetch" + end + end + EOF + + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add . && git commit -m "starfetch v$V" && git push || true + + # 5. Winget + - name: Update Winget + if: ${{ secrets.WINGET_PKGS_TOKEN != '' }} + env: + GH_TOKEN: ${{ secrets.WINGET_PKGS_TOKEN }} + run: | + V=${{ steps.get_ver.outputs.version }} + SHA=$(cat release-assets/starfetch-x86_64-pc-windows-msvc.zip.sha256) + URL="https://github.com/${{ github.repository }}/releases/download/v$V/starfetch-x86_64-pc-windows-msvc.zip" + + git clone https://x-access-token:$GH_TOKEN@github.com/Linus-Shyu/winget-pkgs.git /tmp/winget + cd /tmp/winget + + MANIFEST_DIR="manifests/l/Linus-Shyu/StarFetch/$V" + mkdir -p "$MANIFEST_DIR" + + # Installer Manifest + cat > "$MANIFEST_DIR/Linus-Shyu.StarFetch.installer.yaml" << EOF + PackageIdentifier: Linus-Shyu.StarFetch + PackageVersion: $V + InstallerType: zip + Installers: + - Architecture: x64 + InstallerUrl: $URL + InstallerSha256: $SHA + NestedInstallerType: portable + NestedInstallerFiles: + - RelativeFilePath: starfetch.exe + PortableCommandAlias: starfetch + ManifestType: installer + ManifestVersion: 1.4.0 + EOF + + # Locale Manifest + cat > "$MANIFEST_DIR/Linus-Shyu.StarFetch.locale.en-US.yaml" << EOF + PackageIdentifier: Linus-Shyu.StarFetch + PackageVersion: $V + PackageLocale: en-US + Publisher: Linus Shyu + PackageName: StarFetch + License: MIT + ShortDescription: A fast and stylish system information fetch tool + ManifestType: defaultLocale + ManifestVersion: 1.4.0 + EOF + + # Version Manifest + cat > "$MANIFEST_DIR/Linus-Shyu.StarFetch.version.yaml" << EOF + PackageIdentifier: Linus-Shyu.StarFetch + PackageVersion: $V + DefaultLocale: en-US + ManifestType: version + ManifestVersion: 1.4.0 + EOF + + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add . && git commit -m "StarFetch v$V" && git push || true \ No newline at end of file diff --git a/README.md b/README.md index fc158d3..22029ec 100644 --- a/README.md +++ b/README.md @@ -54,13 +54,48 @@ Used Memory: 10.79 GB ## 🚀 Installation -### HomeBrew +用系统自带的包管理器即可安装,和 neofetch 一样简单。 + +### APT (Ubuntu / Debian) + +支持 x86_64 和 ARM64(含 Apple Silicon 上的 Ubuntu 虚拟机)。 + +```bash +# 添加仓库(首次安装) +curl -1sLf 'https://dl.cloudsmith.io/public/starlakeai/starfetch/setup.deb.sh' | sudo -E bash +# 安装 +sudo apt-get update && sudo apt-get install starfetch +``` + +### Homebrew (macOS) ```bash brew tap Linus-Shyu/tap brew install starfetch ``` +### Winget (Windows) + +```bash +winget install Linus-Shyu.StarFetch +``` + +--- + +### 其他安装方式 + +**通用安装脚本(无包管理器时):** + +```bash +# Linux / macOS / BSD +curl -fsSL https://raw.githubusercontent.com/Linus-Shyu/StarFetch_Core/main/install.sh | bash +``` + +```powershell +# Windows (PowerShell) +irm https://raw.githubusercontent.com/Linus-Shyu/StarFetch_Core/main/install.ps1 | iex +``` + ### Prerequisites * **Rust** (latest stable version) - [Install Rust](https://www.rust-lang.org/tools/install) @@ -82,6 +117,11 @@ cargo install --path . ``` +### Troubleshooting + +若出现 `profile package spec 'zlib-rs' in profile 'dev' did not match any packages` 等警告,说明你的 **全局 Cargo 配置**(`~/.cargo/config.toml`)里为 `zlib-rs`、`adler2` 等包设置了 profile 覆盖,而本仓库并未依赖这些包。 +处理方式:编辑 `~/.cargo/config.toml`,删除或注释掉其中的 `[profile.dev.package.zlib-rs]`、`[profile.release.package.adler2]`、`[profile.release.package.zlib-rs]` 等段落即可;或忽略该警告,不影响构建。 + ## 📦 Dependencies * `ansi_term` - Terminal colors and styling. diff --git a/StarFetch/Cargo.toml b/StarFetch/Cargo.toml index 333550b..05dafe5 100644 --- a/StarFetch/Cargo.toml +++ b/StarFetch/Cargo.toml @@ -1,10 +1,12 @@ [package] name = "starfetch" -version = "0.2.2" +version = "0.2.3" # 发布新版时记得改这里 edition = "2021" description = "A fast and stylish system information fetch tool." authors = ["Linus Shyu <0x11@linusshyu.dev>"] license = "MIT" +readme = "README.md" +repository = "https://github.com/Linus-Shyu/StarFetch_Core" [dependencies] ansi_term = "0.12" @@ -13,6 +15,7 @@ systemstat = "0.2" terminal_size = "0.4.3" clap = { version = "4.5", features = ["derive"] } +# === Debian/Ubuntu 打包配置 === [package.metadata.deb] maintainer = "Linus Shyu <0x11@linusshyu.dev>" section = "utils" @@ -21,9 +24,11 @@ extended-description = """ StarFetch is a high-performance system information tool written in Rust. Part of the Star Lake AI ecosystem, designed for speed and aesthetic. """ +license-file = ["LICENSE", "4"] # 确保根目录有 LICENSE 文件 +# 关键修改:只保留文档资源,二进制文件让工具自动抓取 assets = [ - ["target/release/starfetch", "/usr/bin/starfetch", "755"], + ["README.md", "usr/share/doc/starfetch/README", "644"], ] depends = "$auto" diff --git a/StarFetch/src/main.rs b/StarFetch/src/main.rs index c485760..1519a6e 100644 --- a/StarFetch/src/main.rs +++ b/StarFetch/src/main.rs @@ -6,9 +6,13 @@ mod system; use clap::Parser; #[derive(Parser)] -#[command(disable_help_flag = true)] -#[command(name = "starfetch")] -#[command(about = "A Beauty & fast system information tool", long_about = None)] +#[command( + disable_help_flag = true, + name = "starfetch", + about = "A Beauty & fast system information tool", + long_about = None, + version +)] struct Args { /// Show installed package count (brew, apt, winget, etc.) #[arg(short, long, alias = "p")] From ac65de45ec04b626478a9c442b76b325755914e9 Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Mon, 2 Feb 2026 01:07:15 +0800 Subject: [PATCH 67/91] Update release config --- .github/workflows/Release.yml | 53 +++++++++++++---------------------- 1 file changed, 20 insertions(+), 33 deletions(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 89748a4..e666f4e 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -9,9 +9,9 @@ permissions: contents: write jobs: - # ========================================== - # Job 1: Linux 构建 (x86 & ARM) - # ========================================== + # =================================================== + # Job 1: Linux 构建 (x86_64 和 ARM64) + # =================================================== build-linux: name: Build Linux (${{ matrix.target }}) runs-on: ubuntu-latest @@ -19,15 +19,12 @@ jobs: fail-fast: false matrix: include: - # 原生 x86_64 (生成 deb) - target: x86_64-unknown-linux-gnu deb: true use_cross: false - # ARM64 (生成 deb) - target: aarch64-unknown-linux-gnu deb: true use_cross: true - # Musl (静态链接) - target: x86_64-unknown-linux-musl deb: false use_cross: true @@ -46,13 +43,12 @@ jobs: sudo mv cross /usr/local/bin/ fi - - name: Build and Collect + - name: Build and Collect Assets working-directory: . run: | set -e mkdir -p dist - # 1. 编译 echo "🔨 Building ${{ matrix.target }}..." if [[ "${{ matrix.use_cross }}" == "true" ]]; then cross build --release --target ${{ matrix.target }} @@ -60,22 +56,18 @@ jobs: cargo build --release --target ${{ matrix.target }} fi - # 2. 打包 .deb if [[ "${{ matrix.deb }}" == "true" ]]; then echo "📦 Packaging .deb..." - # --no-build: 直接使用刚才编译好的二进制 cargo deb --target ${{ matrix.target }} --no-build --no-strip mv target/${{ matrix.target }}/debian/*.deb dist/ fi - # 3. 打包 .tar.gz echo "📦 Packaging .tar.gz..." name="starfetch-${{ matrix.target }}" cd "target/${{ matrix.target }}/release" tar -czvf "../../../dist/${name}.tar.gz" starfetch cd ../../.. - # 4. 生成 SHA256 cd dist for file in *; do sha256sum "$file" | awk '{print $1}' > "$file.sha256" @@ -86,9 +78,9 @@ jobs: name: artifacts-linux-${{ matrix.target }} path: dist/* - # ========================================== + # =================================================== # Job 2: macOS 构建 - # ========================================== + # =================================================== build-macos: name: Build macOS runs-on: macos-latest @@ -97,7 +89,7 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: targets: x86_64-apple-darwin,aarch64-apple-darwin - - name: Build and Collect + - name: Build and Collect Assets run: | mkdir -p dist for target in x86_64-apple-darwin aarch64-apple-darwin; do @@ -115,9 +107,9 @@ jobs: name: artifacts-macos path: dist/* - # ========================================== + # =================================================== # Job 3: Windows 构建 - # ========================================== + # =================================================== build-windows: name: Build Windows runs-on: windows-latest @@ -126,7 +118,7 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: targets: x86_64-pc-windows-msvc - - name: Build and Collect + - name: Build and Collect Assets shell: pwsh run: | New-Item -ItemType Directory -Force -Path dist @@ -143,9 +135,9 @@ jobs: name: artifacts-windows path: dist/* - # ========================================== + # =================================================== # Job 4: 发布与分发 - # ========================================== + # =================================================== publish: name: Publish Release needs: [build-linux, build-macos, build-windows] @@ -153,7 +145,6 @@ jobs: steps: - uses: actions/checkout@v4 - # 1. 下载所有产物 - name: Download All Artifacts uses: actions/download-artifact@v4 with: @@ -164,7 +155,7 @@ jobs: id: get_ver run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT - # 2. GitHub Release (上传所有文件) + # 1. GitHub Release - name: Create GitHub Release uses: softprops/action-gh-release@v1 with: @@ -173,9 +164,9 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # 3. Cloudsmith (APT) + # 2. Cloudsmith (APT) - 使用 CLOUDSMITH_API_KEY - name: Push to Cloudsmith - if: ${{ secrets.CLOUDSMITH_API_KEY != '' }} + if: secrets.CLOUDSMITH_API_KEY != '' env: CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} run: | @@ -184,14 +175,13 @@ jobs: cloudsmith push deb starlakeai/starfetch/any-distro/any-version "$f" || true done - # 4. Homebrew Tap + # 3. Homebrew Tap - 使用 HOMEBREW_TAP_TOKEN - name: Update Homebrew - if: ${{ secrets.HOMEBREW_TAP_TOKEN != '' }} + if: secrets.HOMEBREW_TAP_TOKEN != '' env: GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} run: | V=${{ steps.get_ver.outputs.version }} - # 读取文件内容作为哈希值 ARM_SHA=$(cat release-assets/starfetch-aarch64-apple-darwin.tar.gz.sha256) X64_SHA=$(cat release-assets/starfetch-x86_64-apple-darwin.tar.gz.sha256) @@ -224,11 +214,11 @@ jobs: git config user.email "github-actions[bot]@users.noreply.github.com" git add . && git commit -m "starfetch v$V" && git push || true - # 5. Winget + # 4. Winget - 这里修改为使用 HOMEBREW_TAP_TOKEN - name: Update Winget - if: ${{ secrets.WINGET_PKGS_TOKEN != '' }} + if: secrets.HOMEBREW_TAP_TOKEN != '' env: - GH_TOKEN: ${{ secrets.WINGET_PKGS_TOKEN }} + GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} run: | V=${{ steps.get_ver.outputs.version }} SHA=$(cat release-assets/starfetch-x86_64-pc-windows-msvc.zip.sha256) @@ -240,7 +230,6 @@ jobs: MANIFEST_DIR="manifests/l/Linus-Shyu/StarFetch/$V" mkdir -p "$MANIFEST_DIR" - # Installer Manifest cat > "$MANIFEST_DIR/Linus-Shyu.StarFetch.installer.yaml" << EOF PackageIdentifier: Linus-Shyu.StarFetch PackageVersion: $V @@ -257,7 +246,6 @@ jobs: ManifestVersion: 1.4.0 EOF - # Locale Manifest cat > "$MANIFEST_DIR/Linus-Shyu.StarFetch.locale.en-US.yaml" << EOF PackageIdentifier: Linus-Shyu.StarFetch PackageVersion: $V @@ -270,7 +258,6 @@ jobs: ManifestVersion: 1.4.0 EOF - # Version Manifest cat > "$MANIFEST_DIR/Linus-Shyu.StarFetch.version.yaml" << EOF PackageIdentifier: Linus-Shyu.StarFetch PackageVersion: $V From a33126b64009de87e4eee95309e092b7e490ca5c Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Mon, 2 Feb 2026 01:10:47 +0800 Subject: [PATCH 68/91] Fix --- .github/workflows/Release.yml | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index e666f4e..6f36693 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -164,23 +164,32 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # 2. Cloudsmith (APT) - 使用 CLOUDSMITH_API_KEY + # 2. Cloudsmith (APT) - 修复:移除了 if 中的 secrets - name: Push to Cloudsmith - if: secrets.CLOUDSMITH_API_KEY != '' env: CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} run: | + # 在脚本内部判断 Key 是否存在 + if [ -z "$CLOUDSMITH_API_KEY" ]; then + echo "::warning::CLOUDSMITH_API_KEY is not set. Skipping Cloudsmith push." + exit 0 + fi + pip install --upgrade cloudsmith-cli for f in release-assets/*.deb; do cloudsmith push deb starlakeai/starfetch/any-distro/any-version "$f" || true done - # 3. Homebrew Tap - 使用 HOMEBREW_TAP_TOKEN + # 3. Homebrew Tap - 修复:移除了 if 中的 secrets - name: Update Homebrew - if: secrets.HOMEBREW_TAP_TOKEN != '' env: GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} run: | + if [ -z "$GH_TOKEN" ]; then + echo "::warning::HOMEBREW_TAP_TOKEN is not set. Skipping Homebrew update." + exit 0 + fi + V=${{ steps.get_ver.outputs.version }} ARM_SHA=$(cat release-assets/starfetch-aarch64-apple-darwin.tar.gz.sha256) X64_SHA=$(cat release-assets/starfetch-x86_64-apple-darwin.tar.gz.sha256) @@ -214,12 +223,16 @@ jobs: git config user.email "github-actions[bot]@users.noreply.github.com" git add . && git commit -m "starfetch v$V" && git push || true - # 4. Winget - 这里修改为使用 HOMEBREW_TAP_TOKEN + # 4. Winget - 修复:移除了 if 中的 secrets - name: Update Winget - if: secrets.HOMEBREW_TAP_TOKEN != '' env: GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} run: | + if [ -z "$GH_TOKEN" ]; then + echo "::warning::HOMEBREW_TAP_TOKEN is not set. Skipping Winget update." + exit 0 + fi + V=${{ steps.get_ver.outputs.version }} SHA=$(cat release-assets/starfetch-x86_64-pc-windows-msvc.zip.sha256) URL="https://github.com/${{ github.repository }}/releases/download/v$V/starfetch-x86_64-pc-windows-msvc.zip" From d8829ac621f32c3f8ddc1f5f587421139d79cb95 Mon Sep 17 00:00:00 2001 From: flo Date: Mon, 2 Feb 2026 11:23:41 +0800 Subject: [PATCH 69/91] fix yml --- .github/workflows/Release.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 6f36693..c1698a4 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -44,7 +44,7 @@ jobs: fi - name: Build and Collect Assets - working-directory: . + working-directory: StarFetch run: | set -e mkdir -p dist @@ -76,7 +76,7 @@ jobs: - uses: actions/upload-artifact@v4 with: name: artifacts-linux-${{ matrix.target }} - path: dist/* + path: StarFetch/dist/* # =================================================== # Job 2: macOS 构建 @@ -90,6 +90,7 @@ jobs: with: targets: x86_64-apple-darwin,aarch64-apple-darwin - name: Build and Collect Assets + working-directory: StarFetch run: | mkdir -p dist for target in x86_64-apple-darwin aarch64-apple-darwin; do @@ -105,7 +106,7 @@ jobs: - uses: actions/upload-artifact@v4 with: name: artifacts-macos - path: dist/* + path: StarFetch/dist/* # =================================================== # Job 3: Windows 构建 @@ -120,6 +121,7 @@ jobs: targets: x86_64-pc-windows-msvc - name: Build and Collect Assets shell: pwsh + working-directory: StarFetch run: | New-Item -ItemType Directory -Force -Path dist cargo build --release --target x86_64-pc-windows-msvc @@ -133,7 +135,7 @@ jobs: - uses: actions/upload-artifact@v4 with: name: artifacts-windows - path: dist/* + path: StarFetch/dist/* # =================================================== # Job 4: 发布与分发 From b8f29e86ee617f8490ea25bfa91ea12cacac1e98 Mon Sep 17 00:00:00 2001 From: flo Date: Mon, 2 Feb 2026 11:30:33 +0800 Subject: [PATCH 70/91] add LICENSE --- .github/workflows/Release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index c1698a4..6e9d780 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -49,6 +49,9 @@ jobs: set -e mkdir -p dist + # 从父目录复制 LICENSE 用于 .deb 打包 + cp ../LICENSE . + echo "🔨 Building ${{ matrix.target }}..." if [[ "${{ matrix.use_cross }}" == "true" ]]; then cross build --release --target ${{ matrix.target }} From f88677ec1623712db396d6eccb2d9a24773841ca Mon Sep 17 00:00:00 2001 From: flo Date: Mon, 2 Feb 2026 11:33:35 +0800 Subject: [PATCH 71/91] add README --- .github/workflows/Release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 6e9d780..ba88f93 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -49,8 +49,8 @@ jobs: set -e mkdir -p dist - # 从父目录复制 LICENSE 用于 .deb 打包 - cp ../LICENSE . + # 从父目录复制 LICENSE 和 README.md 用于 .deb 打包 + cp ../LICENSE ../README.md . echo "🔨 Building ${{ matrix.target }}..." if [[ "${{ matrix.use_cross }}" == "true" ]]; then From d6fda003354160552c21e1cd894498164e26a42b Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Mon, 2 Feb 2026 13:02:28 +0800 Subject: [PATCH 72/91] Fix Release.yml --- .github/RELEASE_SETUP.md | 147 ---------------------------------- .github/workflows/Release.yml | 51 ++++++------ 2 files changed, 27 insertions(+), 171 deletions(-) delete mode 100644 .github/RELEASE_SETUP.md diff --git a/.github/RELEASE_SETUP.md b/.github/RELEASE_SETUP.md deleted file mode 100644 index a80903b..0000000 --- a/.github/RELEASE_SETUP.md +++ /dev/null @@ -1,147 +0,0 @@ -# Release Workflow 配置说明 - -推送 `v*` tag 后,自动完成:**打包全平台/全架构 → 发布到 GitHub Release → 更新 APT / Homebrew / Winget**。 - -## 流程概述 - -1. **Build**:只跑 **3 个 job**(不再用 24 个 matrix job),避免账号并发限制导致“只跑 2 个”: - - **build-linux**(ubuntu):本机 x86_64 + cargo deb,其余用 cross 串行打(Linux/BSD/Windows-GNU 共十几项),产出 `.deb`、`.tar.gz`、`.zip`。 - - **build-macos**(macos):x86_64-apple-darwin、aarch64-apple-darwin。 - - **build-windows**(windows):x86_64/aarch64/i686-pc-windows-msvc。 -2. **GitHub Release**:合并 3 个 artifact 后,将所有产物上传到当前 tag 的 Release 页面。 -3. **APT**:将 `.deb` 推送到 Cloudsmith(需 `CLOUDSMITH_API_KEY`)。 -4. **Homebrew**:更新 `Linus-Shyu/homebrew-tap`(需 `HOMEBREW_TAP_TOKEN`)。 -5. **Winget**:推送到你的 `winget-pkgs` fork(需 `WINGET_PKGS_TOKEN`),再向官方提 PR。 - -## 功能特性 - -✅ **全平台构建** (共 24 个平台) - -**Linux (GNU libc)** - 8 个平台 -- x86_64-unknown-linux-gnu - 生成 `.deb` + `.tar.gz` -- aarch64-unknown-linux-gnu - 生成 `.deb` + `.tar.gz` -- armv7-unknown-linux-gnueabihf - 生成 `.tar.gz` -- i686-unknown-linux-gnu - 生成 `.tar.gz` -- riscv64gc-unknown-linux-gnu - 生成 `.tar.gz` -- powerpc64le-unknown-linux-gnu - 生成 `.tar.gz` -- s390x-unknown-linux-gnu - 生成 `.tar.gz` -- mips64el-unknown-linux-gnuabi64 - 生成 `.tar.gz` - -**Linux (musl - Alpine)** - 3 个平台 -- x86_64-unknown-linux-musl - 生成 `.tar.gz` -- aarch64-unknown-linux-musl - 生成 `.tar.gz` -- armv7-unknown-linux-musleabihf - 生成 `.tar.gz` - -**macOS** - 2 个平台 -- x86_64-apple-darwin - 生成 `.tar.gz` -- aarch64-apple-darwin (Apple Silicon) - 生成 `.tar.gz` - -**Windows (MSVC)** - 3 个平台 -- x86_64-pc-windows-msvc - 生成 `.zip` -- aarch64-pc-windows-msvc - 生成 `.zip` -- i686-pc-windows-msvc - 生成 `.zip` - -**Windows (GNU)** - 2 个平台 -- x86_64-pc-windows-gnu - 生成 `.zip` -- i686-pc-windows-gnu - 生成 `.zip` - -**FreeBSD** - 2 个平台 -- x86_64-unknown-freebsd - 生成 `.tar.gz` -- aarch64-unknown-freebsd - 生成 `.tar.gz` - -**OpenBSD** - 2 个平台 -- x86_64-unknown-openbsd - 生成 `.tar.gz` -- aarch64-unknown-openbsd - 生成 `.tar.gz` - -**NetBSD** - 2 个平台 -- x86_64-unknown-netbsd - 生成 `.tar.gz` -- aarch64-unknown-netbsd - 生成 `.tar.gz` - -✅ **通用安装脚本** - -项目根目录提供跨平台安装脚本: -- `install.sh`(Linux/macOS/BSD) -- `install.ps1`(Windows) - -脚本会根据 `uname`/系统架构自动选择对应的 release 资产,并在找不到预编译包时回退到源码编译(需要 Rust + Git)。 - -✅ **自动发布** -- GitHub Release -- Cloudsmith (APT 仓库) -- Homebrew Formula -- Winget Manifest - -## 必需的 Secrets 配置 - -在 GitHub 仓库的 Settings > Secrets and variables > Actions 中添加以下 secrets: - -### 1. CLOUDSMITH_API_KEY (已有) -用于推送到 Cloudsmith APT 仓库。 - -### 2. HOMEBREW_TAP_TOKEN (新增) -用于更新 Homebrew Formula。 - -**创建步骤:** -1. 前往 https://github.com/settings/tokens -2. 创建 Personal Access Token (Classic) -3. 权限:`repo` (完整仓库访问权限) -4. 将 token 添加到仓库 secrets 中,命名为 `HOMEBREW_TAP_TOKEN` - -**注意:** 确保你的 homebrew tap 仓库 (`Linus-Shyu/homebrew-tap`) 存在,并且该 token 有权限推送。 - -### 3. WINGET_PKGS_TOKEN -用于向你的 **winget-pkgs fork** 推送 manifest。 - -**步骤:** -1. Fork [microsoft/winget-pkgs](https://github.com/microsoft/winget-pkgs) 到你的账户(如 `Linus-Shyu/winget-pkgs`)。 -2. 创建有 `repo` 权限的 Personal Access Token,写入仓库 secret `WINGET_PKGS_TOKEN`。 -3. 每次发版后 workflow 会推送到你的 fork;你再从 fork 向 `microsoft/winget-pkgs` 提 PR,合并后用户即可 `winget install Linus-Shyu.StarFetch`。 - -## Homebrew Formula 仓库设置 - -1. 创建或确认 `Linus-Shyu/homebrew-tap` 仓库存在 -2. 如果不存在 Formula 文件,workflow 会自动创建 -3. 如果已存在,workflow 会自动更新版本和 SHA256 - -## Winget Manifest 设置 - -1. Fork `microsoft/winget-pkgs` 仓库 -2. 或者创建自己的 winget 仓库 -3. 如果使用 microsoft/winget-pkgs,workflow 会推送到你的 fork,然后你需要创建 PR - -## 使用方法 - -1. 确保所有 secrets 已配置 -2. 创建并推送 tag: - ```bash - git tag v0.2.3 - git push origin v0.2.3 - ``` -3. Workflow 会自动: - - 构建所有平台的二进制文件 - - 发布到 GitHub Release - - 推送到 Cloudsmith - - 更新 Homebrew Formula - - 更新 Winget Manifest - -## 故障排除 - -### Homebrew 更新失败 -- 检查 `HOMEBREW_TAP_TOKEN` 是否正确配置 -- 确认 homebrew tap 仓库存在且有写入权限 -- 检查 Formula 文件格式是否正确 - -### Winget 更新失败 -- 检查 `WINGET_PKGS_TOKEN` 是否正确配置 -- 确认已 fork `microsoft/winget-pkgs` 仓库 -- 检查 manifest 文件格式是否符合 winget 规范 - -### Cloudsmith 更新失败 -- 检查 `CLOUDSMITH_API_KEY` 是否正确配置 -- 确认 Cloudsmith 仓库路径正确 - -## 注意事项 - -- 所有更新步骤都有 `|| true` 或 `|| exit 0`,确保单个步骤失败不会影响整体流程 -- 如果某个包管理器更新失败,其他步骤仍会继续执行 -- 建议在首次使用前手动测试各个步骤 diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index ba88f93..3378490 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -48,30 +48,23 @@ jobs: run: | set -e mkdir -p dist - # 从父目录复制 LICENSE 和 README.md 用于 .deb 打包 cp ../LICENSE ../README.md . - echo "🔨 Building ${{ matrix.target }}..." if [[ "${{ matrix.use_cross }}" == "true" ]]; then cross build --release --target ${{ matrix.target }} else cargo build --release --target ${{ matrix.target }} fi - if [[ "${{ matrix.deb }}" == "true" ]]; then echo "📦 Packaging .deb..." cargo deb --target ${{ matrix.target }} --no-build --no-strip mv target/${{ matrix.target }}/debian/*.deb dist/ fi - - echo "📦 Packaging .tar.gz..." name="starfetch-${{ matrix.target }}" cd "target/${{ matrix.target }}/release" tar -czvf "../../../dist/${name}.tar.gz" starfetch - cd ../../.. - - cd dist + cd ../../../dist for file in *; do sha256sum "$file" | awk '{print $1}' > "$file.sha256" done @@ -123,15 +116,14 @@ jobs: with: targets: x86_64-pc-windows-msvc - name: Build and Collect Assets - shell: pwsh working-directory: StarFetch + shell: pwsh run: | - New-Item -ItemType Directory -Force -Path dist + Set-Location -Path (Join-Path $env:GITHUB_WORKSPACE "StarFetch") + New-Item -ItemType Directory -Force -Path dist | Out-Null cargo build --release --target x86_64-pc-windows-msvc - $zipName = "starfetch-x86_64-pc-windows-msvc.zip" $zipPath = "dist/$zipName" - Compress-Archive -Path "target/x86_64-pc-windows-msvc/release/starfetch.exe" -DestinationPath $zipPath -Force (Get-FileHash -Path $zipPath -Algorithm SHA256).Hash.ToLower() | Out-File -FilePath "$zipPath.sha256" -NoNewline @@ -160,8 +152,19 @@ jobs: id: get_ver run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT - # 1. GitHub Release - - name: Create GitHub Release + # 1. GitHub Release(合并多 job 的 artifact 后统一展平到 release-assets/) + - name: Flatten Release Assets + run: | + for dir in release-assets/StarFetch/dist release-assets/dist; do + if [ -d "$dir" ]; then + cp -a "$dir"/. release-assets/ 2>/dev/null || true + rm -rf "$dir" + fi + done + for sub in release-assets/artifacts-*; do + [ -d "$sub" ] && cp -a "$sub"/. release-assets/ 2>/dev/null || true && rm -rf "$sub" + done + - name: Attach Release Assets uses: softprops/action-gh-release@v1 with: files: release-assets/* @@ -169,7 +172,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # 2. Cloudsmith (APT) - 修复:移除了 if 中的 secrets + # 2. Cloudsmith (APT) - 不可在 if 中使用 secrets,改为在 run 内判断 - name: Push to Cloudsmith env: CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} @@ -179,13 +182,13 @@ jobs: echo "::warning::CLOUDSMITH_API_KEY is not set. Skipping Cloudsmith push." exit 0 fi - + # 兼容 release-assets 或 release-assets/dist pip install --upgrade cloudsmith-cli - for f in release-assets/*.deb; do - cloudsmith push deb starlakeai/starfetch/any-distro/any-version "$f" || true + for f in release-assets/*.deb release-assets/dist/*.deb; do + [ -f "$f" ] && cloudsmith push deb starlakeai/starfetch/any-distro/any-version "$f" || true done - # 3. Homebrew Tap - 修复:移除了 if 中的 secrets + # 3. Homebrew Tap - 不可在 if 中使用 secrets,改为在 run 内判断 - name: Update Homebrew env: GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} @@ -194,10 +197,10 @@ jobs: echo "::warning::HOMEBREW_TAP_TOKEN is not set. Skipping Homebrew update." exit 0 fi - + # 兼容 release-assets 或 release-assets/dist(上一步已 flatten,此处用 release-assets/) V=${{ steps.get_ver.outputs.version }} - ARM_SHA=$(cat release-assets/starfetch-aarch64-apple-darwin.tar.gz.sha256) - X64_SHA=$(cat release-assets/starfetch-x86_64-apple-darwin.tar.gz.sha256) + ARM_SHA=$(cat release-assets/starfetch-aarch64-apple-darwin.tar.gz.sha256 2>/dev/null || cat release-assets/dist/starfetch-aarch64-apple-darwin.tar.gz.sha256) + X64_SHA=$(cat release-assets/starfetch-x86_64-apple-darwin.tar.gz.sha256 2>/dev/null || cat release-assets/dist/starfetch-x86_64-apple-darwin.tar.gz.sha256) git clone https://x-access-token:$GH_TOKEN@github.com/Linus-Shyu/homebrew-tap.git /tmp/tap cd /tmp/tap @@ -228,7 +231,7 @@ jobs: git config user.email "github-actions[bot]@users.noreply.github.com" git add . && git commit -m "starfetch v$V" && git push || true - # 4. Winget - 修复:移除了 if 中的 secrets + # 4. Winget - 不可在 if 中使用 secrets,改为在 run 内判断 - name: Update Winget env: GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} @@ -239,7 +242,7 @@ jobs: fi V=${{ steps.get_ver.outputs.version }} - SHA=$(cat release-assets/starfetch-x86_64-pc-windows-msvc.zip.sha256) + SHA=$(cat release-assets/starfetch-x86_64-pc-windows-msvc.zip.sha256 2>/dev/null || cat release-assets/dist/starfetch-x86_64-pc-windows-msvc.zip.sha256) URL="https://github.com/${{ github.repository }}/releases/download/v$V/starfetch-x86_64-pc-windows-msvc.zip" git clone https://x-access-token:$GH_TOKEN@github.com/Linus-Shyu/winget-pkgs.git /tmp/winget From 2e642a24391080ea8d435d1cf6b22f7278f6d464 Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Mon, 2 Feb 2026 14:21:02 +0800 Subject: [PATCH 73/91] Fix Cargo.toml file --- .github/workflows/Release.yml | 4 +++- StarFetch/Cargo.lock | 2 +- StarFetch/Cargo.toml | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 3378490..2ca3fbd 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -10,7 +10,7 @@ permissions: jobs: # =================================================== - # Job 1: Linux 构建 (x86_64 和 ARM64) + # Job 1: Linux 构建(Ubuntu/Debian .deb + 通用 tar.gz) # =================================================== build-linux: name: Build Linux (${{ matrix.target }}) @@ -19,12 +19,14 @@ jobs: fail-fast: false matrix: include: + # Ubuntu/Debian .deb:amd64(x86_64)、arm64(aarch64) - target: x86_64-unknown-linux-gnu deb: true use_cross: false - target: aarch64-unknown-linux-gnu deb: true use_cross: true + # 通用 Linux(仅 tar.gz,如 Alpine) - target: x86_64-unknown-linux-musl deb: false use_cross: true diff --git a/StarFetch/Cargo.lock b/StarFetch/Cargo.lock index 4d97822..0630506 100644 --- a/StarFetch/Cargo.lock +++ b/StarFetch/Cargo.lock @@ -289,7 +289,7 @@ dependencies = [ [[package]] name = "starfetch" -version = "0.2.0" +version = "0.2.3" dependencies = [ "ansi_term", "clap", diff --git a/StarFetch/Cargo.toml b/StarFetch/Cargo.toml index 05dafe5..26b1b2c 100644 --- a/StarFetch/Cargo.toml +++ b/StarFetch/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "starfetch" -version = "0.2.3" # 发布新版时记得改这里 +version = "0.2.2" edition = "2021" description = "A fast and stylish system information fetch tool." authors = ["Linus Shyu <0x11@linusshyu.dev>"] @@ -26,8 +26,10 @@ Part of the Star Lake AI ecosystem, designed for speed and aesthetic. """ license-file = ["LICENSE", "4"] # 确保根目录有 LICENSE 文件 -# 关键修改:只保留文档资源,二进制文件让工具自动抓取 +# 必须显式列出二进制:指定 assets 后会替换默认 $auto,不写则 .deb 里没有 /usr/bin/starfetch +# target/release/ 会被 cargo-deb 替换为实际路径(含 cross 的 target/xxx/release/) assets = [ + ["target/release/starfetch", "usr/bin/", "755"], ["README.md", "usr/share/doc/starfetch/README", "644"], ] From 777d7be4e263393ba36d95cf70e21751eb418a92 Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Mon, 2 Feb 2026 14:34:41 +0800 Subject: [PATCH 74/91] docs: English localization for README installation and troubleshooting --- README.md | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 22029ec..16952e7 100644 --- a/README.md +++ b/README.md @@ -54,17 +54,15 @@ Used Memory: 10.79 GB ## 🚀 Installation -用系统自带的包管理器即可安装,和 neofetch 一样简单。 +Install with your system package manager—as simple as neofetch. -### APT (Ubuntu / Debian) +### APT (Ubuntu / Debian / Kali) -支持 x86_64 和 ARM64(含 Apple Silicon 上的 Ubuntu 虚拟机)。 +On Linux, these two commands are all you need (x86_64 and ARM64): ```bash -# 添加仓库(首次安装) curl -1sLf 'https://dl.cloudsmith.io/public/starlakeai/starfetch/setup.deb.sh' | sudo -E bash -# 安装 -sudo apt-get update && sudo apt-get install starfetch +sudo apt-get install starfetch ``` ### Homebrew (macOS) @@ -82,9 +80,9 @@ winget install Linus-Shyu.StarFetch --- -### 其他安装方式 +### Other installation options -**通用安装脚本(无包管理器时):** +**Universal install script (when no package manager is available):** ```bash # Linux / macOS / BSD @@ -119,8 +117,7 @@ cargo install --path . ### Troubleshooting -若出现 `profile package spec 'zlib-rs' in profile 'dev' did not match any packages` 等警告,说明你的 **全局 Cargo 配置**(`~/.cargo/config.toml`)里为 `zlib-rs`、`adler2` 等包设置了 profile 覆盖,而本仓库并未依赖这些包。 -处理方式:编辑 `~/.cargo/config.toml`,删除或注释掉其中的 `[profile.dev.package.zlib-rs]`、`[profile.release.package.adler2]`、`[profile.release.package.zlib-rs]` 等段落即可;或忽略该警告,不影响构建。 +If you see warnings like `profile package spec 'zlib-rs' in profile 'dev' did not match any packages`, your **global Cargo config** (`~/.cargo/config.toml`) has profile overrides for packages such as `zlib-rs` or `adler2` that this repo does not use. Edit `~/.cargo/config.toml` and remove or comment out sections like `[profile.dev.package.zlib-rs]`, `[profile.release.package.adler2]`, and `[profile.release.package.zlib-rs]`. You can also ignore the warning—it does not affect the build. ## 📦 Dependencies @@ -142,7 +139,7 @@ cargo install --path . ## 📄 License -This project is licensed under the MIT License - see the [LICENSE](https://www.google.com/search?q=LICENSE) file for details. +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. --- From 1716cc968e07e5f19b53a0912a1505a613af3c78 Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Mon, 2 Feb 2026 14:44:10 +0800 Subject: [PATCH 75/91] release: v0.2.3 - Winget auto-PR to microsoft/winget-pkgs --- .github/workflows/Release.yml | 71 ++++++++++++++++++++++++++++++++++- StarFetch/Cargo.toml | 2 +- 2 files changed, 71 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 2ca3fbd..884a225 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -291,4 +291,73 @@ jobs: git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" - git add . && git commit -m "StarFetch v$V" && git push || true \ No newline at end of file + git add . && git commit -m "StarFetch v$V" && git push || true + + # 5. Winget - 自动向官方 microsoft/winget-pkgs 提 PR(需人工 review 合并) + - name: Open PR to microsoft/winget-pkgs + env: + GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} + run: | + if [ -z "$GH_TOKEN" ]; then + echo "::warning::HOMEBREW_TAP_TOKEN is not set. Skipping winget-pkgs PR." + exit 0 + fi + V=${{ steps.get_ver.outputs.version }} + ASSETS="${{ github.workspace }}/release-assets" + SHA=$(cat "$ASSETS/starfetch-x86_64-pc-windows-msvc.zip.sha256" 2>/dev/null || cat "$ASSETS/dist/starfetch-x86_64-pc-windows-msvc.zip.sha256" 2>/dev/null || true) + if [ -z "$SHA" ]; then + echo "::warning::Windows zip sha256 not found, skipping winget-pkgs PR." + exit 0 + fi + URL="https://github.com/${{ github.repository }}/releases/download/v$V/starfetch-x86_64-pc-windows-msvc.zip" + BRANCH="starfetch-v$V" + git clone --depth 1 https://github.com/microsoft/winget-pkgs.git /tmp/winget-upstream + cd /tmp/winget-upstream + git remote add fork "https://x-access-token:${GH_TOKEN}@github.com/Linus-Shyu/winget-pkgs.git" + git fetch origin + DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@') || DEFAULT_BRANCH="master" + git checkout -b "$BRANCH" "origin/$DEFAULT_BRANCH" + MANIFEST_DIR="manifests/l/Linus-Shyu/StarFetch/$V" + mkdir -p "$MANIFEST_DIR" + cat > "$MANIFEST_DIR/Linus-Shyu.StarFetch.installer.yaml" << EOF + PackageIdentifier: Linus-Shyu.StarFetch + PackageVersion: $V + InstallerType: zip + Installers: + - Architecture: x64 + InstallerUrl: $URL + InstallerSha256: $SHA + NestedInstallerType: portable + NestedInstallerFiles: + - RelativeFilePath: starfetch.exe + PortableCommandAlias: starfetch + ManifestType: installer + ManifestVersion: 1.4.0 + EOF + cat > "$MANIFEST_DIR/Linus-Shyu.StarFetch.locale.en-US.yaml" << EOF + PackageIdentifier: Linus-Shyu.StarFetch + PackageVersion: $V + PackageLocale: en-US + Publisher: Linus Shyu + PackageName: StarFetch + License: MIT + ShortDescription: A fast and stylish system information fetch tool + ManifestType: defaultLocale + ManifestVersion: 1.4.0 + EOF + cat > "$MANIFEST_DIR/Linus-Shyu.StarFetch.version.yaml" << EOF + PackageIdentifier: Linus-Shyu.StarFetch + PackageVersion: $V + DefaultLocale: en-US + ManifestType: version + ManifestVersion: 1.4.0 + EOF + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add . && git diff --staged --quiet || git commit -m "Add Linus-Shyu.StarFetch $V" + git push fork "$BRANCH" || true + export GH_TOKEN + gh pr create --repo microsoft/winget-pkgs --head "Linus-Shyu:$BRANCH" --base "$DEFAULT_BRANCH" \ + --title "Add Linus-Shyu.StarFetch $V" \ + --body "Automated PR from [StarFetch_Core](https://github.com/${{ github.repository }}) release [v$V](https://github.com/${{ github.repository }}/releases/tag/v$V)." \ + || echo "::notice::PR may already exist or creation failed." \ No newline at end of file diff --git a/StarFetch/Cargo.toml b/StarFetch/Cargo.toml index 26b1b2c..fd73d0d 100644 --- a/StarFetch/Cargo.toml +++ b/StarFetch/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "starfetch" -version = "0.2.2" +version = "0.2.3" edition = "2021" description = "A fast and stylish system information fetch tool." authors = ["Linus Shyu <0x11@linusshyu.dev>"] From 63fcb3090cb1fe2c9e0a61384195690a494c725b Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Mon, 2 Feb 2026 15:16:54 +0800 Subject: [PATCH 76/91] chore: install scripts (master), README/Cargo fixes, winget manifest sed --- .github/workflows/Release.yml | 4 ++ README.md | 8 ++-- StarFetch/Cargo.toml | 2 +- install.ps1 | 57 ++++++++++++++++++++++ install.sh | 90 +++++++++++++++++++++++++++++++++++ 5 files changed, 156 insertions(+), 5 deletions(-) create mode 100644 install.ps1 create mode 100644 install.sh diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 884a225..e35d38d 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -288,6 +288,8 @@ jobs: ManifestType: version ManifestVersion: 1.4.0 EOF + # winget 要求根级键无前导空格,去除 heredoc 带入的缩进 + sed -i 's/^ //' "$MANIFEST_DIR"/*.yaml git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" @@ -352,6 +354,8 @@ jobs: ManifestType: version ManifestVersion: 1.4.0 EOF + # winget 要求根级键无前导空格,符合 manifest 1.10.0 规范 + sed -i 's/^ //' "$MANIFEST_DIR"/*.yaml git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git add . && git diff --staged --quiet || git commit -m "Add Linus-Shyu.StarFetch $V" diff --git a/README.md b/README.md index 16952e7..79aff30 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ brew install starfetch ### Winget (Windows) -```bash +```powershell winget install Linus-Shyu.StarFetch ``` @@ -86,12 +86,12 @@ winget install Linus-Shyu.StarFetch ```bash # Linux / macOS / BSD -curl -fsSL https://raw.githubusercontent.com/Linus-Shyu/StarFetch_Core/main/install.sh | bash +curl -fsSL https://raw.githubusercontent.com/Linus-Shyu/StarFetch_Core/master/install.sh | bash ``` ```powershell # Windows (PowerShell) -irm https://raw.githubusercontent.com/Linus-Shyu/StarFetch_Core/main/install.ps1 | iex +irm https://raw.githubusercontent.com/Linus-Shyu/StarFetch_Core/master/install.ps1 | iex ``` ### Prerequisites @@ -102,7 +102,7 @@ irm https://raw.githubusercontent.com/Linus-Shyu/StarFetch_Core/main/install.ps1 ### Build from Source ```bash -git clone [https://github.com/Linus-Shyu/StarFetch_Core.git](https://github.com/Linus-Shyu/StarFetch_Core.git) +git clone https://github.com/Linus-Shyu/StarFetch_Core.git cd StarFetch_Core/StarFetch cargo build --release diff --git a/StarFetch/Cargo.toml b/StarFetch/Cargo.toml index fd73d0d..39773c8 100644 --- a/StarFetch/Cargo.toml +++ b/StarFetch/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "starfetch" -version = "0.2.3" +version = "0.2.3" edition = "2021" description = "A fast and stylish system information fetch tool." authors = ["Linus Shyu <0x11@linusshyu.dev>"] diff --git a/install.ps1 b/install.ps1 new file mode 100644 index 0000000..0cc8d32 --- /dev/null +++ b/install.ps1 @@ -0,0 +1,57 @@ +# StarFetch install script (Windows PowerShell) +# Usage: irm https://raw.githubusercontent.com/Linus-Shyu/StarFetch_Core/master/install.ps1 | iex + +$ErrorActionPreference = "Stop" +$Repo = "Linus-Shyu/StarFetch_Core" + +Write-Host "StarFetch installer" -ForegroundColor Cyan + +# Get latest release version +$apiUrl = "https://api.github.com/repos/$Repo/releases/latest" +try { + $release = Invoke-RestMethod -Uri $apiUrl -UseBasicParsing +} catch { + Write-Error "Could not get latest release: $_" + exit 1 +} + +$version = $release.tag_name -replace "^v", "" +$assetName = "starfetch-x86_64-pc-windows-msvc.zip" +$asset = $release.assets | Where-Object { $_.name -eq $assetName } +if (-not $asset) { + Write-Error "Asset $assetName not found in release $($release.tag_name)" + exit 1 +} + +$downloadUrl = $asset.browser_download_url +$installDir = Join-Path $env:LOCALAPPDATA "starfetch" +$binDir = Join-Path $installDir "bin" + +Write-Host "Installing starfetch v$version from $assetName" +New-Item -ItemType Directory -Force -Path $binDir | Out-Null + +$zipPath = Join-Path $env:TEMP "starfetch-$version.zip" +try { + Invoke-WebRequest -Uri $downloadUrl -OutFile $zipPath -UseBasicParsing + Expand-Archive -Path $zipPath -DestinationPath $binDir -Force +} finally { + if (Test-Path $zipPath) { Remove-Item $zipPath -Force } +} + +$exePath = Join-Path $binDir "starfetch.exe" +if (-not (Test-Path $exePath)) { + Write-Error "starfetch.exe not found after extract" + exit 1 +} + +# Add to user PATH if not already present +$userPath = [Environment]::GetEnvironmentVariable("Path", "User") +if ($userPath -notlike "*$binDir*") { + [Environment]::SetEnvironmentVariable("Path", "$userPath;$binDir", "User") + $env:Path = "$env:Path;$binDir" + Write-Host "Added $binDir to your user PATH." +} + +Write-Host "Installed to $exePath" -ForegroundColor Green +Write-Host "Run 'starfetch' in a new terminal, or: $exePath" +& $exePath --version 2>$null diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..2e5498e --- /dev/null +++ b/install.sh @@ -0,0 +1,90 @@ +#!/usr/bin/env bash +# StarFetch install script (Linux / macOS / BSD) +# Usage: curl -fsSL https://raw.githubusercontent.com/Linus-Shyu/StarFetch_Core/master/install.sh | bash + +set -e + +REPO="Linus-Shyu/StarFetch_Core" +INSTALL_DIR="" + +get_latest_version() { + if command -v jq &>/dev/null; then + curl -sL "https://api.github.com/repos/${REPO}/releases/latest" | jq -r '.tag_name' + else + curl -sL "https://api.github.com/repos/${REPO}/releases/latest" | grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/' + fi +} + +detect_asset() { + local os arch + os=$(uname -s) + arch=$(uname -m) + case "$os" in + Darwin) + case "$arch" in + x86_64) echo "starfetch-x86_64-apple-darwin.tar.gz" ;; + arm64|aarch64) echo "starfetch-aarch64-apple-darwin.tar.gz" ;; + *) echo "unsupported: $os $arch" ;; + esac + ;; + Linux|*BSD*|GNU*) + case "$arch" in + x86_64|amd64) echo "starfetch-x86_64-unknown-linux-gnu.tar.gz" ;; + aarch64|arm64) echo "starfetch-aarch64-unknown-linux-gnu.tar.gz" ;; + *) echo "unsupported: $os $arch" ;; + esac + ;; + *) + echo "unsupported: $os $arch" + ;; + esac +} + +choose_install_dir() { + if [ -w /usr/local/bin ] 2>/dev/null; then + INSTALL_DIR="/usr/local/bin" + elif [ -w /usr/bin ] 2>/dev/null; then + INSTALL_DIR="/usr/bin" + else + INSTALL_DIR="${HOME}/.local/bin" + mkdir -p "$INSTALL_DIR" + if ! echo ":$PATH:" | grep -q ":$INSTALL_DIR:"; then + echo "Add to your shell profile (e.g. ~/.bashrc or ~/.zshrc):" + echo " export PATH=\"\$HOME/.local/bin:\$PATH\"" + fi + fi +} + +main() { + echo "StarFetch installer" + VERSION=$(get_latest_version) + [ -z "$VERSION" ] && { echo "Could not get latest version"; exit 1; } + VERSION=${VERSION#v} + ASSET=$(detect_asset) + if [ -z "$ASSET" ] || [ "$ASSET" != "${ASSET#unsupported}" ]; then + echo "Unsupported platform: $(uname -s) $(uname -m)" + exit 1 + fi + URL="https://github.com/${REPO}/releases/download/v${VERSION}/${ASSET}" + echo "Installing starfetch v${VERSION} from ${ASSET}" + choose_install_dir + TMP=$(mktemp -d) + trap "rm -rf $TMP" EXIT + if command -v curl &>/dev/null; then + curl -fsSL -o "$TMP/starfetch.tar.gz" "$URL" + else + wget -q -O "$TMP/starfetch.tar.gz" "$URL" + fi + tar -xzf "$TMP/starfetch.tar.gz" -C "$TMP" + if [ -w "$INSTALL_DIR" ]; then + mv "$TMP/starfetch" "$INSTALL_DIR/starfetch" + chmod +x "$INSTALL_DIR/starfetch" + else + sudo mv "$TMP/starfetch" "$INSTALL_DIR/starfetch" + sudo chmod +x "$INSTALL_DIR/starfetch" + fi + echo "Installed to $INSTALL_DIR/starfetch" + starfetch --version 2>/dev/null || true +} + +main "$@" From b0fb836884dc666cbe6f626ab246f7e4b0f15c34 Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Mon, 2 Feb 2026 20:42:28 +0800 Subject: [PATCH 77/91] fix: winget manifest ManifestVersion 1.10.0 for schema compliance --- .github/workflows/Release.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index e35d38d..cc30495 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -266,7 +266,7 @@ jobs: - RelativeFilePath: starfetch.exe PortableCommandAlias: starfetch ManifestType: installer - ManifestVersion: 1.4.0 + ManifestVersion: 1.10.0 EOF cat > "$MANIFEST_DIR/Linus-Shyu.StarFetch.locale.en-US.yaml" << EOF @@ -278,7 +278,7 @@ jobs: License: MIT ShortDescription: A fast and stylish system information fetch tool ManifestType: defaultLocale - ManifestVersion: 1.4.0 + ManifestVersion: 1.10.0 EOF cat > "$MANIFEST_DIR/Linus-Shyu.StarFetch.version.yaml" << EOF @@ -286,9 +286,9 @@ jobs: PackageVersion: $V DefaultLocale: en-US ManifestType: version - ManifestVersion: 1.4.0 + ManifestVersion: 1.10.0 EOF - # winget 要求根级键无前导空格,去除 heredoc 带入的缩进 + # winget 1.10:根级键无前导空格,ManifestVersion 1.10.0 sed -i 's/^ //' "$MANIFEST_DIR"/*.yaml git config user.name "github-actions[bot]" @@ -334,7 +334,7 @@ jobs: - RelativeFilePath: starfetch.exe PortableCommandAlias: starfetch ManifestType: installer - ManifestVersion: 1.4.0 + ManifestVersion: 1.10.0 EOF cat > "$MANIFEST_DIR/Linus-Shyu.StarFetch.locale.en-US.yaml" << EOF PackageIdentifier: Linus-Shyu.StarFetch @@ -345,16 +345,16 @@ jobs: License: MIT ShortDescription: A fast and stylish system information fetch tool ManifestType: defaultLocale - ManifestVersion: 1.4.0 + ManifestVersion: 1.10.0 EOF cat > "$MANIFEST_DIR/Linus-Shyu.StarFetch.version.yaml" << EOF PackageIdentifier: Linus-Shyu.StarFetch PackageVersion: $V DefaultLocale: en-US ManifestType: version - ManifestVersion: 1.4.0 + ManifestVersion: 1.10.0 EOF - # winget 要求根级键无前导空格,符合 manifest 1.10.0 规范 + # winget 1.10:根级键无前导空格,ManifestVersion 1.10.0 sed -i 's/^ //' "$MANIFEST_DIR"/*.yaml git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" From 5b7c5298fef26431e6ed369ad0316982aa84739d Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Mon, 2 Feb 2026 21:10:02 +0800 Subject: [PATCH 78/91] chore: release workflow updates for v0.2.3 --- .github/workflows/Release.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index cc30495..4ce95f1 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -49,6 +49,7 @@ jobs: working-directory: StarFetch run: | set -e + cd "${GITHUB_WORKSPACE}/StarFetch" mkdir -p dist # 从父目录复制 LICENSE 和 README.md 用于 .deb 打包 cp ../LICENSE ../README.md . @@ -90,6 +91,7 @@ jobs: - name: Build and Collect Assets working-directory: StarFetch run: | + cd "${GITHUB_WORKSPACE}/StarFetch" mkdir -p dist for target in x86_64-apple-darwin aarch64-apple-darwin; do cargo build --release --target "$target" @@ -253,14 +255,16 @@ jobs: MANIFEST_DIR="manifests/l/Linus-Shyu/StarFetch/$V" mkdir -p "$MANIFEST_DIR" + SHA_UPPER=$(echo "$SHA" | tr 'a-f' 'A-F') cat > "$MANIFEST_DIR/Linus-Shyu.StarFetch.installer.yaml" << EOF PackageIdentifier: Linus-Shyu.StarFetch PackageVersion: $V InstallerType: zip + Scope: user Installers: - Architecture: x64 InstallerUrl: $URL - InstallerSha256: $SHA + InstallerSha256: $SHA_UPPER NestedInstallerType: portable NestedInstallerFiles: - RelativeFilePath: starfetch.exe @@ -321,14 +325,16 @@ jobs: git checkout -b "$BRANCH" "origin/$DEFAULT_BRANCH" MANIFEST_DIR="manifests/l/Linus-Shyu/StarFetch/$V" mkdir -p "$MANIFEST_DIR" + SHA_UPPER=$(echo "$SHA" | tr 'a-f' 'A-F') cat > "$MANIFEST_DIR/Linus-Shyu.StarFetch.installer.yaml" << EOF PackageIdentifier: Linus-Shyu.StarFetch PackageVersion: $V InstallerType: zip + Scope: user Installers: - Architecture: x64 InstallerUrl: $URL - InstallerSha256: $SHA + InstallerSha256: $SHA_UPPER NestedInstallerType: portable NestedInstallerFiles: - RelativeFilePath: starfetch.exe From dc7255549af109bc8658dfff27c5bc32f6132586 Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Mon, 2 Feb 2026 21:56:24 +0800 Subject: [PATCH 79/91] fix(winget): InstallerUrl quoted for 1.10.0 manifest validation --- .github/workflows/Release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 4ce95f1..bc553b0 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -263,7 +263,7 @@ jobs: Scope: user Installers: - Architecture: x64 - InstallerUrl: $URL + InstallerUrl: "$URL" InstallerSha256: $SHA_UPPER NestedInstallerType: portable NestedInstallerFiles: @@ -326,6 +326,7 @@ jobs: MANIFEST_DIR="manifests/l/Linus-Shyu/StarFetch/$V" mkdir -p "$MANIFEST_DIR" SHA_UPPER=$(echo "$SHA" | tr 'a-f' 'A-F') + # 1.10.0: partition=l (first letter of publisher Linus-Shyu, lowercase); path and PackageIdentifier case-sensitive cat > "$MANIFEST_DIR/Linus-Shyu.StarFetch.installer.yaml" << EOF PackageIdentifier: Linus-Shyu.StarFetch PackageVersion: $V @@ -333,7 +334,7 @@ jobs: Scope: user Installers: - Architecture: x64 - InstallerUrl: $URL + InstallerUrl: "$URL" InstallerSha256: $SHA_UPPER NestedInstallerType: portable NestedInstallerFiles: @@ -360,7 +361,6 @@ jobs: ManifestType: version ManifestVersion: 1.10.0 EOF - # winget 1.10:根级键无前导空格,ManifestVersion 1.10.0 sed -i 's/^ //' "$MANIFEST_DIR"/*.yaml git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" From de80ef2d7b8922b2eed9a66d634488101824b323 Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Mon, 2 Feb 2026 22:25:37 +0800 Subject: [PATCH 80/91] chore: use winget-releaser (Komac) for WinGet PR, share token with Homebrew --- .github/workflows/Release.yml | 137 +-------------------------- .github/workflows/winget-publish.yml | 19 ++++ 2 files changed, 20 insertions(+), 136 deletions(-) create mode 100644 .github/workflows/winget-publish.yml diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index bc553b0..dfd11a3 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -235,139 +235,4 @@ jobs: git config user.email "github-actions[bot]@users.noreply.github.com" git add . && git commit -m "starfetch v$V" && git push || true - # 4. Winget - 不可在 if 中使用 secrets,改为在 run 内判断 - - name: Update Winget - env: - GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} - run: | - if [ -z "$GH_TOKEN" ]; then - echo "::warning::HOMEBREW_TAP_TOKEN is not set. Skipping Winget update." - exit 0 - fi - - V=${{ steps.get_ver.outputs.version }} - SHA=$(cat release-assets/starfetch-x86_64-pc-windows-msvc.zip.sha256 2>/dev/null || cat release-assets/dist/starfetch-x86_64-pc-windows-msvc.zip.sha256) - URL="https://github.com/${{ github.repository }}/releases/download/v$V/starfetch-x86_64-pc-windows-msvc.zip" - - git clone https://x-access-token:$GH_TOKEN@github.com/Linus-Shyu/winget-pkgs.git /tmp/winget - cd /tmp/winget - - MANIFEST_DIR="manifests/l/Linus-Shyu/StarFetch/$V" - mkdir -p "$MANIFEST_DIR" - - SHA_UPPER=$(echo "$SHA" | tr 'a-f' 'A-F') - cat > "$MANIFEST_DIR/Linus-Shyu.StarFetch.installer.yaml" << EOF - PackageIdentifier: Linus-Shyu.StarFetch - PackageVersion: $V - InstallerType: zip - Scope: user - Installers: - - Architecture: x64 - InstallerUrl: "$URL" - InstallerSha256: $SHA_UPPER - NestedInstallerType: portable - NestedInstallerFiles: - - RelativeFilePath: starfetch.exe - PortableCommandAlias: starfetch - ManifestType: installer - ManifestVersion: 1.10.0 - EOF - - cat > "$MANIFEST_DIR/Linus-Shyu.StarFetch.locale.en-US.yaml" << EOF - PackageIdentifier: Linus-Shyu.StarFetch - PackageVersion: $V - PackageLocale: en-US - Publisher: Linus Shyu - PackageName: StarFetch - License: MIT - ShortDescription: A fast and stylish system information fetch tool - ManifestType: defaultLocale - ManifestVersion: 1.10.0 - EOF - - cat > "$MANIFEST_DIR/Linus-Shyu.StarFetch.version.yaml" << EOF - PackageIdentifier: Linus-Shyu.StarFetch - PackageVersion: $V - DefaultLocale: en-US - ManifestType: version - ManifestVersion: 1.10.0 - EOF - # winget 1.10:根级键无前导空格,ManifestVersion 1.10.0 - sed -i 's/^ //' "$MANIFEST_DIR"/*.yaml - - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - git add . && git commit -m "StarFetch v$V" && git push || true - - # 5. Winget - 自动向官方 microsoft/winget-pkgs 提 PR(需人工 review 合并) - - name: Open PR to microsoft/winget-pkgs - env: - GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} - run: | - if [ -z "$GH_TOKEN" ]; then - echo "::warning::HOMEBREW_TAP_TOKEN is not set. Skipping winget-pkgs PR." - exit 0 - fi - V=${{ steps.get_ver.outputs.version }} - ASSETS="${{ github.workspace }}/release-assets" - SHA=$(cat "$ASSETS/starfetch-x86_64-pc-windows-msvc.zip.sha256" 2>/dev/null || cat "$ASSETS/dist/starfetch-x86_64-pc-windows-msvc.zip.sha256" 2>/dev/null || true) - if [ -z "$SHA" ]; then - echo "::warning::Windows zip sha256 not found, skipping winget-pkgs PR." - exit 0 - fi - URL="https://github.com/${{ github.repository }}/releases/download/v$V/starfetch-x86_64-pc-windows-msvc.zip" - BRANCH="starfetch-v$V" - git clone --depth 1 https://github.com/microsoft/winget-pkgs.git /tmp/winget-upstream - cd /tmp/winget-upstream - git remote add fork "https://x-access-token:${GH_TOKEN}@github.com/Linus-Shyu/winget-pkgs.git" - git fetch origin - DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@') || DEFAULT_BRANCH="master" - git checkout -b "$BRANCH" "origin/$DEFAULT_BRANCH" - MANIFEST_DIR="manifests/l/Linus-Shyu/StarFetch/$V" - mkdir -p "$MANIFEST_DIR" - SHA_UPPER=$(echo "$SHA" | tr 'a-f' 'A-F') - # 1.10.0: partition=l (first letter of publisher Linus-Shyu, lowercase); path and PackageIdentifier case-sensitive - cat > "$MANIFEST_DIR/Linus-Shyu.StarFetch.installer.yaml" << EOF - PackageIdentifier: Linus-Shyu.StarFetch - PackageVersion: $V - InstallerType: zip - Scope: user - Installers: - - Architecture: x64 - InstallerUrl: "$URL" - InstallerSha256: $SHA_UPPER - NestedInstallerType: portable - NestedInstallerFiles: - - RelativeFilePath: starfetch.exe - PortableCommandAlias: starfetch - ManifestType: installer - ManifestVersion: 1.10.0 - EOF - cat > "$MANIFEST_DIR/Linus-Shyu.StarFetch.locale.en-US.yaml" << EOF - PackageIdentifier: Linus-Shyu.StarFetch - PackageVersion: $V - PackageLocale: en-US - Publisher: Linus Shyu - PackageName: StarFetch - License: MIT - ShortDescription: A fast and stylish system information fetch tool - ManifestType: defaultLocale - ManifestVersion: 1.10.0 - EOF - cat > "$MANIFEST_DIR/Linus-Shyu.StarFetch.version.yaml" << EOF - PackageIdentifier: Linus-Shyu.StarFetch - PackageVersion: $V - DefaultLocale: en-US - ManifestType: version - ManifestVersion: 1.10.0 - EOF - sed -i 's/^ //' "$MANIFEST_DIR"/*.yaml - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - git add . && git diff --staged --quiet || git commit -m "Add Linus-Shyu.StarFetch $V" - git push fork "$BRANCH" || true - export GH_TOKEN - gh pr create --repo microsoft/winget-pkgs --head "Linus-Shyu:$BRANCH" --base "$DEFAULT_BRANCH" \ - --title "Add Linus-Shyu.StarFetch $V" \ - --body "Automated PR from [StarFetch_Core](https://github.com/${{ github.repository }}) release [v$V](https://github.com/${{ github.repository }}/releases/tag/v$V)." \ - || echo "::notice::PR may already exist or creation failed." \ No newline at end of file + # 4. Winget 由 winget-releaser(Komac)在 release 发布后自动提 PR,见 .github/workflows/winget-publish.yml \ No newline at end of file diff --git a/.github/workflows/winget-publish.yml b/.github/workflows/winget-publish.yml new file mode 100644 index 0000000..7812949 --- /dev/null +++ b/.github/workflows/winget-publish.yml @@ -0,0 +1,19 @@ +# 在 GitHub Release 发布后,用 Komac(winget-releaser)生成符合 1.10.0 的 manifest 并自动向 microsoft/winget-pkgs 提 PR +# 与 Homebrew 共用 secret:HOMEBREW_TAP_TOKEN(classic PAT,public_repo) +# 需要:已 fork microsoft/winget-pkgs 到 Linus-Shyu/winget-pkgs +name: Publish to WinGet + +on: + release: + types: [published] + +jobs: + publish: + runs-on: windows-latest + steps: + - uses: vedantmgoyal9/winget-releaser@main + with: + identifier: Linus-Shyu.StarFetch + token: ${{ secrets.HOMEBREW_TAP_TOKEN }} + installers-regex: '\.zip$' + fork-user: Linus-Shyu From 3986663985a010453c2a4eba059f7185e8e406fd Mon Sep 17 00:00:00 2001 From: Linus Shyu <83543818+Linus-Shyu@users.noreply.github.com> Date: Mon, 2 Feb 2026 22:34:38 +0800 Subject: [PATCH 81/91] Delete .github/workflows/winget-publish.yml --- .github/workflows/winget-publish.yml | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 .github/workflows/winget-publish.yml diff --git a/.github/workflows/winget-publish.yml b/.github/workflows/winget-publish.yml deleted file mode 100644 index 7812949..0000000 --- a/.github/workflows/winget-publish.yml +++ /dev/null @@ -1,19 +0,0 @@ -# 在 GitHub Release 发布后,用 Komac(winget-releaser)生成符合 1.10.0 的 manifest 并自动向 microsoft/winget-pkgs 提 PR -# 与 Homebrew 共用 secret:HOMEBREW_TAP_TOKEN(classic PAT,public_repo) -# 需要:已 fork microsoft/winget-pkgs 到 Linus-Shyu/winget-pkgs -name: Publish to WinGet - -on: - release: - types: [published] - -jobs: - publish: - runs-on: windows-latest - steps: - - uses: vedantmgoyal9/winget-releaser@main - with: - identifier: Linus-Shyu.StarFetch - token: ${{ secrets.HOMEBREW_TAP_TOKEN }} - installers-regex: '\.zip$' - fork-user: Linus-Shyu From b5d6ba0f95cbf5d3a0d678b234ba1af149844061 Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Mon, 2 Feb 2026 23:17:04 +0800 Subject: [PATCH 82/91] chore: use winget manifest template in Release.yml, add winget/0.2.3, remove winget-publish workflow --- .github/workflows/Release.yml | 52 ++++++++++++++++++- .github/workflows/winget-publish.yml | 19 ------- winget/README.md | 23 ++++++++ .../0.2.3/Linus-Shyu.StarFetch.installer.yaml | 23 ++++++++ .../Linus-Shyu.StarFetch.locale.en-US.yaml | 22 ++++++++ .../0.2.3/Linus-Shyu.StarFetch.version.yaml | 8 +++ 6 files changed, 127 insertions(+), 20 deletions(-) delete mode 100644 .github/workflows/winget-publish.yml create mode 100644 winget/README.md create mode 100644 winget/manifests/l/Linus-Shyu/StarFetch/0.2.3/Linus-Shyu.StarFetch.installer.yaml create mode 100644 winget/manifests/l/Linus-Shyu/StarFetch/0.2.3/Linus-Shyu.StarFetch.locale.en-US.yaml create mode 100644 winget/manifests/l/Linus-Shyu/StarFetch/0.2.3/Linus-Shyu.StarFetch.version.yaml diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index dfd11a3..53bd409 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -235,4 +235,54 @@ jobs: git config user.email "github-actions[bot]@users.noreply.github.com" git add . && git commit -m "starfetch v$V" && git push || true - # 4. Winget 由 winget-releaser(Komac)在 release 发布后自动提 PR,见 .github/workflows/winget-publish.yml \ No newline at end of file + # 4. Winget - 用仓库内 komac 生成的 manifest 模板(winget/manifests/.../0.2.3/)替换版本/URL/SHA/日期后提 PR + - name: Update Winget (manifest from repo) + env: + GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} + run: | + if [ -z "$GH_TOKEN" ]; then + echo "::warning::HOMEBREW_TAP_TOKEN is not set. Skipping Winget PR." + exit 0 + fi + V=${{ steps.get_ver.outputs.version }} + RELEASE_DATE=$(date +%Y-%m-%d) + URL="https://github.com/${{ github.repository }}/releases/download/v$V/starfetch-x86_64-pc-windows-msvc.zip" + SHA=$(cat release-assets/starfetch-x86_64-pc-windows-msvc.zip.sha256 2>/dev/null || true) + if [ -z "$SHA" ]; then + echo "::warning::Windows zip sha256 not found. Skipping Winget PR." + exit 0 + fi + SHA_UPPER=$(echo "$SHA" | tr 'a-f' 'A-F') + TEMPLATE_DIR="winget/manifests/l/Linus-Shyu/StarFetch/0.2.3" + if [ ! -d "$TEMPLATE_DIR" ]; then + echo "::warning::Winget template $TEMPLATE_DIR not found. Skipping Winget PR." + exit 0 + fi + git clone --depth 1 https://github.com/microsoft/winget-pkgs.git /tmp/winget-pkgs + cd /tmp/winget-pkgs + git remote add fork "https://x-access-token:${GH_TOKEN}@github.com/Linus-Shyu/winget-pkgs.git" + DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@') || DEFAULT_BRANCH="master" + BRANCH="starfetch-v$V" + git checkout -b "$BRANCH" "origin/$DEFAULT_BRANCH" + MANIFEST_DIR="manifests/l/Linus-Shyu/StarFetch/$V" + mkdir -p "$MANIFEST_DIR" + REPO_ROOT="${{ github.workspace }}" + sed -e "s/0\.2\.3/$V/g" \ + -e "s|https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.3/starfetch-x86_64-pc-windows-msvc.zip|$URL|g" \ + -e "s/4D8E1F14F4877A7400E5CD6DBA5912B93B616DD905A5DC820C8157FC936926FA/$SHA_UPPER/g" \ + -e "s/2026-02-02/$RELEASE_DATE/g" \ + "$REPO_ROOT/$TEMPLATE_DIR/Linus-Shyu.StarFetch.installer.yaml" > "$MANIFEST_DIR/Linus-Shyu.StarFetch.installer.yaml" + sed -e "s/0\.2\.3/$V/g" \ + -e "s|/v0.2.3|/v$V|g" \ + "$REPO_ROOT/$TEMPLATE_DIR/Linus-Shyu.StarFetch.locale.en-US.yaml" > "$MANIFEST_DIR/Linus-Shyu.StarFetch.locale.en-US.yaml" + sed -e "s/0\.2\.3/$V/g" \ + "$REPO_ROOT/$TEMPLATE_DIR/Linus-Shyu.StarFetch.version.yaml" > "$MANIFEST_DIR/Linus-Shyu.StarFetch.version.yaml" + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add . && git diff --staged --quiet || git commit -m "Add Linus-Shyu.StarFetch $V" + git push fork "$BRANCH" || true + export GH_TOKEN + gh pr create --repo microsoft/winget-pkgs --head "Linus-Shyu:$BRANCH" --base "$DEFAULT_BRANCH" \ + --title "Add Linus-Shyu.StarFetch $V" \ + --body "Automated PR from [StarFetch_Core](https://github.com/${{ github.repository }}) release [v$V](https://github.com/${{ github.repository }}/releases/tag/v$V). Manifests generated from komac template (1.12.0)." \ + || echo "::notice::PR may already exist or creation failed." \ No newline at end of file diff --git a/.github/workflows/winget-publish.yml b/.github/workflows/winget-publish.yml deleted file mode 100644 index 7812949..0000000 --- a/.github/workflows/winget-publish.yml +++ /dev/null @@ -1,19 +0,0 @@ -# 在 GitHub Release 发布后,用 Komac(winget-releaser)生成符合 1.10.0 的 manifest 并自动向 microsoft/winget-pkgs 提 PR -# 与 Homebrew 共用 secret:HOMEBREW_TAP_TOKEN(classic PAT,public_repo) -# 需要:已 fork microsoft/winget-pkgs 到 Linus-Shyu/winget-pkgs -name: Publish to WinGet - -on: - release: - types: [published] - -jobs: - publish: - runs-on: windows-latest - steps: - - uses: vedantmgoyal9/winget-releaser@main - with: - identifier: Linus-Shyu.StarFetch - token: ${{ secrets.HOMEBREW_TAP_TOKEN }} - installers-regex: '\.zip$' - fork-user: Linus-Shyu diff --git a/winget/README.md b/winget/README.md new file mode 100644 index 0000000..ce4960c --- /dev/null +++ b/winget/README.md @@ -0,0 +1,23 @@ +# WinGet Manifests + +Komac 生成的 manifest(1.12.0),已按 winget-pkgs 目录结构存放:`manifests/l/Linus-Shyu/StarFetch//`。 + +## 以后发新版本(不用再在命令行里逐项填) + +**方式一:用 komac update(推荐)** + +第一个版本在 winget-pkgs 合并后,以后只需: + +```bash +komac update Linus-Shyu.StarFetch --version 0.2.4 --urls "https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.4/starfetch-x86_64-pc-windows-msvc.zip" --submit +``` + +Komac 会以已有包为基础,只更新版本和 URL/SHA,不用再填一遍 metadata。 + +**方式二:用仓库里的 Publish to WinGet 工作流** + +发新 Release 后,到 Actions → Publish to WinGet → Run workflow,填 release tag(如 `v0.2.4`),由 winget-releaser(Komac)自动提 PR。 + +**方式三:复制本目录再改** + +复制 `0.2.3/` 为 `<新版本>/`,在三个 yaml 里把 `0.2.3`、InstallerUrl、InstallerSha256、ReleaseDate 等改成新版本,再用 `winget validate` 校验后提交到你的 winget-pkgs fork 并开 PR。 diff --git a/winget/manifests/l/Linus-Shyu/StarFetch/0.2.3/Linus-Shyu.StarFetch.installer.yaml b/winget/manifests/l/Linus-Shyu/StarFetch/0.2.3/Linus-Shyu.StarFetch.installer.yaml new file mode 100644 index 0000000..c120e20 --- /dev/null +++ b/winget/manifests/l/Linus-Shyu/StarFetch/0.2.3/Linus-Shyu.StarFetch.installer.yaml @@ -0,0 +1,23 @@ +# Created with komac v2.15.0 +# yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.12.0.schema.json + +PackageIdentifier: Linus-Shyu.StarFetch +PackageVersion: 0.2.3 +InstallerType: zip +NestedInstallerType: portable +NestedInstallerFiles: +- RelativeFilePath: starfetch.exe + PortableCommandAlias: starfetch +InstallModes: +- silent +- silentWithProgress +UpgradeBehavior: install +Commands: +- starfetch +ReleaseDate: 2026-02-02 +Installers: +- Architecture: x64 + InstallerUrl: https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.3/starfetch-x86_64-pc-windows-msvc.zip + InstallerSha256: 4D8E1F14F4877A7400E5CD6DBA5912B93B616DD905A5DC820C8157FC936926FA +ManifestType: installer +ManifestVersion: 1.12.0 diff --git a/winget/manifests/l/Linus-Shyu/StarFetch/0.2.3/Linus-Shyu.StarFetch.locale.en-US.yaml b/winget/manifests/l/Linus-Shyu/StarFetch/0.2.3/Linus-Shyu.StarFetch.locale.en-US.yaml new file mode 100644 index 0000000..9d76be8 --- /dev/null +++ b/winget/manifests/l/Linus-Shyu/StarFetch/0.2.3/Linus-Shyu.StarFetch.locale.en-US.yaml @@ -0,0 +1,22 @@ +# Created with komac v2.15.0 +# yaml-language-server: $schema=https://aka.ms/winget-manifest.defaultLocale.1.12.0.schema.json + +PackageIdentifier: Linus-Shyu.StarFetch +PackageVersion: 0.2.3 +PackageLocale: en-US +Publisher: Linus Shyu +PublisherUrl: https://github.com/Linus-Shyu +PublisherSupportUrl: https://linusshyu.dev/starfetch/ +Author: Linus Shyu +PackageName: StarFetch +PackageUrl: https://github.com/Linus-Shyu/StarFetch_Core +License: MIT +LicenseUrl: https://github.com/Linus-Shyu/StarFetch_Core/blob/HEAD/LICENSE +Copyright: Linus Shyu 2026 +CopyrightUrl: https://linusshyu.dev/starfetch/ +ShortDescription: This is the Rust Version about NeoFetch. +Tags: +- neofetch +ReleaseNotesUrl: https://github.com/Linus-Shyu/StarFetch_Core/releases/tag/v0.2.3 +ManifestType: defaultLocale +ManifestVersion: 1.12.0 diff --git a/winget/manifests/l/Linus-Shyu/StarFetch/0.2.3/Linus-Shyu.StarFetch.version.yaml b/winget/manifests/l/Linus-Shyu/StarFetch/0.2.3/Linus-Shyu.StarFetch.version.yaml new file mode 100644 index 0000000..6e9ef97 --- /dev/null +++ b/winget/manifests/l/Linus-Shyu/StarFetch/0.2.3/Linus-Shyu.StarFetch.version.yaml @@ -0,0 +1,8 @@ +# Created with komac v2.15.0 +# yaml-language-server: $schema=https://aka.ms/winget-manifest.version.1.12.0.schema.json + +PackageIdentifier: Linus-Shyu.StarFetch +PackageVersion: 0.2.3 +DefaultLocale: en-US +ManifestType: version +ManifestVersion: 1.12.0 From 1e4d56aff8158e0f5119815cfb40ad0dd788a2dd Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Mon, 2 Feb 2026 23:32:15 +0800 Subject: [PATCH 83/91] fix(release): use --force-with-lease for winget fork push --- .github/workflows/Release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 53bd409..b916837 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -280,7 +280,7 @@ jobs: git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git add . && git diff --staged --quiet || git commit -m "Add Linus-Shyu.StarFetch $V" - git push fork "$BRANCH" || true + git push fork "$BRANCH" --force-with-lease || true export GH_TOKEN gh pr create --repo microsoft/winget-pkgs --head "Linus-Shyu:$BRANCH" --base "$DEFAULT_BRANCH" \ --title "Add Linus-Shyu.StarFetch $V" \ From 9fe72c736366aec0c0122de10a52ac8e16274eae Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Mon, 2 Feb 2026 23:40:58 +0800 Subject: [PATCH 84/91] fix(release): fetch fork before winget push to fix --force-with-lease --- .github/workflows/Release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index b916837..b6a24ab 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -280,6 +280,7 @@ jobs: git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git add . && git diff --staged --quiet || git commit -m "Add Linus-Shyu.StarFetch $V" + git fetch fork "$BRANCH" 2>/dev/null || true git push fork "$BRANCH" --force-with-lease || true export GH_TOKEN gh pr create --repo microsoft/winget-pkgs --head "Linus-Shyu:$BRANCH" --base "$DEFAULT_BRANCH" \ From 13b54b1eace794e7eb3dc2bf4f58c1161be7c409 Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Tue, 3 Feb 2026 00:04:08 +0800 Subject: [PATCH 85/91] fix(winget): use manifest schema 1.10.0 for winget-pkgs validation --- winget/README.md | 2 +- .../StarFetch/0.2.3/Linus-Shyu.StarFetch.installer.yaml | 4 ++-- .../StarFetch/0.2.3/Linus-Shyu.StarFetch.locale.en-US.yaml | 4 ++-- .../StarFetch/0.2.3/Linus-Shyu.StarFetch.version.yaml | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/winget/README.md b/winget/README.md index ce4960c..94ed628 100644 --- a/winget/README.md +++ b/winget/README.md @@ -1,6 +1,6 @@ # WinGet Manifests -Komac 生成的 manifest(1.12.0),已按 winget-pkgs 目录结构存放:`manifests/l/Linus-Shyu/StarFetch//`。 +Manifest 使用 1.10.0 规范(winget-pkgs 校验要求),已按目录结构存放:`manifests/l/Linus-Shyu/StarFetch//`。 ## 以后发新版本(不用再在命令行里逐项填) diff --git a/winget/manifests/l/Linus-Shyu/StarFetch/0.2.3/Linus-Shyu.StarFetch.installer.yaml b/winget/manifests/l/Linus-Shyu/StarFetch/0.2.3/Linus-Shyu.StarFetch.installer.yaml index c120e20..63faa7f 100644 --- a/winget/manifests/l/Linus-Shyu/StarFetch/0.2.3/Linus-Shyu.StarFetch.installer.yaml +++ b/winget/manifests/l/Linus-Shyu/StarFetch/0.2.3/Linus-Shyu.StarFetch.installer.yaml @@ -1,5 +1,5 @@ # Created with komac v2.15.0 -# yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.12.0.schema.json +# yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.10.0.schema.json PackageIdentifier: Linus-Shyu.StarFetch PackageVersion: 0.2.3 @@ -20,4 +20,4 @@ Installers: InstallerUrl: https://github.com/Linus-Shyu/StarFetch_Core/releases/download/v0.2.3/starfetch-x86_64-pc-windows-msvc.zip InstallerSha256: 4D8E1F14F4877A7400E5CD6DBA5912B93B616DD905A5DC820C8157FC936926FA ManifestType: installer -ManifestVersion: 1.12.0 +ManifestVersion: 1.10.0 diff --git a/winget/manifests/l/Linus-Shyu/StarFetch/0.2.3/Linus-Shyu.StarFetch.locale.en-US.yaml b/winget/manifests/l/Linus-Shyu/StarFetch/0.2.3/Linus-Shyu.StarFetch.locale.en-US.yaml index 9d76be8..fa8f703 100644 --- a/winget/manifests/l/Linus-Shyu/StarFetch/0.2.3/Linus-Shyu.StarFetch.locale.en-US.yaml +++ b/winget/manifests/l/Linus-Shyu/StarFetch/0.2.3/Linus-Shyu.StarFetch.locale.en-US.yaml @@ -1,5 +1,5 @@ # Created with komac v2.15.0 -# yaml-language-server: $schema=https://aka.ms/winget-manifest.defaultLocale.1.12.0.schema.json +# yaml-language-server: $schema=https://aka.ms/winget-manifest.defaultLocale.1.10.0.schema.json PackageIdentifier: Linus-Shyu.StarFetch PackageVersion: 0.2.3 @@ -19,4 +19,4 @@ Tags: - neofetch ReleaseNotesUrl: https://github.com/Linus-Shyu/StarFetch_Core/releases/tag/v0.2.3 ManifestType: defaultLocale -ManifestVersion: 1.12.0 +ManifestVersion: 1.10.0 diff --git a/winget/manifests/l/Linus-Shyu/StarFetch/0.2.3/Linus-Shyu.StarFetch.version.yaml b/winget/manifests/l/Linus-Shyu/StarFetch/0.2.3/Linus-Shyu.StarFetch.version.yaml index 6e9ef97..9d88331 100644 --- a/winget/manifests/l/Linus-Shyu/StarFetch/0.2.3/Linus-Shyu.StarFetch.version.yaml +++ b/winget/manifests/l/Linus-Shyu/StarFetch/0.2.3/Linus-Shyu.StarFetch.version.yaml @@ -1,8 +1,8 @@ # Created with komac v2.15.0 -# yaml-language-server: $schema=https://aka.ms/winget-manifest.version.1.12.0.schema.json +# yaml-language-server: $schema=https://aka.ms/winget-manifest.version.1.10.0.schema.json PackageIdentifier: Linus-Shyu.StarFetch PackageVersion: 0.2.3 DefaultLocale: en-US ManifestType: version -ManifestVersion: 1.12.0 +ManifestVersion: 1.10.0 From a3655a4bf0bcc5d8df2bb69cd9a93b3f1cf32791 Mon Sep 17 00:00:00 2001 From: daicx Date: Tue, 3 Feb 2026 02:20:49 +0800 Subject: [PATCH 86/91] Fix: Fix README(add new language(ZH-CN)and translated) --- README.cn.md | 107 +++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 29 ++++++++------ 2 files changed, 124 insertions(+), 12 deletions(-) create mode 100644 README.cn.md diff --git a/README.cn.md b/README.cn.md new file mode 100644 index 0000000..0aed522 --- /dev/null +++ b/README.cn.md @@ -0,0 +1,107 @@ +# StarFetch ⭐ + +[![Star历史图表](https://api.star-history.com/svg?repos=Linus-Shyu/StarFetch_Core&type=date&legend=top-left)](https://www.star-history.com/#Linus-Shyu/StarFetch_Core&type=date&legend=top-left) + +[![用Rust编写](https://img.shields.io/badge/Written%20in-Rust-CE412B?style=for-the-badge&logo=rust&logoColor=white)](https://www.rust-lang.org/) +[![吉祥物](https://img.shields.io/badge/Mascot-Ferris-orange?style=for-the-badge)](https://rustacean.net/) +[![许可证](https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge)](LICENSE) + +

+English +简体中文 +

+ +一个用Rust编写的美观且快速的系统信息工具,灵感来自neofetch。StarFetch使用优雅的ASCII艺术和智能的终端自适应来展示您的系统信息。 + +## 💡 灵感与鼓励 + +StarFetch 的诞生源于对命令行工具传承的深切尊重。我们非常荣幸能够收到**Dylan Araps**([neofetch](https://github.com/dylanaraps/neofetch)的作者)的这些鼓励之词: + +> "Starfetch很酷。看得出投入了很多心血。…祝你一切顺利,希望你能实现自己的目标。" +> — **Dylan Araps** + +他的提醒"编写软件很有趣,但也可能非常耗费精力"以及"照顾好自己"是我们在这个项目中坚持的核心价值观。 + +--- + +## ✨ 功能特性 + +- 🎨 **自适应ASCII艺术** - 根据终端宽度自动调整显示。 +- 🖥️ **全面的系统信息** - 主机名、操作系统、内核、运行时间、CPU、内存和软件包。 +- 🔗 **智能超链接** - 带有终端检测的可点击开发者链接。 +- 🌈 **美丽的颜色** - 支持ANSI颜色以获得优雅的终端输出。 +- ⚡ **闪电般快速** - 用Rust编写以获得最佳性能。 +- 🔧 **跨平台** - 适用于macOS、Linux和Windows。 + +## 📸 截图 + +```text + ╔════════════════════════════════╗ + ║ ★ STARFETCH ★ ║ + ╚════════════════════════════════╝ + +Developed by Linus Shyu + +hostname +-------- +OS: macOS +Kernel: 25.2.0 +Uptime: 6 Days 14 Hours 32 Minutes +Packages: 30 (brew) +CPU Cores: 10 +CPU Brand: Apple M5 +CPU Frequency: 4608 MHz +CPU Usage: 10.24% +Total Memory: 16 GB +Used Memory: 10.79 GB + +``` + +## 🚀 安装 + +### 环境 + +- **Rust** (最新稳定版) - [安装Rust](https://www.rust-lang.org/tools/install) +- **Cargo** (Rust附带) + +### 从源代码构建 + +```bash +git clone https://github.com/Linus-Shyu/StarFetch_Core.git +cd StarFetch_Core/StarFetch +cargo build --release + +``` + +### 全局安装 + +```bash +cargo install --path . + +``` + +## 📦 依赖 + +- `ansi_term` - 终端颜色和样式。 +- `sysinfo` - 跨平台系统信息。 +- `systemstat` - 系统统计信息(运行时间等)。 +- `terminal_size` - 终端宽度检测。 + +## 👥 作者 + +- **Linus Shyu** ([@Linus-Shyu](https://github.com/Linus-Shyu)) +- **Dylan Su** ([@xs10l3](https://github.com/xs10l3)) + +## 🙏 致谢 + +- **Dylan Araps** - 感谢原始灵感和友善的鼓励。 +- **Rust基金会** - 感谢商标合规性指导。我们使用**Ferris the Crab**(非官方但被官方认可的吉祥物)来代表我们对Rust社区的热爱。🦀 +- **开源社区** - 感谢那些使这个项目成为可能的优秀的开源库。 + +## 📄 许可证 + +本项目采用MIT许可证 - 详见[LICENSE](https://www.bing.com/search?q=LICENSE)文件。 + +--- + +⭐ 如果您觉得StarFetch有用,请考虑在GitHub上给它一个星标! diff --git a/README.md b/README.md index 79aff30..1419f00 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,11 @@ [![Mascot](https://img.shields.io/badge/Mascot-Ferris-orange?style=for-the-badge)](https://rustacean.net/) [![License](https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge)](LICENSE) +

+简体中文 +English +

+ A beautiful and fast system information tool written in Rust, inspired by neofetch. StarFetch displays your system information with elegant ASCII art and smart terminal adaptation. ## 💡 Inspiration & Encouragement @@ -34,7 +39,7 @@ His reminder that "writing software is fun but can also be very draining" and to ╔════════════════════════════════╗ ║ ★ STARFETCH ★ ║ ╚════════════════════════════════╝ - + Developed by Linus Shyu hostname @@ -96,8 +101,8 @@ irm https://raw.githubusercontent.com/Linus-Shyu/StarFetch_Core/master/install.p ### Prerequisites -* **Rust** (latest stable version) - [Install Rust](https://www.rust-lang.org/tools/install) -* **Cargo** (comes with Rust) +- **Rust** (latest stable version) - [Install Rust](https://www.rust-lang.org/tools/install) +- **Cargo** (comes with Rust) ### Build from Source @@ -121,21 +126,21 @@ If you see warnings like `profile package spec 'zlib-rs' in profile 'dev' did no ## 📦 Dependencies -* `ansi_term` - Terminal colors and styling. -* `sysinfo` - Cross-platform system info. -* `systemstat` - System statistics (uptime, etc.). -* `terminal_size` - Terminal width detection. +- `ansi_term` - Terminal colors and styling. +- `sysinfo` - Cross-platform system info. +- `systemstat` - System statistics (uptime, etc.). +- `terminal_size` - Terminal width detection. ## 👥 Authors -* **Linus Shyu** ([@Linus-Shyu](https://github.com/Linus-Shyu)) -* **Dylan Su** ([@xs10l3](https://github.com/xs10l3)) +- **Linus Shyu** ([@Linus-Shyu](https://github.com/Linus-Shyu)) +- **Dylan Su** ([@xs10l3](https://github.com/xs10l3)) ## 🙏 Acknowledgments -* **Dylan Araps** - For the original inspiration and kind words. -* **Rust Foundation** - For guidance on trademark compliance. We use **Ferris the Crab** (the unofficial-official mascot) to represent our love for the Rust community. 🦀 -* **The Open Source Community** - For the amazing crates that make this project possible. +- **Dylan Araps** - For the original inspiration and kind words. +- **Rust Foundation** - For guidance on trademark compliance. We use **Ferris the Crab** (the unofficial-official mascot) to represent our love for the Rust community. 🦀 +- **The Open Source Community** - For the amazing crates that make this project possible. ## 📄 License From 934ba9cc2f4732af6c23412056177d693149adc3 Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Tue, 3 Feb 2026 14:14:13 +0800 Subject: [PATCH 87/91] fix(winget): use version manifest filename PackageIdentifier.yaml per winget-pkgs validation --- .github/workflows/Release.yml | 2 +- ...us-Shyu.StarFetch.version.yaml => Linus-Shyu.StarFetch.yaml} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename winget/manifests/l/Linus-Shyu/StarFetch/0.2.3/{Linus-Shyu.StarFetch.version.yaml => Linus-Shyu.StarFetch.yaml} (100%) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index b6a24ab..36e9eda 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -276,7 +276,7 @@ jobs: -e "s|/v0.2.3|/v$V|g" \ "$REPO_ROOT/$TEMPLATE_DIR/Linus-Shyu.StarFetch.locale.en-US.yaml" > "$MANIFEST_DIR/Linus-Shyu.StarFetch.locale.en-US.yaml" sed -e "s/0\.2\.3/$V/g" \ - "$REPO_ROOT/$TEMPLATE_DIR/Linus-Shyu.StarFetch.version.yaml" > "$MANIFEST_DIR/Linus-Shyu.StarFetch.version.yaml" + "$REPO_ROOT/$TEMPLATE_DIR/Linus-Shyu.StarFetch.yaml" > "$MANIFEST_DIR/Linus-Shyu.StarFetch.yaml" git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git add . && git diff --staged --quiet || git commit -m "Add Linus-Shyu.StarFetch $V" diff --git a/winget/manifests/l/Linus-Shyu/StarFetch/0.2.3/Linus-Shyu.StarFetch.version.yaml b/winget/manifests/l/Linus-Shyu/StarFetch/0.2.3/Linus-Shyu.StarFetch.yaml similarity index 100% rename from winget/manifests/l/Linus-Shyu/StarFetch/0.2.3/Linus-Shyu.StarFetch.version.yaml rename to winget/manifests/l/Linus-Shyu/StarFetch/0.2.3/Linus-Shyu.StarFetch.yaml From b091453da8a71a2e2ecec85f164d02b4ae946e09 Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Tue, 3 Feb 2026 14:46:49 +0800 Subject: [PATCH 88/91] docs: add contributors cloudsmithy and Daicx in README, Cargo.toml, and CLI credit line --- README.cn.md | 2 ++ README.md | 2 ++ StarFetch/Cargo.toml | 2 +- StarFetch/src/hyperlink.rs | 8 ++++++++ StarFetch/src/main.rs | 18 +++++++++++++++++- 5 files changed, 30 insertions(+), 2 deletions(-) diff --git a/README.cn.md b/README.cn.md index 0aed522..0c40153 100644 --- a/README.cn.md +++ b/README.cn.md @@ -91,6 +91,8 @@ cargo install --path . - **Linus Shyu** ([@Linus-Shyu](https://github.com/Linus-Shyu)) - **Dylan Su** ([@xs10l3](https://github.com/xs10l3)) +- **cloudsmithy** ([@cloudsmithy](https://github.com/cloudsmithy)) +- **Daicx** ([@daicx0904](https://github.com/daicx0904)) ## 🙏 致谢 diff --git a/README.md b/README.md index 1419f00..a6b18a3 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,8 @@ If you see warnings like `profile package spec 'zlib-rs' in profile 'dev' did no - **Linus Shyu** ([@Linus-Shyu](https://github.com/Linus-Shyu)) - **Dylan Su** ([@xs10l3](https://github.com/xs10l3)) +- **cloudsmithy** ([@cloudsmithy](https://github.com/cloudsmithy)) +- **Daicx** ([@daicx0904](https://github.com/daicx0904)) ## 🙏 Acknowledgments diff --git a/StarFetch/Cargo.toml b/StarFetch/Cargo.toml index 39773c8..5c4a539 100644 --- a/StarFetch/Cargo.toml +++ b/StarFetch/Cargo.toml @@ -3,7 +3,7 @@ name = "starfetch" version = "0.2.3" edition = "2021" description = "A fast and stylish system information fetch tool." -authors = ["Linus Shyu <0x11@linusshyu.dev>"] +authors = ["Linus Shyu <0x11@linusshyu.dev>", "cloudsmithy", "Daicx"] license = "MIT" readme = "README.md" repository = "https://github.com/Linus-Shyu/StarFetch_Core" diff --git a/StarFetch/src/hyperlink.rs b/StarFetch/src/hyperlink.rs index 374ad27..5a41ee8 100644 --- a/StarFetch/src/hyperlink.rs +++ b/StarFetch/src/hyperlink.rs @@ -77,3 +77,11 @@ pub fn styled_developer_name() -> String { pub fn styled_developer_name_dylan() -> String { "Dylan Su".to_string() } + +pub fn styled_developer_name_cloudsmithy() -> String { + "cloudsmithy".to_string() +} + +pub fn styled_developer_name_daicx() -> String { + "Daicx".to_string() +} diff --git a/StarFetch/src/main.rs b/StarFetch/src/main.rs index 1519a6e..738005b 100644 --- a/StarFetch/src/main.rs +++ b/StarFetch/src/main.rs @@ -110,7 +110,7 @@ fn main() { "https://github.com/Linus-Shyu" ) ); - print!(" and "); + print!(", "); print!( "{}", hyperlink::hyperlink( @@ -118,6 +118,22 @@ fn main() { "https://github.com/xs10l3" ) ); + print!(", "); + print!( + "{}", + hyperlink::hyperlink( + &hyperlink::styled_developer_name_cloudsmithy(), + "https://github.com/cloudsmithy" + ) + ); + print!(", and "); + print!( + "{}", + hyperlink::hyperlink( + &hyperlink::styled_developer_name_daicx(), + "https://github.com/daicx0904" + ) + ); println!(); From 6f73b36838a9e067d6a0f16cead09677b1bff46c Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Thu, 5 Feb 2026 13:01:35 +0800 Subject: [PATCH 89/91] Add developer info --- StarFetch/src/main.rs | 1 - StarFetch/src/system.rs | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/StarFetch/src/main.rs b/StarFetch/src/main.rs index 738005b..f9861cb 100644 --- a/StarFetch/src/main.rs +++ b/StarFetch/src/main.rs @@ -147,4 +147,3 @@ fn main() { system::print_disk_info(); } -// Just wanna test homebrew. diff --git a/StarFetch/src/system.rs b/StarFetch/src/system.rs index eea4279..992f271 100644 --- a/StarFetch/src/system.rs +++ b/StarFetch/src/system.rs @@ -453,8 +453,10 @@ pub fn print_system_help_info() { pub fn print_about() { println!( - "{} {}", + "{} {} {} {}", Green.paint("Github Address:https://github.com/Linus-Shyu/StarFetch_Core \n"), + Green.paint("Thanks Daicx add Chinese version README.md \n"), + Green.paint("Thanks cloudsmithy fix releases.yml \n"), Green.paint("Thanks all users! \n"), ); } From 65b35952c3b643eacd375a72f264dd5dfb8dc7f7 Mon Sep 17 00:00:00 2001 From: Linus Shyu Date: Thu, 5 Feb 2026 13:18:14 +0800 Subject: [PATCH 90/91] Update Cargo.toml --- StarFetch/Cargo.lock | 2 +- StarFetch/Cargo.toml | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/StarFetch/Cargo.lock b/StarFetch/Cargo.lock index 0630506..2ac127e 100644 --- a/StarFetch/Cargo.lock +++ b/StarFetch/Cargo.lock @@ -289,7 +289,7 @@ dependencies = [ [[package]] name = "starfetch" -version = "0.2.3" +version = "0.2.4" dependencies = [ "ansi_term", "clap", diff --git a/StarFetch/Cargo.toml b/StarFetch/Cargo.toml index 5c4a539..a6c4c2f 100644 --- a/StarFetch/Cargo.toml +++ b/StarFetch/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "starfetch" -version = "0.2.3" +version = "0.2.4" edition = "2021" description = "A fast and stylish system information fetch tool." authors = ["Linus Shyu <0x11@linusshyu.dev>", "cloudsmithy", "Daicx"] @@ -26,8 +26,6 @@ Part of the Star Lake AI ecosystem, designed for speed and aesthetic. """ license-file = ["LICENSE", "4"] # 确保根目录有 LICENSE 文件 -# 必须显式列出二进制:指定 assets 后会替换默认 $auto,不写则 .deb 里没有 /usr/bin/starfetch -# target/release/ 会被 cargo-deb 替换为实际路径(含 cross 的 target/xxx/release/) assets = [ ["target/release/starfetch", "usr/bin/", "755"], ["README.md", "usr/share/doc/starfetch/README", "644"], From 12dec7409407f2c1e09cf052d7b67986010d800e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Feb 2026 18:40:18 +0000 Subject: [PATCH 91/91] Bump time from 0.3.41 to 0.3.47 in /StarFetch Bumps [time](https://github.com/time-rs/time) from 0.3.41 to 0.3.47. - [Release notes](https://github.com/time-rs/time/releases) - [Changelog](https://github.com/time-rs/time/blob/main/CHANGELOG.md) - [Commits](https://github.com/time-rs/time/compare/v0.3.41...v0.3.47) --- updated-dependencies: - dependency-name: time dependency-version: 0.3.47 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- StarFetch/Cargo.lock | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/StarFetch/Cargo.lock b/StarFetch/Cargo.lock index 2ac127e..4a52a54 100644 --- a/StarFetch/Cargo.lock +++ b/StarFetch/Cargo.lock @@ -121,9 +121,9 @@ checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" [[package]] name = "deranged" -version = "0.4.0" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" +checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587" dependencies = [ "powerfmt", ] @@ -201,9 +201,9 @@ dependencies = [ [[package]] name = "num-conv" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +checksum = "cf97ec579c3c42f953ef76dbf8d55ac91fb219dde70e49aa4a6b7d74e9919050" [[package]] name = "objc2-core-foundation" @@ -268,19 +268,19 @@ dependencies = [ ] [[package]] -name = "serde" -version = "1.0.219" +name = "serde_core" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.219" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", @@ -355,22 +355,22 @@ dependencies = [ [[package]] name = "time" -version = "0.3.41" +version = "0.3.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" +checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" dependencies = [ "deranged", "num-conv", "powerfmt", - "serde", + "serde_core", "time-core", ] [[package]] name = "time-core" -version = "0.1.4" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" +checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" [[package]] name = "unicode-ident"