add vcpkg git commit id (eugh) #84
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: [ push ] | |
jobs: | |
linux: | |
strategy: | |
matrix: | |
configuration: [ Release, Debug ] | |
name: Linux | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install required packages | |
uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
version: 1.0.2 | |
packages: >- | |
build-essential | |
cmake | |
ninja-build | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: 6.* | |
cache: true | |
- name: Install development packages via vcpkg | |
uses: lukka/run-vcpkg@v11 | |
with: | |
runVcpkgInstall: true | |
vcpkgGitCommitId: 9d47b24 # hardcoded because the idiot who made this action didn't make it possible to use the latest commit by default | |
vcpkgDirectory: ${{ github.workspace }}/vcpkg | |
- name: Generate Ninja build files | |
run: cmake -G Ninja -B build -DCI=ON -DCMAKE_BUILD_TYPE=${{ matrix.configuration == 'Release' && 'MinSizeRel' || matrix.configuration }} -DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake . | |
- name: Run Ninja build | |
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 && find build -perm /a+x -exec mv {} build/dist \; | |
- name: Add RNR resources | |
run: cp -R Content/RNR build/dist/content && cp LICENSE build/dist | |
- name: Add OGRE plugins | |
run: cp -R build/plugins build/dist && cp Content/linux_plugins.cfg build/dist/plugins.cfg | |
- name: Add OGRE shaders | |
run: cp -R build/shaders build/dist | |
- name: Set output variables | |
id: vars | |
run: | | |
echo "configuration=${{ matrix.configuration }}" | awk '{print tolower($0)}' >> $GITHUB_OUTPUT | |
echo "hash=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: rnr-${{ steps.vars.outputs.hash }}-linux_x64-${{ steps.vars.outputs.configuration }} | |
path: build/dist | |
windows: | |
strategy: | |
matrix: | |
include: | |
- { sys: clang64, env: clang-x86_64 } | |
configuration: [ Release, Debug ] | |
name: Windows | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: msys2 {0} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Set up MSYS2 and install required packages | |
uses: msys2/setup-msys2@v2 | |
with: | |
msystem: ${{ matrix.sys }} | |
install: >- | |
mingw-w64-${{ matrix.env }}-${{ matrix.sys == 'clang64' && 'clang' || 'gcc' }} | |
mingw-w64-${{ matrix.env }}-cmake | |
mingw-w64-${{ matrix.env }}-ninja | |
mingw-w64-${{ matrix.env }}-ogre3d | |
mingw-w64-${{ matrix.env }}-bullet | |
mingw-w64-${{ matrix.env }}-qt6 | |
mingw-w64-${{ matrix.env }}-boost | |
mingw-w64-${{ matrix.env }}-pugixml | |
- name: Generate Ninja build files | |
run: cmake -G Ninja -B build -DCI=ON -DCMAKE_BUILD_TYPE=${{ matrix.configuration == 'Release' && 'MinSizeRel' || matrix.configuration }} . | |
- name: Run Ninja build | |
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 | |
- name: Add RNR resources | |
run: cp -R Content/RNR build/dist/content && cp LICENSE build/dist | |
- name: Add Qt plugins and dependencies | |
run: windeployqt6 build/dist/*.exe | |
- 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/shaders && cp -R /${{ matrix.sys }}/share/OGRE/Media/Main/* build/dist/shaders && cp -R /${{ matrix.sys }}/share/OGRE/Media/RTShaderLib/* build/dist/shaders && mv build/dist/shaders/GLSL/* build/dist/shaders && rm -rf build/dist/shaders/GLSL | |
- name: Add additional runtime dependencies | |
run: ldd build/dist/*.exe | grep "=> /" | awk '{print $3}' | grep "${{ matrix.sys }}" | xargs -I '{}' cp -v '{}' build/dist | |
- name: Set output variables | |
id: vars | |
run: | | |
echo "configuration=${{ matrix.configuration }}" | awk '{print tolower($0)}' >> $GITHUB_OUTPUT | |
echo "hash=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: rnr-${{ steps.vars.outputs.hash }}-win_x64-${{ steps.vars.outputs.configuration }} | |
path: build/dist |