forked from Aloshi/EmulationStation
-
Notifications
You must be signed in to change notification settings - Fork 344
141 lines (122 loc) · 5.32 KB
/
win32.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Build ES for Win32
on:
workflow_dispatch:
jobs:
build:
runs-on:
# https://github.com/actions/runner-images/blob/main/images/win/Windows2022-Readme.md
windows-2022
env:
# Build parameters for CMake
BUILD_TYPE: Release
Platform: Win32
defaults:
run:
shell: cmd
steps:
# Create directories for build (used by CMake) and nuget
- name: Set up directories
working-directory: ${{runner.workspace}}
run: mkdir build nuget
# Check-out repository under $GITHUB_WORKSPACE
# https://github.com/actions/checkout
- name: Check-out repository
uses: actions/checkout@v3
with:
submodules: true
# Discover location of MSBuild tool and to PATH environment variables
# https://github.com/microsoft/setup-msbuild
- name: Locate MSBuild
uses: microsoft/setup-msbuild@v1.3.1
# Use NuGet to download the latest libVLC.
- name: Download libVLC
working-directory: ${{runner.workspace}}/nuget
run: nuget install -ExcludeVersion VideoLAN.LibVLC.Windows
# Use vcpkg to download and build the latest cURL
- name: Build cURL static library
run: vcpkg install curl:x86-windows-static-md
# Use vcpkg to download and build the latest FreeImage
- name: Build FreeImage static library
run: vcpkg install freeimage:x86-windows-static-md
# Use vcpkg to download and build the latest FreeType2
- name: Build FreeType2 static library
run: vcpkg install freetype:x86-windows-static-md
# Use vcpkg to download and build the latest SDL2
- name: Build SDL2 static library
run: vcpkg install sdl2:x86-windows-static-md
# Use vcpkg to download and build the latest RapidJSON
- name: Build RapidJSON static library
run: vcpkg install rapidjson:x86-windows-static-md
# Setup environment variables for subsequent steps
# Note: Forward slashes are used for CMake compatibility
- name: Set up environment
run: |
set VCPKG=%VCPKG_INSTALLATION_ROOT%/installed/x86-windows-static-md
set "VCPKG=%VCPKG:\=/%"
set NUGET=${{runner.workspace}}/nuget
set "NUGET=%NUGET:\=/%"
set VLC_HOME=%NUGET%/VideoLAN.LibVLC.Windows/build/x86
echo VCPKG=%VCPKG%>> %GITHUB_ENV%
echo NUGET=%NUGET%>> %GITHUB_ENV%
echo FREETYPE_DIR=%VCPKG%>> %GITHUB_ENV%
echo FREEIMAGE_HOME=%VCPKG%>> %GITHUB_ENV%
echo VLC_HOME=%VLC_HOME%>> %GITHUB_ENV%
echo RAPIDJSON_INCLUDE_DIRS=%VCPKG%/include>> %GITHUB_ENV%
echo CURL_INCLUDE_DIR=%VCPKG%/include>> %GITHUB_ENV%
echo SDL2_INCLUDE_DIR=%VCPKG%/include/SDL2>> %GITHUB_ENV%
echo VLC_INCLUDE_DIR=%VLC_HOME%/include>> %GITHUB_ENV%
echo CURL_LIBRARY=%VCPKG%/lib/*.lib>> %GITHUB_ENV%
echo SDL2_LIBRARY=%VCPKG%/lib/manual-link/SDL2main.lib>> %GITHUB_ENV%
echo VLC_LIBRARIES=%VLC_HOME%/libvlc*.lib>> %GITHUB_ENV%
echo VLC_VERSION=3.0.11>> %GITHUB_ENV%
# Use CMake to create Visual Studio project in build folder
- name: Create Visual Studio project
working-directory: ${{runner.workspace}}
run: cmake ${{github.workspace}}
-B build
-A %Platform%
-DRAPIDJSON_INCLUDE_DIRS=%RAPIDJSON_INCLUDE_DIRS%
-DCURL_INCLUDE_DIR=%CURL_INCLUDE_DIR%
-DSDL2_INCLUDE_DIR=%SDL2_INCLUDE_DIR%
-DVLC_INCLUDE_DIR=%VLC_INCLUDE_DIR%
-DCURL_LIBRARY=%CURL_LIBRARY%
-DSDL2_LIBRARY=%SDL2_LIBRARY%
-DVLC_LIBRARIES=%VLC_LIBRARIES%
-DVLC_VERSION=%VLC_VERSION%
-DCMAKE_EXE_LINKER_FLAGS=/SAFESEH:NO
# Use CMake to build project
- name: Build EmulationStation
working-directory: ${{runner.workspace}}
run: cmake --build build --config %BUILD_TYPE%
# Copy all other dependencies into Release folder
# Note: Forward slashes are replaced with back slashes for this step
- name: Collect dependencies
working-directory: ${{github.workspace}}/Release
run: |
set "VLC_ROOT=%VLC_HOME:/=\%"
mkdir .emulationstation
xcopy ..\resources .\resources /h /i /c /k /e /r /y
copy %VLC_ROOT%\*.dll .
xcopy %VLC_ROOT%\plugins .\plugins /h /i /c /k /e /r /y
# Create systems configuration file
- name: Create systems configuration file
working-directory: ${{github.workspace}}/Release/.emulationstation
run: |
echo ^<!-- This is the EmulationStation Systems configuration file.> es_systems.cfg
echo All systems must be contained within the ^<systemList^> tag.--^>>> es_systems.cfg
echo:>> es_systems.cfg
echo ^<systemList^>>> es_systems.cfg
echo:>> es_systems.cfg
echo ^</systemList^>>> es_systems.cfg
# Uploads artifacts from workflow
# https://github.com/actions/upload-artifact
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: EmulationStation
path: |
${{github.workspace}}\Release\*.exe
${{github.workspace}}\Release\*.dll
${{github.workspace}}\Release\resources\
${{github.workspace}}\Release\plugins\
${{github.workspace}}\Release\.emulationstation\