From 63bb3c4168919d6084b0b4d9cc56e0a0258b9804 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mikrut?= Date: Mon, 5 Oct 2020 21:53:19 +0200 Subject: [PATCH] Test Windows CI --- .github/workflows/ci.yml | 44 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 24a26818a..b02ee8ce8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,8 +33,8 @@ jobs: target key: ${{ matrix.os }}-cargo-check-test-${{ matrix.toolchain }}-${{ matrix.type }}-${{ hashFiles('**/Cargo.lock') }} - - name: Install Gtk - run: sudo apt-get update; sudo apt install -y libgtk-3-dev + - name: Install Gtk, Mingw, unzip, zip and wget + run: sudo apt-get update; sudo apt install mingw-w64 libgtk-3-dev unzip wget zip -y if: ${{ runner.os == 'Linux' }} - name: Build Debug @@ -51,6 +51,39 @@ jobs: RUSTFLAGS: "-C debuginfo=0 -D warnings" if: ${{ runner.os == 'Linux' && matrix.type == 'release'}} + - name: Build GUI Windows Cross Compile + run: | + rustup target add x86_64-pc-windows-gnu + + echo "[target.x86_64-pc-windows-gnu]" > ~/.cargo/config + echo "linker = \"x86_64-w64-mingw32-gcc\"" >> ~/.cargo/config + echo "ar = \"x86_64-w64-mingw32-gcc-ar\"" >> ~/.cargo/config + + GTK_LIBRARY="$(pwd)/gtk_library" + GTK_APP="$(pwd)/gtk_app" + + wget https://github.com/qarmin/gtk_library_store/releases/download/3.24.0/mingw64.zip + unzip mingw64.zip -d $GTK_LIBRARY + GTK_LIBRARY="$GTK_LIBRARY/mingw64" + + PKG_CONFIG_ALLOW_CROSS=1 PKG_CONFIG_PATH="$GTK_LIBRARY/lib/pkgconfig" RUSTFLAGS="-L $GTK_LIBRARY/lib" cargo build --target=x86_64-pc-windows-gnu --bin czkawka_gui --release + + mkdir $GTK_APP + cp target/x86_64-pc-windows-gnu/release/czkawka_gui.exe $GTK_APP + cp $GTK_LIBRARY/bin/*.dll $GTK_APP + mkdir -p $GTK_APP/share/glib-2.0/schemas + mkdir $GTK_APP/share/icons + cp $GTK_LIBRARY/share/glib-2.0/schemas/* $GTK_APP/share/glib-2.0/schemas + cp -r $GTK_LIBRARY/share/icons/* $GTK_APP/share/icons + mkdir $GTK_APP/lib + cp -r $GTK_LIBRARY/lib/gdk-pixbuf-2.0 $GTK_APP/lib + + zip -r gtk_app.zip $GTK_APP + env: + CARGO_INCREMENTAL: 0 + RUSTFLAGS: "-C debuginfo=0 -D warnings" + if: ${{ runner.os == 'Linux' && matrix.type == 'release'}} + - name: Build CLI Alt Debug run: cargo build --bin czkawka_cli env: @@ -107,6 +140,13 @@ jobs: path: target/release/czkawka_gui if: ${{ runner.os == 'Linux' && matrix.type == 'release'}} + - name: Store Czkawka Windows GUI CrossComplile + uses: actions/upload-artifact@v2 + with: + name: czkawka_gui-Windows-GTK-GUI-${{ matrix.toolchain }} + path: gtk_app.zip + if: ${{ runner.os == 'Linux' && matrix.type == 'release'}} + - name: Store Czkawka GUI Orbtk uses: actions/upload-artifact@v2 with: