forked from tsukinaha/tsukimi
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (57 loc) · 2.57 KB
/
CI_testing.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
name: feature/win - Windows GNU CI
on:
workflow_dispatch:
push:
branches:
- 'feature/win'
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
uses: actions/checkout@v4
- name: Install dependencies
run: |
rustup toolchain install stable-gnu
rustup default stable-gnu
C:\msys64\usr\bin\pacman.exe -S --needed --noconfirm mingw-w64-x86_64-gtk4 mingw-w64-x86_64-pkgconf mingw-w64-x86_64-gcc mingw-w64-x86_64-libadwaita mingw-w64-x86_64-mpv
C:\msys64\usr\bin\pacman.exe -Syu --noconfirm
- name: Build ${{ matrix.target }}
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 -recurse -path share/glib-2.0/* -exclude "*gschemas.compiled*"|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/
remove-item share/glib-2.0/schemas/*.xml
cp -recurse C:/msys64/mingw64/share/icons share/
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
compress-archive -path ./* -destinationpath ../tsukimi-${{matrix.arch}}.zip
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: tsukimi-${{matrix.arch}}
path: artifact/*.zip
compression-level: 5
retention-days: 3