-
Notifications
You must be signed in to change notification settings - Fork 12
64 lines (59 loc) · 2.44 KB
/
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Switchres CIv2
on: [push, pull_request]
jobs:
buildx86_64:
runs-on: ubuntu-latest
name: ${{ matrix.platform.name }} ${{ matrix.config.name }}
strategy:
matrix:
platform:
- { name: Linux GCC }
- { name: Windows MINGW, make_opts: PLATFORM=NT CROSS_COMPILE=x86_64-w64-mingw32- }
steps:
- uses: actions/checkout@v3
- name: Install Linux dependencies
if: matrix.platform.name == 'Linux GCC'
run: sudo apt-get install libxrandr-dev libdrm-dev libsdl2-dev
- name: Install Windows dependencies
if: matrix.platform.name == 'Windows MINGW'
run: |
sudo apt-get install mingw-w64 wget tar
sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
wget https://github.com/libsdl-org/SDL/releases/download/release-2.26.2/SDL2-devel-2.26.2-mingw.tar.gz
tar xvzf SDL2-devel-2.26.2-mingw.tar.gz
sudo make -C SDL2-2.26.2 CROSS_PATH=/usr ARCHITECTURES=x86_64-w64-mingw32 cross
wget https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.20.1/SDL2_ttf-devel-2.20.1-mingw.tar.gz
tar xvzf SDL2_ttf-devel-2.20.1-mingw.tar.gz
sudo make -C SDL2_ttf-2.20.1 CROSS_PATH=/usr ARCHITECTURES=x86_64-w64-mingw32 cross
- name: Build libs and binary
run: |
make libswitchres ${{matrix.platform.make_opts}}
make ${{matrix.platform.make_opts}}
- name: Build grid.exe (Windows only)
if: matrix.platform.name == 'Windows MINGW'
run: |
make ${{matrix.platform.make_opts}} clean
make ${{matrix.platform.make_opts}} grid
- name: Prepare artifacts
run: mkdir artifacts && cp -v libswitchres.{so,a,dll,lib} switchres{,.exe,.ini} grid{,.exe} /usr/x86_64-w64-mingw32/bin/SDL2{,_ttf}.dll /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll artifacts/ || true
- name: Upload artifact
uses: actions/[email protected]
with:
name: switchres-${{matrix.platform.name}}-x86_64
path: artifacts/
win32-build-x86_64-geometry:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build geometry.exe
run: |
pip install pyinstaller
pyinstaller --onefile geometry.py --icon=tv.ico
- name: Upload artifact
uses: actions/[email protected]
with:
name: geometry-win32-x86_64
path: dist/