diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 71e29773..af2765c7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,100 +3,58 @@ on: push: branches: - master - - continuous-delivery -jobs: +env: + GENERAL_FLAGS: "-DRETRO_DISABLE_PLUS=ON -DCMAKE_BUILD_TYPE=Release" + # Normally you would use $VCPKG_INSTALLATION_PATH, but it's broken...so hardcode C:/vcpkg + GENERAL_WIN_FLAGS: "-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake" + WIN32_FLAGS: "-DVCPKG_TARGET_TRIPLET=x86-windows-static -DCMAKE_PREFIX_PATH=C:/vcpkg/installed/x86-windows-static/ -A Win32" + WIN64_FLAGS: "-DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_PREFIX_PATH=C:/vcpkg/installed/x64-windows-static/" + # FIXME: For some reason ubuntu enables _FORTIFY_SOURCE by default, so let's override it to prevent IO bugs + GENERAL_LINUX_FLAGS: "-DCMAKE_CXX_FLAGS='-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0'" + +jobs: v3-windows: - runs-on: windows-2022 + runs-on: windows-latest steps: - name: Checkout - uses: actions/checkout@v1 + uses: actions/checkout@v4 with: submodules: recursive - - name: Setup MSBuild - uses: microsoft/setup-msbuild@v2 - - name: Download libogg, libvorbis, and libtheora for easier includes - run: | - Invoke-WebRequest -Uri "https://ftp.osuosl.org/pub/xiph/releases/ogg/libogg-1.3.5.zip" -OutFile "libogg.zip" - Expand-Archive -Path libogg.zip -DestinationPath ./dependencies/windows/ - Rename-Item ./dependencies/windows/libogg-1.3.5 libogg - Invoke-WebRequest -Uri "https://ftp.osuosl.org/pub/xiph/releases/vorbis/libvorbis-1.3.7.zip" -OutFile "libvorbis.zip" - Expand-Archive -Path libvorbis.zip -DestinationPath ./dependencies/windows/ - Rename-Item ./dependencies/windows/libvorbis-1.3.7 libvorbis - Invoke-WebRequest -Uri "https://ftp.osuosl.org/pub/xiph/releases/theora/libtheora-1.1.1.zip" -OutFile "libtheora.zip" - Expand-Archive -Path libtheora.zip -DestinationPath ./dependencies/windows/ - Rename-Item ./dependencies/windows/libtheora-1.1.1 libtheora - - name: Download GLEW - run: | - Invoke-WebRequest -Uri "https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0-win32.zip" -OutFile "GLEW.zip" - Expand-Archive -Path GLEW.zip -DestinationPath ./dependencies/windows/ - Rename-Item ./dependencies/windows/glew-2.2.0 glew - - name: Download SDL2 - run: | - Invoke-WebRequest -Uri "https://libsdl.org/release/SDL2-devel-2.28.3-VC.zip" -OutFile "SDL2.zip" - Expand-Archive -Path SDL2.zip -DestinationPath ./dependencies/windows/ - Rename-Item ./dependencies/windows/SDL2-2.28.3 SDL2 - - name: Run vcpkg - run: | - vcpkg install libogg:x86-windows-static libvorbis:x86-windows-static libtheora:x86-windows-static - vcpkg integrate install + - name: Install dependencies + run: vcpkg install glew sdl2 libogg libtheora libvorbis --triplet=x86-windows-static - name: Build RSDKv3 run: | - msbuild RSDKv3.sln -target:RSDKv3-ogl /p:Configuration=Release /p:Platform=x86 /p:ForceImportBeforeCppTargets="$env:GITHUB_WORKSPACE/props/winactions.props" + cmake -B build ${{env.GENERAL_FLAGS}} ${{env.GENERAL_WIN_FLAGS}} ${{env.WIN32_FLAGS}} + cmake --build build --parallel --config Release - name: Move artifacts run: | mkdir artifacts - move ./build/Win32/Release/OGL/*.dll ./artifacts - move ./build/Win32/Release/OGL/*.exe ./artifacts + mv ./build/Release/*.exe ./artifacts - name: Upload artifacts - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4 with: name: v3-windows path: artifacts v3-windows-x64: - runs-on: windows-2022 + runs-on: windows-latest steps: - name: Checkout - uses: actions/checkout@v1 + uses: actions/checkout@v4 with: submodules: recursive - - name: Setup MSBuild - uses: microsoft/setup-msbuild@v2 - - name: Download libogg, libvorbis, and libtheora for easier includes - run: | - Invoke-WebRequest -Uri "https://ftp.osuosl.org/pub/xiph/releases/ogg/libogg-1.3.5.zip" -OutFile "libogg.zip" - Expand-Archive -Path libogg.zip -DestinationPath ./dependencies/windows/ - Rename-Item ./dependencies/windows/libogg-1.3.5 libogg - Invoke-WebRequest -Uri "https://ftp.osuosl.org/pub/xiph/releases/vorbis/libvorbis-1.3.7.zip" -OutFile "libvorbis.zip" - Expand-Archive -Path libvorbis.zip -DestinationPath ./dependencies/windows/ - Rename-Item ./dependencies/windows/libvorbis-1.3.7 libvorbis - Invoke-WebRequest -Uri "https://ftp.osuosl.org/pub/xiph/releases/theora/libtheora-1.1.1.zip" -OutFile "libtheora.zip" - Expand-Archive -Path libtheora.zip -DestinationPath ./dependencies/windows/ - Rename-Item ./dependencies/windows/libtheora-1.1.1 libtheora - - name: Download GLEW - run: | - Invoke-WebRequest -Uri "https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0-win32.zip" -OutFile "GLEW.zip" - Expand-Archive -Path GLEW.zip -DestinationPath ./dependencies/windows/ - Rename-Item ./dependencies/windows/glew-2.2.0 glew - - name: Download SDL2 - run: | - Invoke-WebRequest -Uri "https://libsdl.org/release/SDL2-devel-2.28.3-VC.zip" -OutFile "SDL2.zip" - Expand-Archive -Path SDL2.zip -DestinationPath ./dependencies/windows/ - Rename-Item ./dependencies/windows/SDL2-2.28.3 SDL2 - - name: Run vcpkg - run: | - vcpkg install libogg:x64-windows-static libvorbis:x64-windows-static libtheora:x64-windows-static - vcpkg integrate install + - name: Install dependencies + run: vcpkg install glew sdl2 libogg libtheora libvorbis --triplet=x64-windows-static - name: Build RSDKv3 run: | - msbuild RSDKv3.sln -target:RSDKv3-ogl /p:Configuration=Release /p:Platform=x64 /p:ForceImportBeforeCppTargets="$env:GITHUB_WORKSPACE/props/winactions_x64.props" + cmake -B build ${{env.GENERAL_FLAGS}} ${{env.GENERAL_WIN_FLAGS}} ${{env.WIN64_FLAGS}} + cmake --build build --parallel --config Release - name: Move artifacts run: | mkdir artifacts - move ./build/x64/Release/OGL/*.dll ./artifacts - move ./build/x64/Release/OGL/*.exe ./artifacts + mv ./build/Release/*.exe ./artifacts - name: Upload artifacts - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4 with: name: v3-windows-x64 path: artifacts @@ -153,20 +111,27 @@ jobs: v3-linux: runs-on: ubuntu-latest steps: - - name: Checkout repository + - name: Checkout uses: actions/checkout@v4 with: submodules: recursive - name: Install dependencies run: | sudo apt-get update - sudo apt-get install libtheora-dev libogg-dev libvorbis-dev libsdl2-dev libglew-dev - ls ./dependencies/all + sudo apt-get install libglew-dev libglfw3-dev libsdl2-dev libogg-dev libtheora-dev libvorbis-dev - name: Build RSDKv3 run: | - make RETRO_DISABLE_PLUS=1 - - name: Upload artifact + cmake -B build ${{env.GENERAL_FLAGS}} ${{env.GENERAL_LINUX_FLAGS}} + cmake --build build --parallel + # tar the executables so that they don't lose exec permissions + # see: https://github.com/actions/upload-artifact?tab=readme-ov-file#permission-loss + - name: Move artifacts + run: | + mkdir artifacts + mv ./build/RSDKv3* ./artifacts + tar -czvf linux.tar.gz -C ./artifacts . + - name: Upload artifacts uses: actions/upload-artifact@v4 with: name: v3-linux - path: bin + path: linux.tar.gz