-
Notifications
You must be signed in to change notification settings - Fork 56
107 lines (103 loc) · 3.19 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
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
name: Build
on: [push, pull_request, workflow_dispatch]
jobs:
build-win64:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: msys2/setup-msys2@v2
with:
install: make mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-SDL2 mingw-w64-x86_64-glew mingw-w64-x86_64-qt5-static
- name: Build NanoBoyAdvance
run: |
cmake \
-Bbuild \
-G"Unix Makefiles" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="-s" \
-DPLATFORM_QT_STATIC=ON \
-DSDL2_STATIC=ON \
-DGLEW_USE_STATIC_LIBS=ON \
-DQT5_STATIC_DIR="/c/tools/msys64/mingw64/qt5-static"
cd build
make -j$NUMBER_OF_PROCESSORS
- name: Collect artifacts
run: |
mkdir upload
cp -r build/bin/qt/{NanoBoyAdvance.exe,config.toml} upload
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: NanoBoyAdvance-win64
path: upload
if-no-files-found: error
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y libsdl2-dev libglew-dev qtbase5-dev
- name: Build NanoBoyAdvance
run: |
cmake -Bbuild -DCMAKE_BUILD_TYPE=Release
cd build
make -j$(nproc)
- name: Collect artifacts
run: |
mkdir upload
cp -r build/bin/qt/{NanoBoyAdvance,config.toml} upload
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: NanoBoyAdvance-linux
path: upload
if-no-files-found: error
build-macOS:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup dependencies
env:
HOMEBREW_NO_ANALYTICS: 1
run: brew install sdl2 glew qt@5
- name: Build NanoBoyAdvance
run: |
cmake -Bbuild \
-DCMAKE_CXX_FLAGS="-s" \
-DSDL2_STATIC=ON \
-DGLEW_USE_STATIC_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="$(brew --prefix qt@5);$(brew --prefix glew)" \
-DMACOS_BUILD_APP_BUNDLE=ON \
-DMACOS_BUNDLE_QT=ON
cd build
make -j$(getconf _NPROCESSORS_ONLN)
- name: Create disk image
run: |
mkdir dmg
cp -a build/bin/qt/NanoBoyAdvance.app dmg/NanoBoyAdvance.app
codesign -s - --deep -f dmg/NanoBoyAdvance.app
ln -s /Applications dmg/Applications
hdiutil create \
-fs HFS+ \
-volname NanoBoyAdvance \
-srcfolder dmg \
-ov -format UDBZ \
NanoBoyAdvance.dmg
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: NanoBoyAdvance-${{ runner.os }}
path: NanoBoyAdvance.dmg
if-no-files-found: error