Skip to content

Commit c7af9ec

Browse files
authored
Merge pull request #72 from umpire274/v0.5.1
Release v0.5.1: Embedded Windows icon and resource integration
2 parents 3f2eb30 + a206920 commit c7af9ec

37 files changed

+194
-11
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ jobs:
5454
- name: Install Rust target
5555
run: rustup target add ${{ matrix.target }}
5656

57+
- name: Build (with icon embedding on Windows)
58+
shell: bash
59+
run: |
60+
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
61+
rustup default stable-x86_64-pc-windows-msvc
62+
cargo build --release --target ${{ matrix.target }}
63+
else
64+
cargo build --release --target ${{ matrix.target }}
65+
fi
66+
5767
- name: Build binary
5868
run: cargo build --release --target ${{ matrix.target }}
5969

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/target
22
/.idea
3-
*.dat
3+
*.dat
4+
/examples

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# Changelog
22

3+
## [0.5.1] - 2025-10-27
4+
5+
### Added
6+
7+
- Embedded Windows application icon (`res/rFortune.ico`) directly into the executable.
8+
- Implemented using the `winres` build dependency.
9+
- The icon is now visible in Windows Explorer and taskbar.
10+
- New `res/` directory introduced for graphical assets (SVG, PNG, ICO).
11+
12+
### Changed
13+
14+
- Build process updated to automatically compile and embed Windows resources during `cargo build --release`.
15+
16+
### Notes
17+
18+
- The `.res` file generated during build is temporary and not stored in the repository.
19+
20+
---
21+
322
## [v0.5.0] - 2025-10-04
423

524
### 🔧 Refactoring

Cargo.lock

Lines changed: 89 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rfortune"
3-
version = "0.5.0"
3+
version = "0.5.1"
44
edition = "2024"
55
authors = ["Umpire274 <umpire274@gmail.com>"]
66
description = "A Rust-based clone of the classic UNIX 'fortune' command"
@@ -18,8 +18,14 @@ include = [
1818
"CHANGELOG.md"
1919
]
2020

21+
[build-dependencies]
22+
winresource = "0.1.23"
23+
24+
[package.metadata.winresource]
25+
Icon = "res/rfortune.ico"
26+
2127
[dependencies]
22-
clap = { version = "4.5.48", features = ["derive"] }
28+
clap = { version = "4.5.50", features = ["derive"] }
2329
rand = "0.9.2"
2430
dirs = "6.0.0"
2531
serde = { version = "1.0.228", features = ["derive"] }

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
# 🥠 rFortune
1+
<h1 style="text-align: left;">
2+
<img src="res/rfortune.svg" width="90" style="vertical-align: middle; margin-right: 8px;" alt="rFortune Logo"/>
3+
rFortune
4+
</h1>
25

36
**rFortune** is a modern, cross-platform reimplementation of the classic Unix `fortune` program, written in Rust.
47

build.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#[cfg(target_os = "windows")]
2+
fn main() {
3+
use winresource::WindowsResource;
4+
5+
// Assicurati che res/rfortune.ico esista
6+
let mut res = WindowsResource::new();
7+
res.set_icon("res/rfortune.ico")
8+
.set("FileDescription", "rFortune CLI")
9+
.set("ProductName", "rFortune")
10+
.set("OriginalFilename", "rfortune.exe")
11+
.set("FileVersion", env!("CARGO_PKG_VERSION"))
12+
.set("ProductVersion", env!("CARGO_PKG_VERSION"))
13+
.compile()
14+
.expect("Failed to embed icon resource");
15+
}
16+
17+
#[cfg(not(target_os = "windows"))]
18+
fn main() {}
28.6 KB
Loading
45.4 KB
Loading

res/favicon/android-icon-36x36.png

2.54 KB
Loading

0 commit comments

Comments
 (0)