|
1 |
| -name: Build Sonic Nexus for multiple platforms |
2 |
| - |
| 1 | +name: Build RSDKv2 |
3 | 2 | on:
|
4 | 3 | push:
|
5 | 4 | branches:
|
6 | 5 | - master
|
7 |
| - - continuous-delivery |
| 6 | + |
| 7 | +env: |
| 8 | + GENERAL_FLAGS: "-DCMAKE_BUILD_TYPE=Release" |
| 9 | + # Normally you would use $VCPKG_INSTALLATION_PATH, but it's broken...so hardcode C:/vcpkg |
| 10 | + GENERAL_WIN_FLAGS: "-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake" |
| 11 | + WIN32_FLAGS: "-DVCPKG_TARGET_TRIPLET=x86-windows-static -DCMAKE_PREFIX_PATH=C:/vcpkg/installed/x86-windows-static/ -A Win32" |
| 12 | + WIN64_FLAGS: "-DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_PREFIX_PATH=C:/vcpkg/installed/x64-windows-static/" |
| 13 | + # FIXME: For some reason ubuntu enables _FORTIFY_SOURCE by default, so let's override it to prevent IO bugs |
| 14 | + GENERAL_LINUX_FLAGS: "-DCMAKE_CXX_FLAGS='-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0'" |
8 | 15 |
|
9 | 16 | jobs:
|
10 |
| - windows: |
11 |
| - runs-on: windows-2022 |
| 17 | + v2-windows: |
| 18 | + runs-on: windows-latest |
12 | 19 | steps:
|
13 | 20 | - name: Checkout
|
14 | 21 | uses: actions/checkout@v4
|
15 |
| - - name: Setup MSBuild |
16 |
| - uses: microsoft/setup-msbuild@v2 |
17 |
| - - name: Download libogg, libvorbis, and libtheora for easier includes |
18 |
| - run : | |
19 |
| - Invoke-WebRequest -Uri "https://ftp.osuosl.org/pub/xiph/releases/ogg/libogg-1.3.5.zip" -OutFile "libogg.zip" |
20 |
| - Expand-Archive -Path libogg.zip -DestinationPath ./dependencies/windows/ |
21 |
| - Rename-Item ./dependencies/windows/libogg-1.3.5 libogg |
22 |
| - Invoke-WebRequest -Uri "https://ftp.osuosl.org/pub/xiph/releases/vorbis/libvorbis-1.3.7.zip" -OutFile "libvorbis.zip" |
23 |
| - Expand-Archive -Path libvorbis.zip -DestinationPath ./dependencies/windows/ |
24 |
| - Rename-Item ./dependencies/windows/libvorbis-1.3.7 libvorbis |
25 |
| - - name: Download SDL2 |
| 22 | + with: |
| 23 | + submodules: recursive |
| 24 | + - name: Install dependencies |
| 25 | + run: vcpkg install glew sdl2 libogg libvorbis --triplet=x86-windows-static |
| 26 | + - name: Build RSDKv2 |
26 | 27 | run: |
|
27 |
| - Invoke-WebRequest -Uri "https://libsdl.org/release/SDL2-devel-2.0.14-VC.zip" -OutFile "SDL2.zip" |
28 |
| - Expand-Archive -Path SDL2.zip -DestinationPath ./dependencies/windows/ |
29 |
| - Rename-Item ./dependencies/windows/SDL2-2.0.14 SDL2 |
30 |
| - - name: Run vcpkg |
| 28 | + cmake -B build ${{env.GENERAL_FLAGS}} ${{env.GENERAL_WIN_FLAGS}} ${{env.WIN32_FLAGS}} |
| 29 | + cmake --build build --parallel --config Release |
| 30 | + - name: Move artifacts |
31 | 31 | run: |
|
32 |
| - vcpkg install libogg:x86-windows-static libvorbis:x86-windows-static libtheora:x86-windows-static |
33 |
| - vcpkg integrate install |
34 |
| - - name: Build Sonic Nexus |
| 32 | + mkdir artifacts |
| 33 | + mv ./build/Release/*.exe ./artifacts |
| 34 | + - name: Upload artifacts |
| 35 | + uses: actions/upload-artifact@v4 |
| 36 | + with: |
| 37 | + name: v2-windows |
| 38 | + path: artifacts |
| 39 | + v2-windows-x64: |
| 40 | + runs-on: windows-latest |
| 41 | + steps: |
| 42 | + - name: Checkout |
| 43 | + uses: actions/checkout@v4 |
| 44 | + with: |
| 45 | + submodules: recursive |
| 46 | + - name: Install dependencies |
| 47 | + run: vcpkg install glew sdl2 libogg libvorbis --triplet=x64-windows-static |
| 48 | + - name: Build RSDKv2 |
35 | 49 | run: |
|
36 |
| - msbuild Nexus.sln /p:Configuration=Release /p:Platform=x86 /p:ForceImportBeforeCppTargets="$env:GITHUB_WORKSPACE/props/winactions.props" |
| 50 | + cmake -B build ${{env.GENERAL_FLAGS}} ${{env.GENERAL_WIN_FLAGS}} ${{env.WIN64_FLAGS}} |
| 51 | + cmake --build build --parallel --config Release |
37 | 52 | - name: Move artifacts
|
38 | 53 | run: |
|
39 | 54 | mkdir artifacts
|
40 |
| - move ./build/Win32/Release/*.dll ./artifacts |
41 |
| - move ./build/Win32/Release/*.exe ./artifacts |
| 55 | + mv ./build/Release/*.exe ./artifacts |
42 | 56 | - name: Upload artifacts
|
43 | 57 | uses: actions/upload-artifact@v4
|
44 | 58 | with:
|
45 |
| - name: Nexus-Windows |
46 |
| - path: artifacts |
47 |
| - windows-x64: |
48 |
| - runs-on: windows-2022 |
| 59 | + name: v2-windows-x64 |
| 60 | + path: artifacts |
| 61 | + v2-linux: |
| 62 | + runs-on: ubuntu-latest |
49 | 63 | steps:
|
50 | 64 | - name: Checkout
|
51 | 65 | uses: actions/checkout@v4
|
52 |
| - - name: Setup MSBuild |
53 |
| - uses: microsoft/setup-msbuild@v2 |
54 |
| - - name: Download libogg, libvorbis, and libtheora for easier includes |
55 |
| - run : | |
56 |
| - Invoke-WebRequest -Uri "https://ftp.osuosl.org/pub/xiph/releases/ogg/libogg-1.3.5.zip" -OutFile "libogg.zip" |
57 |
| - Expand-Archive -Path libogg.zip -DestinationPath ./dependencies/windows/ |
58 |
| - Rename-Item ./dependencies/windows/libogg-1.3.5 libogg |
59 |
| - Invoke-WebRequest -Uri "https://ftp.osuosl.org/pub/xiph/releases/vorbis/libvorbis-1.3.7.zip" -OutFile "libvorbis.zip" |
60 |
| - Expand-Archive -Path libvorbis.zip -DestinationPath ./dependencies/windows/ |
61 |
| - Rename-Item ./dependencies/windows/libvorbis-1.3.7 libvorbis |
62 |
| - - name: Download SDL2 |
63 |
| - run: | |
64 |
| - Invoke-WebRequest -Uri "https://libsdl.org/release/SDL2-devel-2.0.14-VC.zip" -OutFile "SDL2.zip" |
65 |
| - Expand-Archive -Path SDL2.zip -DestinationPath ./dependencies/windows/ |
66 |
| - Rename-Item ./dependencies/windows/SDL2-2.0.14 SDL2 |
67 |
| - - name: Run vcpkg |
| 66 | + with: |
| 67 | + submodules: recursive |
| 68 | + - name: Install dependencies |
68 | 69 | run: |
|
69 |
| - vcpkg install libogg:x64-windows-static libvorbis:x64-windows-static libtheora:x64-windows-static |
70 |
| - vcpkg integrate install |
71 |
| - - name: Build Sonic Nexus |
| 70 | + sudo apt-get update |
| 71 | + sudo apt-get install libglew-dev libglfw3-dev libsdl2-dev libogg-dev libvorbis-dev |
| 72 | + - name: Build RSDKv2 |
72 | 73 | run: |
|
73 |
| - msbuild Nexus.sln /p:Configuration=Release /p:Platform=x64 /p:ForceImportBeforeCppTargets="$env:GITHUB_WORKSPACE/props/winactions_x64.props" |
| 74 | + cmake -B build ${{env.GENERAL_FLAGS}} ${{env.GENERAL_LINUX_FLAGS}} |
| 75 | + cmake --build build --parallel |
| 76 | + # tar the executables so that they don't lose exec permissions |
| 77 | + # see: https://github.com/actions/upload-artifact?tab=readme-ov-file#permission-loss |
74 | 78 | - name: Move artifacts
|
75 | 79 | run: |
|
76 | 80 | mkdir artifacts
|
77 |
| - move ./build/x64/Release/*.dll ./artifacts |
78 |
| - move ./build/x64/Release/*.exe ./artifacts |
| 81 | + mv ./build/Nexus* ./artifacts |
| 82 | + tar -czvf linux.tar.gz -C ./artifacts . |
79 | 83 | - name: Upload artifacts
|
80 | 84 | uses: actions/upload-artifact@v4
|
81 | 85 | with:
|
82 |
| - name: Nexus-Windows-x64 |
83 |
| - path: artifacts |
| 86 | + name: v2-linux |
| 87 | + path: linux.tar.gz |
0 commit comments