-
-
Notifications
You must be signed in to change notification settings - Fork 666
347 lines (308 loc) · 13.2 KB
/
windows.yml
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
name: 🏁 Windows
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 2'
env:
CARGO_TERM_COLOR: always
jobs:
krokiet-compiled-on-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies(mostly sd)
run: |
sudo apt update || true;sudo apt install -y mingw-w64 mingw-w64-x86-64-dev
wget https://github.com/chmln/sd/releases/download/v1.0.0/sd-v1.0.0-x86_64-unknown-linux-gnu.tar.gz -O a.tar.gz
tar -xzf a.tar.gz
cp sd-v1.0.0-x86_64-unknown-linux-gnu/sd .
chmod +x ./sd
- name: Setup rust version
run: |
rustup target add x86_64-pc-windows-gnu
- name: Enable LTO
run: sed -i 's/#lto = "thin"/lto = "thin"/g' Cargo.toml
- name: Compile Krokiet
run: cargo build --release --target x86_64-pc-windows-gnu --bin krokiet
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: krokiet-windows-c-on-linux-${{ github.sha }}
path: |
target/x86_64-pc-windows-gnu/release/krokiet.exe
if-no-files-found: error
- name: Prepare files to release
run: |
mv target/x86_64-pc-windows-gnu/release/krokiet.exe windows_krokiet_on_linux.exe
- name: Show console window on windows
run: |
./sd -s '#![windows_subsystem = "windows"]' '//#![windows_subsystem = "windows"]' krokiet/src/main.rs
cat krokiet/src/main.rs
- name: Compile Krokiet Console
run: cargo build --release --target x86_64-pc-windows-gnu --bin krokiet
- name: Upload artifacts Console
uses: actions/upload-artifact@v4
with:
name: krokiet-windows-c-on-linux-${{ github.sha }}-console
path: |
target/x86_64-pc-windows-gnu/release/krokiet.exe
if-no-files-found: error
- name: Prepare files to release
run: |
mv target/x86_64-pc-windows-gnu/release/krokiet.exe windows_krokiet_on_linux_console.exe
- name: Release
uses: softprops/action-gh-release@v2
if: ${{ github.ref == 'refs/heads/master' }}
with:
tag_name: "Nightly"
files: |
windows_krokiet_on_linux.exe
windows_krokiet_on_linux_console.exe
token: ${{ secrets.PAT_REPOSITORY }}
krokiet-compiled-on-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies(mostly sd)
run: |
Invoke-WebRequest -Uri https://github.com/chmln/sd/releases/download/v1.0.0/sd-v1.0.0-x86_64-pc-windows-gnu.zip -OutFile a.zip
Expand-Archive ./a.zip
cp a/sd-v1.0.0-x86_64-pc-windows-gnu/sd.exe .
- name: Setup rust version
run: rustup default stable-x86_64-pc-windows-gnu
- name: Enable LTO
run: sed -i 's/#lto = "thin"/lto = "thin"/g' Cargo.toml
- name: Compile Krokiet
run: cargo build --release --bin krokiet
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: krokiet-windows-c-on-windows-${{ github.sha }}
path: |
target/release/krokiet.exe
if-no-files-found: error
- name: Prepare files to release
run: |
mv target/release/krokiet.exe windows_krokiet_on_windows.exe
- name: Show console window on windows
run: |
./sd.exe -s '#![windows_subsystem = "windows"]' '//#![windows_subsystem = "windows"]' krokiet/src/main.rs
cat krokiet/src/main.rs
- name: Compile Krokiet Console
run: cargo build --release --bin krokiet
- name: Upload artifacts Console
uses: actions/upload-artifact@v4
with:
name: krokiet-windows-c-on-windows-${{ github.sha }}-console
path: |
target/release/krokiet.exe
if-no-files-found: error
- name: Prepare files to release
run: |
mv target/release/krokiet.exe windows_krokiet_on_windows_console.exe
- name: Release
uses: softprops/action-gh-release@v2
if: ${{ github.ref == 'refs/heads/master' }}
with:
tag_name: "Nightly"
files: |
windows_krokiet_on_windows.exe
windows_krokiet_on_windows_console.exe
token: ${{ secrets.PAT_REPOSITORY }}
container_4_10:
runs-on: ubuntu-latest
container:
image: ghcr.io/mglolenstine/gtk4-cross:gtk-4.10
steps:
- uses: actions/checkout@v4
- name: Install additional dependencies
# gio is for the build script
run: |
dnf install curl wget2 unzip mingw64-bzip2.noarch mingw64-poppler mingw64-poppler-glib mingw32-python3 rust-gio-devel adwaita-icon-theme -y && dnf clean all -y
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
rustup target add x86_64-pc-windows-gnu
- name: Cross compile for Windows
run: |
source "$HOME/.cargo/env"
#!/bin/bash
set -euo pipefail
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
mkdir -p package
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: 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 ../..
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: czkawka-windows-${{ github.sha }}-4.10
path: |
./package
if-no-files-found: error
- name: Prepare files to release
run: |
mv ./package windows_czkawka_gui_gtk_410.zip
- name: Release
uses: softprops/action-gh-release@v2
if: ${{ github.ref == 'refs/heads/master' }}
with:
tag_name: "Nightly"
files: |
windows_czkawka_gui_gtk_410.zip
token: ${{ secrets.PAT_REPOSITORY }}
container_4_6:
runs-on: ubuntu-latest
container:
image: ghcr.io/piegamesde/gtk4-cross:gtk-4.6
steps:
- uses: actions/checkout@v4
- name: Install additional dependencies
# gio is for the build script
run: |
dnf install curl wget2 unzip mingw64-bzip2.noarch mingw64-poppler mingw64-poppler-glib mingw32-python3 rust-gio-devel adwaita-icon-theme -y && dnf clean all -y
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
rustup target add x86_64-pc-windows-gnu
- name: Cross compile for Windows
run: |
source "$HOME/.cargo/env"
#!/bin/bash
set -euo pipefail
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
mkdir -p package
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: 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 ../..
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: czkawka-windows-${{ github.sha }}-4.6
path: |
./package
if-no-files-found: error
- name: Prepare files to release
run: |
mv ./package windows_czkawka_gui_gtk_46.zip
- name: Release
uses: softprops/action-gh-release@v2
if: ${{ github.ref == 'refs/heads/master' }}
with:
tag_name: "Nightly"
files: |
windows_czkawka_gui_gtk_46.zip
token: ${{ secrets.PAT_REPOSITORY }}
# Provide option to log things to windows CLI
container_4_6_console_window:
runs-on: ubuntu-22.04
container:
image: ghcr.io/piegamesde/gtk4-cross:gtk-4.6
steps:
- uses: actions/checkout@v4
- name: Install dependencies(mostly sd)
run: |
dnf install wget -y
wget https://github.com/chmln/sd/releases/download/v1.0.0/sd-v1.0.0-x86_64-unknown-linux-gnu.tar.gz -O a.tar.gz
tar -xzf a.tar.gz
chmod +x sd-v1.0.0-x86_64-unknown-linux-gnu/sd
sudo cp sd-v1.0.0-x86_64-unknown-linux-gnu/sd /usr/bin/sd
- name: Install additional dependencies
# gio is for the build script
run: |
dnf install curl wget2 unzip mingw64-bzip2.noarch mingw64-poppler mingw64-poppler-glib mingw32-python3 rust-gio-devel adwaita-icon-theme -y && dnf clean all -y
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
rustup target add x86_64-pc-windows-gnu
- name: Show console window on windows
run: sd -s '#![windows_subsystem = "windows"]' '//#![windows_subsystem = "windows"]' krokiet/src/main.rs
- name: Cross compile for Windows
run: |
source "$HOME/.cargo/env"
#!/bin/bash
set -euo pipefail
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
mkdir -p package
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: 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 ../..
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: czkawka-windows-${{ github.sha }}-console-4.6
path: |
./package
if-no-files-found: error
- name: Prepare files to release
run: |
mv ./package windows_czkawka_gui_gtk_46_console.zip
- name: Release
uses: softprops/action-gh-release@v2
if: ${{ github.ref == 'refs/heads/master' }}
with:
tag_name: "Nightly"
files: |
windows_czkawka_gui_gtk_46_console.zip
token: ${{ secrets.PAT_REPOSITORY }}