Windows GNU CI #57
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: feature/win - Windows GNU CI | |
on: | |
workflow_dispatch: | |
# push: | |
# branches: | |
# - 'main' | |
env: | |
CARGO_TERM_COLOR: always | |
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse | |
jobs: | |
build-release: | |
env: | |
RUST_BACKTRACE: full | |
strategy: | |
matrix: | |
include: | |
- arch: x86_64-windows-gnu | |
os: windows-latest | |
target: x86_64-pc-windows-gnu | |
artifact: tsukimi.exe | |
runs-on: ${{matrix.os}} | |
steps: | |
- name: Checkout | |
if: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
if: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
run: > | |
rustup default stable-gnu; | |
C:\msys64\usr\bin\pacman.exe -Sy --needed --noconfirm mingw-w64-x86_64-pkgconf mingw-w64-x86_64-gcc | |
mingw-w64-x86_64-mpv mingw-w64-x86_64-libadwaita mingw-w64-x86_64-gstreamer mingw-w64-x86_64-gst-plugins-good | |
mingw-w64-x86_64-gst-plugins-bad mingw-w64-x86_64-gst-plugins-ugly mingw-w64-x86_64-gst-libav; | |
C:\msys64\usr\bin\pacman.exe -Syu --noconfirm | |
- name: Install clapper | |
if: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
run: | | |
mkdir clapper-dev && cd clapper-dev | |
Invoke-WebRequest -Uri "https://github.com/Kosette/clapper/releases/latest/download/clapper-dev.7z" -OutFile clapper-dev.7z | |
7z.exe x clapper-dev.7z && rm clapper-dev.7z | |
cp -recurse -force bin C:/msys64/mingw64/ | |
cp -recurse -force include C:/msys64/mingw64/ | |
cp -recurse -force lib C:/msys64/mingw64/ | |
- name: Build ${{ matrix.target }} | |
if: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
run: | | |
$env:Path = "C:\msys64\mingw64\bin;C:\msys64\mingw64\lib;C:\msys64\mingw64\include;" + $env:Path; | |
cargo build --release --locked | |
mkdir artifact && cd artifact | |
mkdir tsukimi-windows-gnu-amd64/ && cd tsukimi-windows-gnu-amd64/ && mkdir bin/ && mkdir share/ && mkdir lib/ | |
cp ../../target/release/${{ matrix.artifact }} bin/ | |
cp C:/msys64/mingw64/bin/*.dll bin/ | |
cp -recurse C:/msys64/mingw64/lib/gdk-pixbuf-2.0 lib/ | |
remove-item lib/gdk-pixbuf-2.0/2.10.0/loaders/* -exclude "*svg.dll" | |
cp -recurse C:/msys64/mingw64/share/glib-2.0 share/ | |
get-childitem -directory -path share/glib-2.0/ -exclude "*schemas*"|remove-item -recurse | |
mv ../../moe.tsuna.tsukimi.gschema.xml share/glib-2.0/schemas/ | |
C:/msys64/mingw64/bin/glib-compile-schemas.exe share/glib-2.0/schemas/ | |
gci -recurse -path share/glib-2.0/* -exclude "*.compiled"|remove-item -recurse | |
cp -recurse C:/msys64/mingw64/lib/gio lib/ | |
cp -recurse C:/msys64/mingw64/lib/gstreamer-1.0 lib/ && gci -recurse -path lib/gstreamer-1.0 -exclude "*.dll"|remove-item -recurse | |
cp -recurse C:/msys64/mingw64/share/icons share/ | |
cp ../../resources/ui/icons/tsukimi.png share/icons/ | |
remove-item -recurse share/icons/hicolor && remove-item -recurse share/icons/Adwaita/scalable && remove-item -recurse share/icons/Adwaita/cursors | |
remove-item -recurse share/icons/Adwaita/16x16 && remove-item -recurse share/icons/Adwaita/symbolic-up-to-32 | |
gci -directory -recurse .|where-object {$_.getfilesysteminfos().count -eq 0}|remove-item -recurse | |
- name: Upload artifact | |
if: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tsukimi-${{matrix.arch}} | |
path: | | |
artifact/* | |
compression-level: 5 | |
retention-days: 3 |