-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (43 loc) · 1.73 KB
/
win-build.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
name: Build on Windows
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build-win:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Install MSYS2
run: |
Invoke-WebRequest "https://repo.msys2.org/distrib/msys2-x86_64-latest.exe" -OutFile msys2-installer.exe
.\msys2-installer.exe in --confirm-command --accept-messages --root C:/msys64-bidrum
- name: Install FFmpeg and SDL2
run: |
C:\msys64-bidrum\usr\bin\bash.exe -l -c "pacman --noconfirm -S mingw-w64-x86_64-toolchain mingw-w64-x86_64-ffmpeg mingw-w64-x86_64-clang mingw-w64-x86_64-SDL2 mingw-w64-x86_64-SDL2_ttf mingw-w64-x86_64-SDL2_image mingw-w64-x86_64-SDL2_mixer mingw-w64-x86_64-pkg-config"
- name: Prepare GNU toolchain for rust
run: |
rustup toolchain install stable-gnu
rustup target add x86_64-pc-windows-gnu
rustup set default-host x86_64-pc-windows-gnu
rustup default stable-x86_64-pc-windows-gnu
- name: Create cargo config
run: |
mkdir .cargo
touch .cargo/config.toml
echo "[target.x86_64-pc-windows-gnu]" > .cargo/config.toml
echo "linker = `"C:`\`\msys64-bidrum`\`\mingw64`\`\bin`\`\gcc.exe`"" >> .cargo/config.toml
echo "ar = `"C:`\`\msys64-bidrum`\`\mingw64`\`\bin`\`\ar.exe`"" >> .cargo/config.toml
- name: Build
run: |
$env:PATH += ";C:\msys64-bidrum\mingw64\bin;"
cargo build --verbose --target x86_64-pc-windows-gnu
cargo build --release --verbose --target x86_64-pc-windows-gnu
- name: Upload compiled binaries
uses: actions/upload-artifact@v4
with:
name: windows-release-binary
path: ./target