name: Build on: [ push ] jobs: windows: strategy: matrix: configuration: [ Release, Debug ] sys: [ clang64-x86_64 ] name: Windows runs-on: windows-latest defaults: run: shell: msys2 {0} steps: - uses: actions/checkout@v3 name: Clone repository with: submodules: recursive - uses: msys2/setup-msys2@v2 name: Set up MSYS2 with: msystem: ${{ matrix.sys }} install: >- mingw-w64-${{ matrix.sys }}-${{ contains(matrix.sys, 'clang') && 'clang' || 'gcc' }} mingw-w64-${{ matrix.sys }}-cmake mingw-w64-${{ matrix.sys }}-ninja mingw-w64-${{ matrix.sys }}-boost mingw-w64-${{ matrix.sys }}-pugixml mingw-w64-${{ matrix.sys }}-ogre3d mingw-w64-${{ matrix.sys }}-qt6 - name: Generate Ninja build files run: cmake -G Ninja -B build -DCMAKE_BUILD_TYPE=${{ matrix.configuration == 'Release' && 'MinSizeRel' || matrix.configuration }} . - name: Build (Ninja) run: ninja -C build # ouch - unless and until we start using CMake's install command, these next few steps are a necessary evil - name: Organize binaries run: mkdir build/dist && mv build/*.exe build/dist && cd build/dist && for x in *.exe; do mv $x "RNR.$x"; done - name: Add Qt dependencies run: windeployqt6 build/dist/*.exe - name: Add runtime dependencies run: ldd build/dist/*.exe | grep "=> /" | awk '{print $3}' | grep "clang64" | xargs -I '{}' cp -v '{}' build/dist - name: Add OGRE plugins run: cp Content/win32_plugins.cfg build/dist/plugins.cfg && mkdir build/dist/plugins/ && cat build/dist/plugins.cfg | grep "Plugin=" | sed -e "s/Plugin=//" | xargs -I '{}' cp -v '/${{ matrix.sys }}/bin/{}.dll' build/dist/plugins/ - name: Add OGRE shaders run: mkdir build/dist/ShaderCache && mkdir build/dist/shaders && cp -R /${{ matrix.sys }}/share/OGRE/Media/Main build/dist/shaders && cp -R /${{ matrix.sys }}/share/OGRE/Media/RTShaderLib build/dist/shaders - name: Add resources run: cp -R Content/RNR build/dist/content && cp LICENSE build/dist - name: Set output variables id: vars run: | echo "configuration=${{ matrix.configuration }}" | awk '{print tolower($0)}' >> $GITHUB_OUTPUT echo "hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - name: Upload uses: actions/upload-artifact@v3 with: name: rnr-win_x64-${{ steps.vars.outputs.configuration }}-${{ steps.vars.outputs.hash }} path: build/dist