diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 48c76df0bd..5689e362cb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,6 +6,7 @@ jobs: build: runs-on: ${{ matrix.os }} strategy: + vgui_build: [OFF, ON] matrix: include: - os: ubuntu-latest @@ -20,6 +21,8 @@ jobs: env: CC: ${{ matrix.cc }} CXX: ${{ matrix.cxx }} + include_features: "false" + fgd_name: "halflife_featureful.fgd" steps: - name: Checkout uses: actions/checkout@v3 @@ -52,16 +55,9 @@ jobs: - name: Build on Linux if: startsWith(matrix.os, 'ubuntu') run: | - schroot --chroot steamrt_scout_i386 -- cmake -DCMAKE_BUILD_TYPE=Release -DPOLLY=ON -B build -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DCMAKE_INSTALL_PREFIX="$PWD/dist" + schroot --chroot steamrt_scout_i386 -- cmake -DCMAKE_BUILD_TYPE=Release -DPOLLY=ON -B build -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DUSE_VGUI=${{ matrix.vgui_build }} -DCMAKE_INSTALL_PREFIX="$PWD/dist" schroot --chroot steamrt_scout_i386 -- cmake --build build --target all schroot --chroot steamrt_scout_i386 -- cmake --build build --target install - - name: Build on Linux with vgui - if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.cc, 'gcc') - run: | - schroot --chroot steamrt_scout_i386 -- cmake -DCMAKE_BUILD_TYPE=Release -DPOLLY=ON -B build-vgui -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DUSE_VGUI=ON -DCMAKE_INSTALL_PREFIX="$PWD/dist-vgui" - cp vgui_support/vgui-dev/lib/vgui.so build-vgui/cl_dll - schroot --chroot steamrt_scout_i386 -- cmake --build build-vgui --target all - schroot --chroot steamrt_scout_i386 -- cmake --build build-vgui --target install - name: Add msbuild to PATH if: startsWith(matrix.os, 'windows') @@ -69,12 +65,7 @@ jobs: - name: Build on Windows if: startsWith(matrix.os, 'windows') run: | - cmake -G "Visual Studio 16 2019" -A Win32 -B build -DCMAKE_INSTALL_PREFIX="dist" - msbuild -verbosity:normal /property:Configuration=Release build/INSTALL.vcxproj - - name: Build on Windows with vgui - if: startsWith(matrix.os, 'windows') - run: | - cmake -G "Visual Studio 16 2019" -A Win32 -B build -DUSE_VGUI=ON -DCMAKE_INSTALL_PREFIX="dist-vgui" + cmake -G "Visual Studio 16 2019" -A Win32 -B build -DUSE_VGUI=${{ matrix.vgui_build }} -DCMAKE_INSTALL_PREFIX="dist" msbuild -verbosity:normal /property:Configuration=Release build/INSTALL.vcxproj - name: Extract branch name @@ -85,42 +76,32 @@ jobs: shell: bash run: echo "gamedir=$(grep build/CMakeCache.txt -Ee 'GAMEDIR:STRING=[a-z]+' | cut -d '=' -f 2)" >> $GITHUB_OUTPUT id: extract_gamedir + - name: Copy fgd to dist dir if: ${{ (startsWith(matrix.os, 'ubuntu') && startsWith(matrix.cc, 'gcc')) || startsWith(matrix.os, 'windows') }} - run: | - cp fgd/halflife.fgd dist/${{ steps.extract_gamedir.outputs.gamedir }}/halflife_featureful.fgd - cp fgd/halflife.fgd dist-vgui/${{ steps.extract_gamedir.outputs.gamedir }}/halflife_featureful.fgd - cp -r features/ dist/${{ steps.extract_gamedir.outputs.gamedir }}/ - cp -r features/ dist-vgui/${{ steps.extract_gamedir.outputs.gamedir }}/ + run: cp fgd/halflife.fgd dist/${{ steps.extract_gamedir.outputs.gamedir }}/${{ env.fgd_name }} + + - name: Copy features to dist dir + if: ${{ env.include_features == 'true' }} + run: cp -r features/ dist/${{ steps.extract_gamedir.outputs.gamedir }}/ + - name: Delete .lib files from dist if: startsWith(matrix.os, 'windows') run: | Remove-Item -Force -Path dist/${{ steps.extract_gamedir.outputs.gamedir }}/cl_dlls/client.lib Remove-Item -Force -Path dist/${{ steps.extract_gamedir.outputs.gamedir }}/dlls/hl.lib - Remove-Item -Force -Path dist-vgui/${{ steps.extract_gamedir.outputs.gamedir }}/cl_dlls/client.lib - Remove-Item -Force -Path dist-vgui/${{ steps.extract_gamedir.outputs.gamedir }}/dlls/hl.lib + - name: Upload linux artifact if: startsWith(matrix.os, 'ubuntu') && matrix.cc == 'gcc' uses: actions/upload-artifact@v3 with: name: hlsdk-${{ steps.extract_branch.outputs.branch }}-linux path: dist/${{ steps.extract_gamedir.outputs.gamedir }} - - name: Upload linux artifact with vgui - if: startsWith(matrix.os, 'ubuntu') && matrix.cc == 'gcc' - uses: actions/upload-artifact@v3 - with: - name: hlsdk-${{ steps.extract_branch.outputs.branch }}-linux-vgui - path: dist-vgui/${{ steps.extract_gamedir.outputs.gamedir }} + - name: Upload windows artifact if: startsWith(matrix.os, 'windows') uses: actions/upload-artifact@v3 with: name: hlsdk-${{ steps.extract_branch.outputs.branch }}-windows path: dist/${{ steps.extract_gamedir.outputs.gamedir }} - - name: Upload windows artifact with vgui - if: startsWith(matrix.os, 'windows') - uses: actions/upload-artifact@v3 - with: - name: hlsdk-${{ steps.extract_branch.outputs.branch }}-windows-vgui - path: dist-vgui/${{ steps.extract_gamedir.outputs.gamedir }}