-
-
Notifications
You must be signed in to change notification settings - Fork 1k
205 lines (180 loc) · 8.6 KB
/
windows.yml
File metadata and controls
205 lines (180 loc) · 8.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
name: 🏁 Windows
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 2'
env:
CARGO_TERM_COLOR: always
CZKAWKA_OFFICIAL_BUILD: ${{ vars.CZKAWKA_OFFICIAL_BUILD }}
jobs:
krokiet-compiled-on-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt update || true
sudo apt install -y mingw-w64 mingw-w64-x86-64-dev wget wget2 curl wine || true
- name: Setup rust version
run: |
rustup default 1.92.0
rustup target add x86_64-pc-windows-gnu
- 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"
mv target/x86_64-pc-windows-gnu/release/krokiet.exe windows_krokiet_on_linux.exe
- 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"
mv target/x86_64-pc-windows-gnu/debug/krokiet.exe windows_krokiet_on_linux.exe
- name: Pack with 7z
run: |
time 7z a -t7z -mx=3 czkawka_all.7z \
windows_krokiet_on_linux.exe
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: krokiet-windows-on-linux-${{ github.sha }}
path: |
czkawka_all.7z
if-no-files-found: error
- name: Release
uses: softprops/action-gh-release@v2
if: ${{ github.ref == 'refs/heads/master' && vars.HAVE_PAT_REPOSITORY_TOKEN == '1' }}
with:
tag_name: "Nightly"
files: |
windows_krokiet_on_linux.exe
token: ${{ secrets.PAT_REPOSITORY }}
# Skia not provides support for gnu toolchain, which is easy to cross-compile - https://github.com/rust-skia/rust-skia/issues/345
# So need to compile krokiet on msvc Windows
krokiet-compiled-on-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup rust version
run: |
rustup default 1.92.0
- 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"
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"
mv target/release/krokiet.exe windows_krokiet_on_windows_skia_vulkan.exe
- 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"
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"
mv target/debug/krokiet.exe windows_krokiet_on_windows_skia_vulkan.exe
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: krokiet-windows-on-windows-${{ github.sha }}
path: |
windows_krokiet_on_windows_skia_opengl.exe
windows_krokiet_on_windows_skia_vulkan.exe
if-no-files-found: error
- name: Release
uses: softprops/action-gh-release@v2
if: ${{ github.ref == 'refs/heads/master' && vars.HAVE_PAT_REPOSITORY_TOKEN == '1' }}
with:
tag_name: "Nightly"
files: |
windows_krokiet_on_windows_skia_opengl.exe
windows_krokiet_on_windows_skia_vulkan.exe
token: ${{ secrets.PAT_REPOSITORY }}
container_4_12:
runs-on: ubuntu-latest
container:
image: ghcr.io/mglolenstine/gtk4-cross:gtk-4.12
steps:
- uses: actions/checkout@v4
- name: Install additional dependencies
# gio is for the build script
run: |
dnf install curl wget2 wget unzip mingw64-bzip2.noarch mingw64-poppler mingw64-poppler-glib mingw32-python3 rust-gio-devel adwaita-icon-theme wine -y && dnf clean all -y
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
rustup default 1.92.0
rustup target add x86_64-pc-windows-gnu
mkdir -p package
mkdir -p package_with_icon_tmp
- 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"
cp target/x86_64-pc-windows-gnu/release/czkawka_gui.exe package/
cp target/x86_64-pc-windows-gnu/release/czkawka_cli.exe package/
- 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"
cp target/x86_64-pc-windows-gnu/fastci/czkawka_gui.exe package/
cp target/x86_64-pc-windows-gnu/fastci/czkawka_cli.exe package/
- name: Package
run: |
#!/bin/bash
set -euo pipefail
cp -t package $(pds -vv -f package/*.exe)
# Add gdbus which is recommended on Windows (why?)
cp $MINGW_PREFIX/bin/gdbus.exe package
# Handle the glib schema compilation as well
glib-compile-schemas $MINGW_PREFIX/share/glib-2.0/schemas/
mkdir -p package/share/glib-2.0/schemas/
cp -T $MINGW_PREFIX/share/glib-2.0/schemas/gschemas.compiled package/share/glib-2.0/schemas/gschemas.compiled
# Pixbuf stuff, in order to get SVGs (scalable icons) to load
mkdir -p package/lib/gdk-pixbuf-2.0
cp -rT $MINGW_PREFIX/lib/gdk-pixbuf-2.0 package/lib/gdk-pixbuf-2.0
cp -f -t package $(pds -vv -f $MINGW_PREFIX/lib/gdk-pixbuf-2.0/2.10.0/loaders/*)
find package -iname "*.dll" -or -iname "*.exe" -type f -exec mingw-strip {} +
cd package/share
wget2 https://github.com/qarmin/czkawka/files/10832192/gtk4_theme.zip
unzip gtk4_theme.zip
rm gtk4_theme.zip
cd ../..
wget2 https://github.com/qarmin/Automated-Fuzzer/releases/download/test/libGL.zip
unzip libGL.zip
mv libEGL.dll package/
mv libGLESv2.dll package/
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: czkawka-windows-${{ github.sha }}-4.12
path: |
./package
if-no-files-found: error
- name: Prepare files to release
run: |
cd package
zip -r ../windows_czkawka_gui_gtk_412.zip .
cd ..
- name: Release
uses: softprops/action-gh-release@v2
if: ${{ github.ref == 'refs/heads/master' && vars.HAVE_PAT_REPOSITORY_TOKEN == '1' }}
with:
tag_name: "Nightly"
files: |
windows_czkawka_gui_gtk_412.zip
token: ${{ secrets.PAT_REPOSITORY }}