Skip to content

Commit 9073eb3

Browse files
pauldeluciaclaude
andauthored
feat: signed dmg for mac (#437)
* feat: signed mac binaries and dmg * fix * fix * extra check * app bundle * fix * fix icon * feat: simplify icon padding to 3% for correct sizing * ok * ok * fmt * fix: split dmgs into arm64 and x86 instead of universal * cleanup * fmt * fix naming * ok * fix * disk space fix * fix * fix * fix attempt * fix: enhance disk space cleanup for macOS DMG creation - Add more aggressive cleanup of Xcode caches and derived data - Remove additional Cargo build artifacts (.rlib, .d files) - Clean system-level caches to free maximum space - Add cleanup step for both ARM64 and x86_64 macOS builds - Remove temporary icon files after app bundle creation This should resolve the "No space left on device" error during DMG creation on GitHub Actions runners. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * macos-latest * latest for arm too * revert * re-revert * clear cache * fix * cleanup * try large * omg * apply suggestion * cleanup * fix * fix * fix --------- Co-authored-by: Claude <[email protected]>
1 parent 466b945 commit 9073eb3

File tree

7 files changed

+644
-49
lines changed

7 files changed

+644
-49
lines changed

.github/workflows/release.yml

Lines changed: 544 additions & 35 deletions
Large diffs are not rendered by default.

Cargo.lock

Lines changed: 20 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ raw-cpuid = "11.5.0"
7474
tempfile = { version = "3.20.0" }
7575
egui_kittest = { version = "0.32.0", features = ["eframe"] }
7676

77+
[build-dependencies]
78+
winres = "0.1"
79+
7780
[lints.clippy]
7881
uninlined_format_args = "allow"
7982

assets/DET_LOGO.png

761 KB
Loading

build.rs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
use std::env;
2+
use std::path::Path;
3+
4+
fn main() {
5+
println!("cargo:rerun-if-changed=assets/DET_LOGO.ico");
6+
7+
let target = env::var("TARGET").unwrap_or_default();
8+
if !target.contains("windows") {
9+
return;
10+
}
11+
12+
let icon_path = Path::new("assets/DET_LOGO.ico");
13+
if !icon_path.exists() {
14+
eprintln!(
15+
"cargo:warning=Windows icon asset missing at {}",
16+
icon_path.display()
17+
);
18+
return;
19+
}
20+
21+
let mut res = winres::WindowsResource::new();
22+
let icon_str = icon_path
23+
.to_str()
24+
.expect("icon path must be valid UTF-8 for the resource compiler");
25+
res.set_icon(icon_str);
26+
27+
if let Ok(version) = env::var("CARGO_PKG_VERSION") {
28+
res.set("FileVersion", &version);
29+
res.set("ProductVersion", &version);
30+
}
31+
32+
if let Ok(product_name) = env::var("CARGO_PKG_NAME") {
33+
res.set("ProductName", &product_name);
34+
}
35+
36+
if let Err(err) = res.compile() {
37+
panic!("Failed to embed Windows resources: {err}");
38+
}
39+
}

src/components/core_zmq_listener.rs

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -344,19 +344,27 @@ impl CoreZMQListener {
344344
let mut cursor = Cursor::new(data_bytes);
345345
match Block::consensus_decode(&mut cursor) {
346346
Ok(block) => {
347-
if let Some(ref tx) = tx_zmq_status {
348-
// ZMQ refresh socket connected status
349-
tx.send(ZMQConnectionEvent::Connected)
350-
.expect("Failed to send connected event");
351-
}
352-
if let Err(e) = sender.send((
353-
ZMQMessage::ChainLockedBlock(block),
354-
network,
355-
)) {
356-
eprintln!(
357-
"Error sending data to main thread: {}",
358-
e
359-
);
347+
match ChainLock::consensus_decode(&mut cursor) {
348+
Ok(chain_lock) => {
349+
// Send the ChainLock and Network back to the main thread
350+
if let Err(e) = sender.send((
351+
ZMQMessage::ChainLockedBlock(
352+
block, chain_lock,
353+
),
354+
network,
355+
)) {
356+
eprintln!(
357+
"Error sending data to main thread: {}",
358+
e
359+
);
360+
}
361+
}
362+
Err(e) => {
363+
eprintln!(
364+
"Error deserializing ChainLock: {}",
365+
e
366+
);
367+
}
360368
}
361369
}
362370
Err(e) => {

src/main.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,28 @@ fn main() -> eframe::Result<()> {
2525
runtime.block_on(start(&app_data_dir))
2626
}
2727

28+
fn load_icon() -> egui::IconData {
29+
let icon_bytes = include_bytes!("../assets/DET_LOGO.png");
30+
let image = image::load_from_memory(icon_bytes)
31+
.expect("Failed to load icon")
32+
.to_rgba8();
33+
let (width, height) = image.dimensions();
34+
egui::IconData {
35+
rgba: image.into_raw(),
36+
width,
37+
height,
38+
}
39+
}
40+
2841
async fn start(app_data_dir: &std::path::Path) -> Result<(), eframe::Error> {
42+
// Load icon for the window
43+
let icon_data = load_icon();
44+
2945
let native_options = eframe::NativeOptions {
3046
persist_window: true, // Persist window size and position
3147
centered: true, // Center window on startup if not maximized
3248
persistence_path: Some(app_data_dir.join("app.ron")),
49+
viewport: egui::ViewportBuilder::default().with_icon(icon_data),
3350
..Default::default()
3451
};
3552

0 commit comments

Comments
 (0)