Skip to content

Commit

Permalink
CI: add msvc test
Browse files Browse the repository at this point in the history
  • Loading branch information
Kosette committed Apr 9, 2024
1 parent ac7d6dc commit cace52d
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/build_msvc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: feature/win - Windows MSVC CI
on:
workflow_dispatch:
# push:
# branches:
# - 'feature/win'
# schedule:
# - cron: '5 6 * * *'

env:
CARGO_TERM_COLOR: always
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse

jobs:
build-release:
env:
RUST_BACKTRACE: full
strategy:
matrix:
include:
- arch-name: x86_64-windows-msvc
os: windows-latest
target: x86_64-pc-windows-msvc
artifact: tsukimi.exe
ext: .exe

runs-on: ${{matrix.os}}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: |
rustup default stable-msvc
py -3.12 -m pip install --user pipx
py -3.12 -m pipx ensurepath
pipx install gvsbuild
$env:Path = "C:\gtk-build\gtk\x64\release\lib\pkgconfig;C:\gtk-build\gtk\x64\release\bin;C:\msys64\usr\bin;C:\msys64\mingw64\bin;C:\msys64\mingw64\lib;C:\msys64\mingw64\include;" + $env:Path
$env:LIB = "C:\gtk-build\gtk\x64\release\lib;C:\msys64\mingw64\lib;" + $env:LIB
$env:INCLUDE = "C:\gtk-build\gtk\x64\release\include;C:\gtk-build\gtk\x64\release\include\cairo;C:\gtk-build\gtk\x64\release\include\glib-2.0;C:\gtk-build\gtk\x64\release\include\gobject-introspection-1.0;C:\gtk-build\gtk\x64\release\lib\glib-2.0\include;C:\msys64\mingw64\include;" + $env:INCLUDE
$env:PKG_CONFIG_PATH = "C:\gtk-build\gtk\x64\release\lib\pkgconfig;" + $env:PKG_CONFIG_PATH
gvsbuild build gtk4 libadwaita adwaita-icon-theme
- name: Install latest libmpv-dev
run: |
mkdir mpv_dev && cd mpv_dev
. ../scripts/get_latest_mpv.ps1
Get-Latest-Mpv
mv -force libmpv.dll.a c:/msys64/mingw64/lib
mv -force libmpv-2.dll c:/gtk-build/gtk/x64/release/bin/
mv -force include/mpv/*.h c:/msys64/mingw64/include/mpv/
cd ..
- name: Build ${{matrix.target}}
run: |
$env:Path = "C:\gtk-build\gtk\x64\release\lib\pkgconfig;C:\gtk-build\gtk\x64\release\bin;C:\msys64\usr\bin;C:\msys64\mingw64\bin;C:\msys64\mingw64\lib;C:\msys64\mingw64\include;" + $env:Path
$env:LIB = "C:\gtk-build\gtk\x64\release\lib;C:\msys64\mingw64\lib;" + $env:LIB
$env:INCLUDE = "C:\gtk-build\gtk\x64\release\include;C:\gtk-build\gtk\x64\release\include\cairo;C:\gtk-build\gtk\x64\release\include\glib-2.0;C:\gtk-build\gtk\x64\release\include\gobject-introspection-1.0;C:\gtk-build\gtk\x64\release\lib\glib-2.0\include;C:\msys64\mingw64\include;" + $env:INCLUDE
$env:PKG_CONFIG_PATH = "C:\gtk-build\gtk\x64\release\lib\pkgconfig;" + $env:PKG_CONFIG_PATH
cargo build --release --locked
mkdir C:/artifacts
cp target/release/${{matrix.artifact}} C:/artifacts/
cd C:/gtk-build/gtk/x64/release/bin
cp *.dll C:/artifacts/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: tsukimi-${{matrix.arch-name}}
path: C:/artifacts/*
compression-level: 5
retention-days: 3

0 comments on commit cace52d

Please sign in to comment.