Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 39 additions & 21 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,31 @@ jobs:
rustup default 1.92.0
rustup target add x86_64-pc-windows-gnu

- name: Download rcedit
run: |
curl -L https://github.com/electron/rcedit/releases/download/v2.0.0/rcedit-x64.exe -o rcedit-x64.exe

- name: Compile Krokiet Release
if: ${{ github.ref == 'refs/heads/master' }}
run: |
sed -i 's/#lto = /lto = /g' Cargo.toml
sed -i 's/#codegen-units /codegen-units /g' Cargo.toml
cargo build --release --target x86_64-pc-windows-gnu --bin krokiet --features "add_windows_icon"
cargo build --release --target x86_64-pc-windows-gnu --bin krokiet
mv target/x86_64-pc-windows-gnu/release/krokiet.exe windows_krokiet_on_linux.exe

export WINEPREFIX=$(mktemp -d)
wine rcedit-x64.exe windows_krokiet_on_linux.exe --set-icon krokiet/icons/krokiet_logo_flag.ico

- name: Compile Krokiet Debug
if: ${{ github.ref != 'refs/heads/master' }}
run: |
sed -i 's/^\(\[profile\.dev\.package.*\)/#\1/' Cargo.toml
sed -i 's|^opt-level = 3 # OPT PACKAGES|#opt-level = 3 # OPT PACKAGES|' Cargo.toml
cargo build --target x86_64-pc-windows-gnu --bin krokiet --features "add_windows_icon"
cargo build --target x86_64-pc-windows-gnu --bin krokiet
mv target/x86_64-pc-windows-gnu/debug/krokiet.exe windows_krokiet_on_linux.exe

export WINEPREFIX=$(mktemp -d)
wine rcedit-x64.exe windows_krokiet_on_linux.exe --set-icon krokiet/icons/krokiet_logo_flag.ico

- name: Pack with 7z
run: |
Expand Down Expand Up @@ -74,37 +84,39 @@ jobs:
run: |
rustup default 1.92.0

- name: Download rcedit
run: |
curl -L https://github.com/electron/rcedit/releases/download/v2.0.0/rcedit-x64.exe -o rcedit-x64.exe

- name: Compile Krokiet Release
if: ${{ github.ref == 'refs/heads/master' }}
run: |
# Replace '#lto = ' with 'lto = ' in Cargo.toml
powershell -Command "(Get-Content Cargo.toml) -replace '#lto = ', 'lto = ' | Set-Content Cargo.toml"
# Replace '#codegen-units ' with 'codegen-units ' in Cargo.toml
powershell -Command "(Get-Content Cargo.toml) -replace '#codegen-units ', 'codegen-units ' | Set-Content Cargo.toml"
cargo build --release --bin krokiet --no-default-features --features "winit_skia_opengl,winit_software,add_windows_icon"
powershell -Command "(Get-Content Cargo.toml) -replace '#lto = ', 'lto = ' | Set-Content Cargo.toml; (Get-Content Cargo.toml) -replace '#codegen-units ', 'codegen-units ' | Set-Content Cargo.toml"
cargo build --release --bin krokiet --no-default-features --features "winit_skia_opengl,winit_software"
mv target/release/krokiet.exe windows_krokiet_on_windows_skia_opengl.exe
cargo build --release --bin krokiet --no-default-features --features "winit_skia_vulkan,winit_software,add_windows_icon"
cargo build --release --bin krokiet --no-default-features --features "winit_skia_vulkan,winit_software"
mv target/release/krokiet.exe windows_krokiet_on_windows_skia_vulkan.exe
cargo build --release --bin krokiet --no-default-features --features "femtovg_wgpu,add_windows_icon"
cargo build --release --bin krokiet --no-default-features --features "femtovg_wgpu"
mv target/release/krokiet.exe windows_krokiet_on_windows_femtovg_wgpu.exe
cargo build --release --bin krokiet --no-default-features --features "winit_femtovg,winit_skia_opengl,winit_skia_vulkan,winit_software,femtovg_wgpu,add_windows_icon"
cargo build --release --bin krokiet --no-default-features --features "winit_femtovg,winit_skia_opengl,winit_skia_vulkan,winit_software,femtovg_wgpu"
mv target/release/krokiet.exe windows_krokiet_on_windows_all_backends.exe
Get-ChildItem windows_krokiet_on_windows_*.exe | ForEach-Object { ./rcedit-x64.exe $_.Name --set-icon krokiet/icons/krokiet_logo_flag.ico }

- name: Compile Krokiet Debug
if: ${{ github.ref != 'refs/heads/master' }}
run: |
# Comment out '[profile.dev.package.*' lines
powershell -Command "(Get-Content Cargo.toml) -replace '^\[profile\.dev\.package.*', { '#' + \$_ } | Set-Content Cargo.toml"
# Comment out 'opt-level = 3 # OPT PACKAGES'
powershell -Command "(Get-Content Cargo.toml) -replace '^opt-level = 3 # OPT PACKAGES', '#opt-level = 3 # OPT PACKAGES' | Set-Content Cargo.toml"
cargo build --bin krokiet --no-default-features --features "winit_skia_opengl,winit_software,add_windows_icon"
(Get-Content Cargo.toml) -replace '#lto = ','lto = ' -replace '#codegen-units ','codegen-units ' -replace '^\[profile\.dev\.package','#\[profile.dev.package' -replace '^opt-level = 3 # OPT PACKAGES','#opt-level = 3 # OPT PACKAGES' | Set-Content Cargo.toml

cargo build --bin krokiet --no-default-features --features "winit_skia_opengl,winit_software"
mv target/debug/krokiet.exe windows_krokiet_on_windows_skia_opengl.exe
cargo build --bin krokiet --no-default-features --features "winit_skia_vulkan,winit_software,add_windows_icon"
cargo build --bin krokiet --no-default-features --features "winit_skia_vulkan,winit_software"
mv target/debug/krokiet.exe windows_krokiet_on_windows_skia_vulkan.exe
cargo build --bin krokiet --no-default-features --features "femtovg_wgpu,add_windows_icon"
cargo build --bin krokiet --no-default-features --features "femtovg_wgpu"
mv target/debug/krokiet.exe windows_krokiet_on_windows_femtovg_wgpu.exe
cargo build --bin krokiet --no-default-features --features "winit_femtovg,winit_skia_opengl,winit_skia_vulkan,winit_software,femtovg_wgpu,add_windows_icon"
cargo build --bin krokiet --no-default-features --features "winit_femtovg,winit_skia_opengl,winit_skia_vulkan,winit_software,femtovg_wgpu"
mv target/debug/krokiet.exe windows_krokiet_on_windows_all_backends.exe

Get-ChildItem windows_krokiet_on_windows_*.exe | ForEach-Object { ./rcedit-x64.exe $_.Name --set-icon krokiet/icons/krokiet_logo_flag.ico }

- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -145,25 +157,31 @@ jobs:
rustup target add x86_64-pc-windows-gnu

mkdir -p package
mkdir -p package_with_icon_tmp
curl -L https://github.com/electron/rcedit/releases/download/v2.0.0/rcedit-x64.exe -o rcedit-x64.exe

- name: Cross compile for Windows - Release
if: ${{ github.ref == 'refs/heads/master' }}
run: |
source "$HOME/.cargo/env"
export PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/share/pkgconfig:$MINGW_PREFIX/lib/pkgconfig/:/usr/x86_64-w64-mingw32/lib/pkgconfig/
cargo build --target=x86_64-pc-windows-gnu --release --locked --features "add_windows_icon"
cargo build --target=x86_64-pc-windows-gnu --release --locked
cp target/x86_64-pc-windows-gnu/release/czkawka_gui.exe package/
cp target/x86_64-pc-windows-gnu/release/czkawka_cli.exe package/

export WINEPREFIX=$(mktemp -d)
wine rcedit-x64.exe package/czkawka_gui.exe --set-icon czkawka_gui/icons/icon.ico

- name: Cross compile for Windows - Debug
if: ${{ github.ref != 'refs/heads/master' }}
run: |
source "$HOME/.cargo/env"
export PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/share/pkgconfig:$MINGW_PREFIX/lib/pkgconfig/:/usr/x86_64-w64-mingw32/lib/pkgconfig/
cargo build --target=x86_64-pc-windows-gnu --locked --profile fastci --features "add_windows_icon"
cargo build --target=x86_64-pc-windows-gnu --locked --profile fastci
cp target/x86_64-pc-windows-gnu/fastci/czkawka_gui.exe package/
cp target/x86_64-pc-windows-gnu/fastci/czkawka_cli.exe package/

export WINEPREFIX=$(mktemp -d)
wine rcedit-x64.exe package/czkawka_gui.exe --set-icon czkawka_gui/icons/icon.ico

- name: Package
run: |
Expand Down
12 changes: 0 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions LICENSE_CC_BY_4_ICONS
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ Copyright (c) 2020 [jannuary](https://github.com/jannuary)
- data/icons/com.github.qarmin.czkawka.svg
- data/icons/com.github.qarmin.czkawka-symbolic.svg

Copyright (c) 2020-2026 Rafał Mikrut
- data/icons/io.github.qarmin.krokiet.svg

License: CC-BY-4.0
Creative Commons Attribution 4.0 International Public License
.
Expand Down
4 changes: 0 additions & 4 deletions czkawka_gui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ rand = "0.10.0"
[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3.9", features = ["combaseapi", "objbase", "shobjidl_core", "windef", "winerror", "wtypesbase", "winuser"] }

[build-dependencies]
winresource = "0.1"

[features]
default = []
heif = ["czkawka_core/heif"]
Expand All @@ -57,7 +54,6 @@ libavif = ["czkawka_core/libavif"]
# Allows to use trash on Linux when using xdg-portal, needed by e.g. flatpak where normal trash access always fails
# No-op on other OSes, it is slower and provides less helpful error messages
xdg_portal_trash = ["czkawka_core/xdg_portal_trash"]
add_windows_icon = []

[lints]
workspace = true
12 changes: 0 additions & 12 deletions czkawka_gui/build.rs

This file was deleted.

4 changes: 0 additions & 4 deletions krokiet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,13 @@ rodio = { version = "0.22.0", default-features = false, features = ["playback",
#slint-build = { path = "/home/rafal/test/slint/api/rs/build/"}
#slint-build = { git = "https://github.com/slint-ui/slint.git" }
slint-build = "1.15"
winresource = "0.1"

[features]
default = ["winit_femtovg", "winit_software"]

# Audio support
audio = ["rodio"]

# Bundles windows icon into executable
add_windows_icon = []

# Renderers
skia_opengl = ["slint/renderer-skia-opengl"]
skia_vulkan = ["slint/renderer-skia-vulkan"]
Expand Down
9 changes: 0 additions & 9 deletions krokiet/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,4 @@ fn main() {
} else {
slint_build::compile("ui/main_window.slint").expect("Unable to compile slint file");
}

if env::var("CARGO_FEATURE_ADD_WINDOWS_ICON").is_ok()
&& let Ok(target_os) = env::var("CARGO_CFG_TARGET_OS")
&& target_os == "windows"
{
let mut res = winresource::WindowsResource::new();
res.set_icon("icons/krokiet_logo_flag.ico");
res.compile().expect("Unable to compile icon");
}
}
Loading