Skip to content

Commit a2e0b5d

Browse files
committed
Refresh GitHub Actions
1 parent 8fb61e8 commit a2e0b5d

File tree

1 file changed

+58
-54
lines changed

1 file changed

+58
-54
lines changed

.github/workflows/build.yml

+58-54
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,87 @@
1-
name: Build Sonic Nexus for multiple platforms
2-
1+
name: Build RSDKv2
32
on:
43
push:
54
branches:
65
- 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'"
815

916
jobs:
10-
windows:
11-
runs-on: windows-2022
17+
v2-windows:
18+
runs-on: windows-latest
1219
steps:
1320
- name: Checkout
1421
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
2627
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
3131
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
3549
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
3752
- name: Move artifacts
3853
run: |
3954
mkdir artifacts
40-
move ./build/Win32/Release/*.dll ./artifacts
41-
move ./build/Win32/Release/*.exe ./artifacts
55+
mv ./build/Release/*.exe ./artifacts
4256
- name: Upload artifacts
4357
uses: actions/upload-artifact@v4
4458
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
4963
steps:
5064
- name: Checkout
5165
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
6869
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
7273
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
7478
- name: Move artifacts
7579
run: |
7680
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 .
7983
- name: Upload artifacts
8084
uses: actions/upload-artifact@v4
8185
with:
82-
name: Nexus-Windows-x64
83-
path: artifacts
86+
name: v2-linux
87+
path: linux.tar.gz

0 commit comments

Comments
 (0)