forked from blueminder/flycast-dojo
-
Notifications
You must be signed in to change notification settings - Fork 0
218 lines (191 loc) · 9.75 KB
/
Copy pathc-cpp.yml
File metadata and controls
218 lines (191 loc) · 9.75 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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
name: C/C++ CI
on: [push, pull_request]
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
defaults:
run:
shell: ${{ matrix.config.shell }}
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
strategy:
matrix:
config:
- {name: apple-darwin, os: macos-latest, shell: sh, cmakeArgs: -DCMAKE_OSX_ARCHITECTURES=x86_64 -DWITH_SYSTEM_ZLIB=ON -DCURL_ZLIB=OFF -DCPR_BUILD_TESTS=OFF -DCPR_BUILD_TESTS_SSL=OFF -DCMAKE_USE_LIBSSH2=OFF -G Xcode -DAPPLE_BREAKPAD=ON, destDir: osx, buildType: RelWithDebInfo}
- {name: x86_64-pc-linux-gnu, os: ubuntu-22.04, shell: sh, destDir: linux, buildType: RelWithDebInfo}
- {name: x86_64-w64-mingw32, os: windows-2019, shell: 'msys2 {0}', cmakeArgs: -DWITH_SYSTEM_ZLIB=ON -DCURL_ZLIB=OFF -DCPR_FORCE_OPENSSL_BACKEND=ON -DCPR_BUILD_TESTS=OFF -DCPR_BUILD_TESTS_SSL=OFF -DCMAKE_USE_LIBSSH2=OFF -G "MinGW Makefiles", destDir: win, buildType: RelWithDebInfo}
steps:
- name: Set up build environment (macOS)
run: |
brew update
brew install libao ldid ninja pulseaudio zlib asio gnutls lua
VULKAN_VER=1.3.236.0 && aria2c --parameterized-uri=true https://{sdk.lunarg.com/sdk/download/$VULKAN_VER/mac,distfiles.macports.org/MoltenVK}/vulkansdk-macos-$VULKAN_VER.dmg
hdiutil attach ./vulkansdk-macos-*.dmg
sudo /Volumes/vulkansdk-macos-*/InstallVulkan.app/Contents/MacOS/InstallVulkan --root $HOME/VulkanSDK --accept-licenses --default-answer --confirm-command install
hdiutil detach /Volumes/vulkansdk-macos-*
echo "VULKAN_SDK=$HOME/VulkanSDK/macOS" >> $GITHUB_ENV
echo "/usr/local/opt/ccache/libexec" >> $GITHUB_PATH
echo "CCACHE_DIR=/tmp/ccache" >> $GITHUB_ENV
if: runner.os == 'macOS'
- name: Set up build environment (Linux)
run: |
sudo apt-get update
sudo apt-get -y install ccache libao-dev libasound2-dev libevdev-dev libgl1-mesa-dev liblua5.3-dev libminiupnpc-dev libpulse-dev libsdl2-dev libudev-dev libzip-dev ninja-build libcurl4-openssl-dev libasio-dev wget
if: runner.os == 'Linux'
- uses: actions/cache@v2
id: cache
with:
path: $HOME/ccache
key: ccache-${{ matrix.config.os }}-${{ github.sha }}
restore-keys: ccache-${{ matrix.config.os }}-
if: matrix.config.os == 'windows-2019'
- name: Download DX2010
if: matrix.config.os == 'windows-2019' && matrix.config.name != 'libretro-x86_64-w64-mingw32'
run: |
curl -L https://download.microsoft.com/download/a/e/7/ae743f1f-632b-4809-87a9-aa1bb3458e31/DXSDK_Jun10.exe -o _DX2010_.exe
7z x _DX2010_.exe DXSDK/Include -o_DX2010_
7z x _DX2010_.exe DXSDK/Lib/x86 -o_DX2010_
7z x _DX2010_.exe DXSDK/Lib/x64 -o_DX2010_
mv _DX2010_/DXSDK $HOME/ccache
rm -fR _DX*_ _DX*_.exe
shell: bash
- name: Set up build environment (Windows, MinGW)
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
install: git base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-x86_64-breakpad-git mingw-w64-x86_64-lua mingw-w64-x86_64-ninja mingw-w64-x86_64-SDL2 mingw-w64-x86_64-asio wget zip
if: endsWith(matrix.config.name, 'w64-mingw32')
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true
- name: Compile a universal OpenMP (macOS)
run: HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew reinstall --build-from-source --formula ./shell/apple/libomp.rb
if: matrix.config.name == 'apple-darwin'
- name: Compile OpenMP.xcframework (iOS)
run: ./shell/apple/emulator-ios/OpenMP/build_ios_openmp.sh --disableSimulator
if: matrix.config.name == 'apple-ios'
- uses: actions/cache@v3
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ matrix.config.name }}-${{ github.sha }}
restore-keys: ccache-${{ matrix.config.name }}-
if: runner.os != 'macOS'
- name: CMake
run: |
cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.config.buildType }} -DCMAKE_INSTALL_PREFIX=artifact ${{ matrix.config.cmakeArgs }}
cmake --build build --config ${{ matrix.config.buildType }} --parallel 2
cmake --build build --config ${{ matrix.config.buildType }} --target install
if: endsWith(matrix.config.name, 'w64-mingw32') != true
- name: CMake (windows)
shell: msys2 {0}
run: |
unset temp tmp
cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.config.buildType }} -DCMAKE_INSTALL_PREFIX=artifact ${{ matrix.config.cmakeArgs }}
cmake --build build --config ${{ matrix.config.buildType }} --parallel 2
cmake --build build --config ${{ matrix.config.buildType }} --target install
if: endsWith(matrix.config.name, 'w64-mingw32')
# - name: Unit Tests
# run: |
# mkdir -p build/tests
# cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.config.buildType }} -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=tests -DENABLE_CTEST=ON ${{ matrix.config.cmakeArgs }}
# cmake --build build --config Release --parallel 2
# ./build/tests/flycast
# if: matrix.config.name == 'x86_64-pc-linux-gnu'
- name: Install breakpad (linux)
working-directory: core/deps/breakpad
run: |
./configure
make
sudo make install
if: matrix.config.os == 'ubuntu-22.04'
- name: Dump symbols (linux)
shell: bash
run: |
dump_syms artifact/bin/flycast > flycast.elf.sym 2>/dev/null
BUILD_ID=`head -1 flycast.elf.sym | awk '{ print $4 }'`
mkdir -p symbols/flycast.elf/$BUILD_ID
mv flycast.elf.sym symbols/flycast.elf/$BUILD_ID
strip artifact/bin/flycast
if: matrix.config.os == 'ubuntu-22.04'
- name: Dump symbols (windows)
shell: msys2 {0}
run: |
core/deps/breakpad/bin/dump_syms artifact/bin/flycast.exe > flycast.exe.sym 2>/dev/null
BUILD_ID=`head -1 flycast.exe.sym | awk '{ print $4 }'`
mkdir -p symbols/flycast.exe/$BUILD_ID
mv flycast.exe.sym symbols/flycast.exe/$BUILD_ID
strip artifact/bin/flycast.exe
if: matrix.config.name == 'x86_64-w64-mingw32'
- name: Package app (macos)
run: |
cd artifact/bin
zip -rm flycast.app.zip "Flycast Dojo.app"
if: matrix.config.name == 'apple-darwin'
- name: Package app (linux)
shell: bash
run: |
CURRENT_VERSION=flycast-`cat core/version.h | awk 'NR==3 { print $3 }' | tr -d '"' | tr -d '\r'`
cd artifact/bin
mkdir $CURRENT_VERSION
mv flycast $CURRENT_VERSION/flycast.elf
cd $CURRENT_VERSION
wget https://github.com/blueminder/flycast-netplay-nvmem/archive/master.tar.gz
tar zxvf master.tar.gz
rm master.tar.gz
mv flycast-netplay-nvmem-master/ default/
rm default/README.md
zip -r default.zip default/*
mv default data
mv default.zip data/
mkdir replays
mkdir ROMs
wget https://raw.githubusercontent.com/blueminder/flycast-dojo/master/flycast_roms.json
cd ..
tar czvf linux-$CURRENT_VERSION.tar.gz $CURRENT_VERSION/* --remove-files
if: matrix.config.os == 'ubuntu-22.04'
- name: Package app (windows)
shell: msys2 {0}
run: |
CURRENT_VERSION=flycast-`cat core/version.h | awk 'NR==3 { print $3 }' | tr -d '"' | tr -d '\r'`
cd artifact/bin
mkdir $CURRENT_VERSION
mv flycast.exe $CURRENT_VERSION/flycast.exe
cd $CURRENT_VERSION
cp /mingw64/bin/{zlib1.dll,libssl-1_1-x64.dll,libcrypto-1_1-x64.dll} .
wget https://github.com/blueminder/flycast-netplay-nvmem/archive/master.tar.gz
tar zxvf master.tar.gz
rm master.tar.gz
mv flycast-netplay-nvmem-master/ default/
rm default/README.md
zip default.zip default/*
mv default data
mv default.zip data/
mkdir replays
mkdir ROMs
wget https://raw.githubusercontent.com/blueminder/flycast-dojo/master/flycast_roms.json
cd ..
zip -r $CURRENT_VERSION.zip $CURRENT_VERSION/*
rm -rf $CURRENT_VERSION
if: matrix.config.name == 'x86_64-w64-mingw32'
- uses: actions/upload-artifact@v2
with:
name: flycast-dojo-${{ matrix.config.name }}
path: artifact/bin
- name: Configure AWS Credentials
id: aws-credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.S3_KEY_ID }}
aws-secret-access-key: ${{ secrets.S3_SECRET_KEY }}
aws-region: us-east-2
if: github.event_name == 'push' && matrix.config.destDir != ''
- name: Upload to S3
run: aws s3 sync artifact/bin s3://flycast-dojo-builds/${{ matrix.config.destDir }}/${GITHUB_REF#refs/}-$GITHUB_SHA --acl public-read --follow-symlinks
shell: bash
if: ${{ steps.aws-credentials.outputs.aws-account-id != '' }}
- name: Upload symbols to S3
shell: bash
run: aws s3 sync symbols s3://flycast-dojo-symbols/${{ matrix.config.destDir }} --follow-symlinks
if: ${{ steps.aws-credentials.outputs.aws-account-id != '' && (matrix.config.os == 'windows-2019' || matrix.config.os == 'ubuntu-22.04' || matrix.config.name == 'apple-darwin') }}