forked from qarmin/czkawka
-
Notifications
You must be signed in to change notification settings - Fork 0
156 lines (148 loc) · 6.18 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
name: 🏁 Windows
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 2'
env:
CARGO_TERM_COLOR: always
jobs:
container:
strategy:
matrix:
use_heif: [ non_heif ] #, heif ] - heif problems with mingw
runs-on: ubuntu-22.04
container:
image: ghcr.io/piegamesde/gtk4-cross:gtk-4.6
steps:
- uses: actions/checkout@v1
- name: Install additional dependencies
# gio is for the build script
run: dnf install wget2 unzip mingw64-bzip2.noarch mingw64-poppler mingw64-poppler-glib mingw32-python3 rust-gio-devel adwaita-icon-theme -y && dnf clean all -y
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: x86_64-pc-windows-gnu
- name: Cache ~/.cargo
uses: actions/cache@v1
with:
path: ~/.cargo
key: windows-dotcargo
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: windows-build-target
- name: Cross compile for Windows Heif
run: |
#!/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 --features heif
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/
if: ${{ matrix.use_heif == 'heif' }}
- name: Cross compile for Windows
run: |
#!/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/
if: ${{ matrix.use_heif == 'non_heif' }}
- 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@v3
with:
name: czkawka-windows-${{ github.sha }}-${{ matrix.use_heif }}
path: |
./package
if-no-files-found: error
# Provide option to log things to windows CLI
container_console_window:
runs-on: ubuntu-22.04
container:
image: ghcr.io/piegamesde/gtk4-cross:gtk-4.6
steps:
- uses: actions/checkout@v1
- name: Install additional dependencies
# gio is for the build script
run: dnf install wget2 unzip mingw64-bzip2.noarch mingw64-poppler mingw64-poppler-glib mingw32-python3 rust-gio-devel adwaita-icon-theme -y && dnf clean all -y
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: x86_64-pc-windows-gnu
- name: Cache ~/.cargo
uses: actions/cache@v1
with:
path: ~/.cargo
key: windows-dotcargo
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: windows-build-target
- name: Show console window on windows
run: sed -i 's|\#\!\[windows_subsystem|//#![windows_subsystem|' czkawka_gui/src/main.rs
- name: Cross compile for Windows
run: |
#!/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@v3
with:
name: czkawka-windows-${{ github.sha }}-console
path: |
./package
if-no-files-found: error