-
Notifications
You must be signed in to change notification settings - Fork 221
170 lines (166 loc) · 6.7 KB
/
Copy pathcicd.yml
File metadata and controls
170 lines (166 loc) · 6.7 KB
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
---
name: CI/CD
on:
push:
branches:
- master
pull_request:
jobs:
linux:
name: Linux
runs-on: ubuntu-latest
steps:
- name: Update apt index
run: sudo apt-get update -qq
- name: Install SDL2
run: sudo apt-get install libsdl2-dev
- name: Checkout EmptyEpsilon
uses: actions/checkout@v2
- name: Build and test
run: docker/build.sh
windows-cross:
name: Windows (Cross-Compile)
runs-on: ubuntu-latest
steps:
- name: Dependencies
run: |
sudo apt update -qq
sudo apt install build-essential cmake python3-minimal mingw-w64 ninja-build p7zip-full
- name: SeriousProton Checkout
uses: actions/checkout@v2
with:
repository: daid/SeriousProton
path: SeriousProton
ref: master
- name: EmptyEpsilon Checkout
uses: actions/checkout@v2
with:
path: EmptyEpsilon
- name: Build
run: |
mkdir -p _build_win32
cd _build_win32
cmake ../EmptyEpsilon -G Ninja -DCMAKE_MAKE_PROGRAM=ninja -DCMAKE_TOOLCHAIN_FILE=../EmptyEpsilon/cmake/mingw.toolchain -DSERIOUS_PROTON_DIR=../SeriousProton -DWARNING_IS_ERROR=1
ninja package
macos:
if: true
name: MacOS
runs-on: macos-latest
steps:
- name: Dependencies
run: |
brew uninstall --ignore-dependencies cmake || true
brew install cmake ninja sdl2 freetype
- name: SeriousProton Checkout
uses: actions/checkout@v4
with:
repository: daid/SeriousProton
path: SeriousProton
ref: master
- name: EmptyEpsilon Checkout
uses: actions/checkout@v4
with:
path: EmptyEpsilon
- name: Build
run: |
mkdir -p _build_macos
cd _build_macos
cmake ../EmptyEpsilon -G Ninja -DSERIOUS_PROTON_DIR=../SeriousProton -DCMAKE_INSTALL_PREFIX=. -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_PREFIX_PATH=$(brew --prefix sdl2) -DWARNING_IS_ERROR=1
ninja
ninja install
APP_PATH="./EmptyEpsilon.app"
mkdir -p "$APP_PATH/Contents/Frameworks"
cp $(brew --prefix sdl2)/lib/libSDL2-2.0.0.dylib "$APP_PATH/Contents/Frameworks/"
cp $(brew --prefix freetype)/lib/libfreetype.6.dylib "$APP_PATH/Contents/Frameworks/"
cp $(brew --prefix libpng)/lib/libpng16.16.dylib "$APP_PATH/Contents/Frameworks/" || true
install_name_tool -add_rpath @executable_path/../Frameworks "$APP_PATH/Contents/MacOS/EmptyEpsilon"
install_name_tool -change $(brew --prefix sdl2)/lib/libSDL2-2.0.0.dylib @rpath/libSDL2-2.0.0.dylib "$APP_PATH/Contents/MacOS/EmptyEpsilon"
install_name_tool -change $(brew --prefix freetype)/lib/libfreetype.6.dylib @rpath/libfreetype.6.dylib "$APP_PATH/Contents/MacOS/EmptyEpsilon"
install_name_tool -change $(brew --prefix libpng)/lib/libpng16.16.dylib @rpath/libpng16.16.dylib "$APP_PATH/Contents/Frameworks/libfreetype.6.dylib" || true
codesign --remove-signature "$APP_PATH/Contents/Frameworks/libSDL2-2.0.0.dylib"
codesign --remove-signature "$APP_PATH/Contents/Frameworks/libfreetype.6.dylib"
codesign --remove-signature "$APP_PATH/Contents/Frameworks/libpng16.16.dylib" || true
codesign --remove-signature "$APP_PATH/Contents/MacOS/EmptyEpsilon"
codesign --force --deep --timestamp --sign - "$APP_PATH"
VERSION=$(date +%Y.%m.%d)
echo "VERSION=$VERSION" >> $GITHUB_ENV
mkdir dmg_contents
cp -R "$APP_PATH" dmg_contents/
ln -s /Applications dmg_contents/Applications
hdiutil create -volname EmptyEpsilon -srcfolder dmg_contents -ov -format UDZO "MacOS_EmptyEpsilon_EE-${VERSION}-arm64.dmg"
rm -rf dmg_contents
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: EmptyEpsilon-EE-${{ env.VERSION }}-macOS-arm64
path: _build_macos/MacOS_EmptyEpsilon_EE-*-arm64.dmg
retention-days: 30
windows:
if: false
name: Windows
runs-on: windows-latest
strategy:
matrix:
build_type: [Debug, RelWithDebInfo, Release]
steps:
- name: Dependencies
run: |
$sdl_version = "2.0.16"
$sdl_link = "https://libsdl.org/release/SDL2-devel-$sdl_version-VC.zip"
$sdl_zip = "$env:GITHUB_WORKSPACE/sdl-dev.zip"
(new-object System.Net.WebClient).DownloadFile($sdl_link, $sdl_zip)
Expand-Archive -LiteralPath $sdl_zip -DestinationPath "$env:GITHUB_WORKSPACE/externals"
$sdl_config = @"
set(flavor x86)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(flavor x64)
endif()
set(_SDL2_prefix "`${CMAKE_CURRENT_LIST_DIR}/SDL2-$sdl_version")
add_library(SDL2::SDL2main STATIC IMPORTED)
set_target_properties(SDL2::SDL2main PROPERTIES
IMPORTED_LOCATION "`${_SDL2_prefix}/lib/`${flavor}/SDL2main.lib"
)
add_library(SDL2::SDL2 SHARED IMPORTED)
set_target_properties(SDL2::SDL2 PROPERTIES
IMPORTED_LOCATION "`${_SDL2_prefix}/lib/`${flavor}/SDL2.dll"
IMPORTED_IMPLIB "`${_SDL2_prefix}/lib/`${flavor}/SDL2.lib"
INTERFACE_INCLUDE_DIRECTORIES "`${_SDL2_prefix}/include"
)
target_link_libraries(SDL2::SDL2 INTERFACE SDL2::SDL2main)
"@
Set-Content -Path "$env:GITHUB_WORKSPACE/externals/sdl2-config.cmake" -Value $sdl_config
Get-Content "$env:GITHUB_WORKSPACE/externals/sdl2-config.cmake"
- name: EmptyEpsilon Checkout
uses: actions/checkout@v2
with:
path: EmptyEpsilon
- name: SeriousProton Checkout
uses: actions/checkout@v2
with:
repository: daid/SeriousProton
path: SeriousProton
ref: master
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: >
cmake ../EmptyEpsilon
-G "Visual Studio 17 2022" -A Win32
-DSDL2_DIR:PATH="$env:GITHUB_WORKSPACE/externals"
-DSERIOUS_PROTON_DIR="../SeriousProton"
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build . --config ${{ matrix.build_type }} --target package
luatest:
name: LuaTest
runs-on: ubuntu-latest
steps:
- name: Update apt index
run: sudo apt-get update -qq
- name: Install dependencies
run: sudo apt-get install lua5.3
- name: Checkout EmptyEpsilon
uses: actions/checkout@v2
- name: Test if lua scripts parse
run: find scripts/ -iname "*.lua" | xargs -P 4 -n 1 luac -p