-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (81 loc) · 3.39 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Build and Test on Windows
on:
push:
branches:
- main
permissions:
contents: write
jobs:
build-windows:
runs-on: windows-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Install MinGW
run: choco install mingw --version=8.1.0
- name: Download and Install SDL2
run: |
# Set up directories
if (-Not (Test-Path -Path 'C:\mingw64\include\SDL2')) { New-Item -ItemType Directory -Path 'C:\mingw64\include\SDL2' }
if (-Not (Test-Path -Path 'C:\mingw64\lib')) { New-Item -ItemType Directory -Path 'C:\mingw64\lib' }
# Download SDL2 development libraries
Invoke-WebRequest -Uri https://github.com/libsdl-org/SDL/releases/download/release-2.30.11/SDL2-devel-2.30.11-mingw.zip -OutFile SDL2.zip
7z x SDL2.zip -oSDL2
# Copy headers and libs to appropriate directories
xcopy SDL2\SDL2-2.30.11\x86_64-w64-mingw32\include\SDL2 C:\mingw64\include\SDL2 /E /I /Y
xcopy SDL2\SDL2-2.30.11\x86_64-w64-mingw32\lib C:\mingw64\lib /E /I /Y
- name: Download and Install SDL2_image
run: |
# Download SDL2_image development libraries
Invoke-WebRequest -Uri https://github.com/libsdl-org/SDL_image/releases/download/release-2.8.4/SDL2_image-devel-2.8.4-mingw.zip -OutFile SDL2_image.zip
7z x SDL2_image.zip -oSDL2_image
# Copy headers and libs to appropriate directories
xcopy SDL2_image\SDL2_image-2.8.4\x86_64-w64-mingw32\include\SDL2 C:\mingw64\include\SDL2 /E /I /Y
xcopy SDL2_image\SDL2_image-2.8.4\x86_64-w64-mingw32\lib C:\mingw64\lib /E /I /Y
- name: Download and Install SDL2_ttf
run: |
# Download SDL2_ttf development libraries
Invoke-WebRequest -Uri https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.22.0/SDL2_ttf-devel-2.22.0-mingw.zip -OutFile SDL2_ttf.zip
7z x SDL2_ttf.zip -oSDL2_ttf
# Copy headers and libs to appropriate directories
xcopy SDL2_ttf\SDL2_ttf-2.22.0\x86_64-w64-mingw32\include\SDL2 C:\mingw64\include\SDL2 /E /I /Y
xcopy SDL2_ttf\SDL2_ttf-2.22.0\x86_64-w64-mingw32\lib C:\mingw64\lib /E /I /Y
- name: Add MinGW and SDL2 to PATH
run: echo "C:\mingw64\bin" >> $GITHUB_PATH
- name: Verify SDL2 Installation
run: |
dir C:\mingw64\include\SDL2
dir C:\mingw64\lib
- 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: |
gcc --version
g++ --version
- name: Verify Environment Variables
run: |
echo "CGO_CFLAGS: $env:CGO_CFLAGS"
echo "CGO_LDFLAGS: $env:CGO_LDFLAGS"
- name: Build Package
env:
CC: "gcc"
CXX: "g++"
CGO_CFLAGS: "-IC:/mingw64/include/SDL2"
CGO_LDFLAGS: "-LC:/mingw64/lib"
run: |
mkdir -p ../JukaGUI-Trimui-Windows
cd player
echo "CC: $env:CC"
echo "CXX: $env:CXX"
echo "CGO_CFLAGS: $env:CGO_CFLAGS"
echo "CGO_LDFLAGS: $env:CGO_LDFLAGS"
go build -o ../JukaGUI-Trimui-Windows/JukaGUI.exe ./
echo "Build completed."