-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (63 loc) · 2.78 KB
/
docker-image.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
65
66
67
68
69
70
71
72
73
74
75
76
name: Cross-Compile macOS to Windows
on:
push:
branches:
- main
permissions:
contents: write
jobs:
cross-compile:
runs-on: macos-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Install Homebrew
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- name: Install MinGW
run: brew install mingw-w64
- name: Download and Install SDL2
run: |
# Download SDL2 development libraries
curl -LO https://www.libsdl.org/release/SDL2-devel-2.30.11-mingw.tar.gz
tar -xzf SDL2-devel-2.30.11-mingw.tar.gz
sudo cp -r SDL2-2.30.11/x86_64-w64-mingw32 /usr/local/Cellar/mingw-w64/$(brew info --json=v1 mingw-w64 | jq -r '.[0].versions.stable')/toolchain-x86_64/
- name: Download and Install SDL2_image
run: |
# Download SDL2_image development libraries
curl -LO https://github.com/libsdl-org/SDL_image/releases/download/release-2.8.4/SDL2_image-devel-2.8.4-mingw.tar.gz
tar -xzf SDL2_image-devel-2.8.4-mingw.tar.gz
sudo cp -r SDL2_image-2.8.4/x86_64-w64-mingw32 /usr/local/Cellar/mingw-w64/$(brew info --json=v1 mingw-w64 | jq -r '.[0].versions.stable')/toolchain-x86_64/
- name: Download and Install SDL2_ttf
run: |
# Download SDL2_ttf development libraries
curl -LO https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.22.0/SDL2_ttf-devel-2.22.0-mingw.tar.gz
tar -xzf SDL2_ttf-devel-2.22.0-mingw.tar.gz
sudo cp -r SDL2_ttf-2.22.0/x86_64-w64-mingw32 /usr/local/Cellar/mingw-w64/$(brew info --json=v1 mingw-w64 | jq -r '.[0].versions.stable')/toolchain-x86_64/
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.23'
- name: Install Dependencies
run: |
cd player
go mod tidy
- name: Verify Go Environment
run: go env
- name: Verify Compiler
run: |
x86_64-w64-mingw32-gcc --version
x86_64-w64-mingw32-g++ --version
- name: Build Package
env:
CC: "x86_64-w64-mingw32-gcc"
CXX: "x86_64-w64-mingw32-g++"
CGO_ENABLED: 1
GOOS: "windows"
CGO_CFLAGS: "-I/usr/local/Cellar/mingw-w64/$(brew info --json=v1 mingw-w64 | jq -r '.[0].versions.stable')/toolchain-x86_64/x86_64-w64-mingw32/include -D_REENTRANT"
CGO_LDFLAGS: "-L/usr/local/Cellar/mingw-w64/$(brew info --json=v1 mingw-w64 | jq -r '.[0].versions.stable')/toolchain-x86_64/x86_64-w64-mingw32/lib -lSDL2"
run: |
mkdir -p ../JukaGUI-Trimui-Windows
cd player
go build -o ../JukaGUI-Trimui-Windows/JukaGUI.exe ./
echo "Build completed."