From 1408f1f04035a214d626b7ccafc08c43e7636398 Mon Sep 17 00:00:00 2001 From: Fernando Tonon de Rossi Date: Sat, 4 Feb 2023 16:25:31 -0400 Subject: [PATCH] Update and rename cmake.yml to deploy.yml --- .github/workflows/cmake.yml | 615 ----------------------------------- .github/workflows/deploy.yml | 600 ++++++++++++++++++++++++++++++++++ 2 files changed, 600 insertions(+), 615 deletions(-) delete mode 100755 .github/workflows/cmake.yml create mode 100755 .github/workflows/deploy.yml diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml deleted file mode 100755 index 1426a6366..000000000 --- a/.github/workflows/cmake.yml +++ /dev/null @@ -1,615 +0,0 @@ -name: CMake - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: Release - -jobs: -# send-slack-notification: -# runs-on: ubuntu-latest -# steps: -# - name: send slack message -# uses: docker://technosophos/slack-notify -# env: -# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} -# SLACK_MESSAGE: "Building QtMeshEditor in GitHub Actions - works! :D" - -#################################################################### -# Windows Deploy -#################################################################### - -# build-n-cache-assimp-windows: -# runs-on: windows-latest -# steps: -# - name: Set up MinGW -# uses: egor-tensin/setup-mingw@v2 -# with: -# platform: x64 - -# - name: Cache Assimp -# id: cache-assimp-windows -# uses: actions/cache@v3 -# env: -# cache-name: cache-assimp-windows -# with: -# # It is caching the folder that also contains source and building files, maybe in the future it would be nice cache only the includes and dll -# path: C:/Program Files (x86)/Assimp -# key: ${{ runner.os }}-build-${{ env.cache-name }} - -# - if: steps.cache-assimp-windows.outputs.cache-hit != 'true' -# name: Check out Assimp repo -# uses: actions/checkout@master -# with: -# repository: assimp/assimp -# path: ${{github.workspace}}/assimp - -# - if: steps.cache-assimp-windows.outputs.cache-hit != 'true' -# name: Build Assimp repo -# env: -# CMAKE_GENERATOR: "MinGW Makefiles" -# run: | -# cd ${{github.workspace}}/assimp -# cmake -S . -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_GENERATOR="MinGW Makefiles" -DASSIMP_WARNINGS_AS_ERRORS=OFF -# mingw32-make install -j8 - -# build-n-cache-ogre-windows: -# #needs: build-n-cache-assimp-windows -# runs-on: windows-latest -# steps: -# - name: Cache Assimp -# id: cache-assimp-windows -# uses: actions/cache@v3 -# env: -# cache-name: cache-assimp-windows -# with: -# # It is caching the folder that also contains source and building files, maybe in the future it would be nice cache only the includes and dll -# path: ${{github.workspace}}/assimp -# key: ${{ runner.os }}-build-${{ env.cache-name }} - -# - name: Cache Ogre -# id: cache-ogre-windows -# uses: actions/cache@v3 -# env: -# cache-name: cache-ogre-windows -# with: -# path: ${{github.workspace}}/ogre-build/SDK -# # Need to delete manually if needed to rebuild. Until I find a better solution for detecting changes in the ogre repo. -# key: ${{ runner.os }}-build-${{ env.cache-name }} - -# - if: steps.cache-ogre-windows.outputs.cache-hit != 'true' -# name: Check out ogre repo -# uses: actions/checkout@master -# with: -# repository: OGRECave/ogre -# path: ${{github.workspace}}/ogre - -# - if: steps.cache-ogre-windows.outputs.cache-hit != 'true' -# name: Set up MinGW -# uses: egor-tensin/setup-mingw@v2 -# with: -# platform: x64 - -# - if: steps.cache-ogre-windows.outputs.cache-hit != 'true' -# name: Build Ogre3D -# shell: cmd -# env: -# CMAKE_GENERATOR: "MinGW Makefiles" -# ASSIMP_DIR: "C:/Program Files (x86)/Assimp/lib/cmake/assimp-5.2/" -# run: | -# cd ${{github.workspace}}/ogre -# cmake -B ${{github.workspace}}/ogre-build -S . -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_CXX_STANDARD=17 -DOGRE_BUILD_PLUGIN_ASSIMP=ON -DOGRE_BUILD_PLUGIN_DOT_SCENE=ON -DOGRE_BUILD_RENDERSYSTEM_GL=ON -DOGRE_BUILD_RENDERSYSTEM_GL3PLUS=ON -DOGRE_BUILD_RENDERSYSTEM_GLES2=OFF -DOGRE_BUILD_RENDERSYSTEM_D3D9=OFF -DOGRE_BUILD_RENDERSYSTEM_D3D11=OFF -DOGRE_BUILD_TESTS=OFF -DOGRE_BUILD_TOOLS=OFF -DOGRE_BUILD_SAMPLES=OFF -DOGRE_BUILD_COMPONENT_CSHARP=OFF -DOGRE_BUILD_COMPONENT_JAVA=OFF -DOGRE_BUILD_COMPONENT_PYTHON=OFF -DOGRE_INSTALL_TOOLS=OFF -DOGRE_INSTALL_DOCS=OFF -DOGRE_INSTALL_SAMPLES=OFF -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -# cd ${{github.workspace}}/ogre-build -# mingw32-make install -j8 - -# build-windows: -# # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. -# # You can convert this to a matrix build if you need cross-platform coverage. -# # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix -# # needs: [build-n-cache-assimp-windows, build-n-cache-ogre-windows] -# # needs: build-n-cache-ogre-windows -# runs-on: windows-latest -# steps: -# - uses: actions/checkout@v3 -# with: -# submodules: true - -# - name: Set up MinGW -# uses: egor-tensin/setup-mingw@v2 -# with: -# platform: x64 - -# - name: Install Qt -# uses: jurplel/install-qt-action@v3 -# with: -# aqtversion: '==2.1.*' -# version: '6.5.0' -# host: 'windows' -# target: 'desktop' -# arch: 'win64_mingw' -# #arch: 'win64_msvc2019_64' -# tools: 'tools_cmake' - -# - name: Cache Assimp -# id: cache-assimp-windows -# uses: actions/cache@v3 -# env: -# cache-name: cache-assimp-windows -# with: -# # It is caching the folder that also contains source and building files, maybe in the future it would be nice cache only the includes and dll -# path: C:/Program Files (x86)/Assimp -# key: ${{ runner.os }}-build-${{ env.cache-name }} - -# - name: Cache Ogre -# id: cache-ogre-windows -# uses: actions/cache@v3 -# env: -# cache-name: cache-ogre-windows -# with: -# path: ${{github.workspace}}/ogre-build/SDK -# # Need to delete manually if needed to rebuild. Until I find a better solution for detecting changes in the ogre repo. -# key: ${{ runner.os }}-build-${{ env.cache-name }} - -# - run: dir ${{github.workspace}}/ogre-build/SDK/bin/ -# - run: dir C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin - -# - name: Configure CMake -# env: -# OGRE_DIR: ${{github.workspace}}/ogre-build/SDK/CMake/ -# CMAKE_GENERATOR: "MinGW Makefiles" -# run: cmake -S . -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DQT_QMAKE_EXECUTABLE=qmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_EXE_LINKER_FLAGS=-static -DQt6_DIR=D:/a/QtMeshEditor/Qt/6.5.0/gcc_64/lib/cmake/Qt6 -DQT_DIR=D:/a/QtMeshEditor/Qt/6.5.0/gcc_64/lib/cmake/Qt6 -DQt6GuiTools_DIR=D:/a/QtMeshEditor/Qt/6.5.0/gcc_64/lib/cmake/Qt6GuiTools -DOGRE_DIR=${{github.workspace}}/ogre-build/SDK/CMake/ -# shell: cmd - -# - name: Build -# # Build your program with the given configuration -# run: | -# dir -# mingw32-make install -j8 - -# - name: Copy gcc dll to the binary folder -# run: | -# copy C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin/libgcc_s_seh-1.dll ${{github.workspace}}/bin -# copy C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin/libstdc++-6.dll ${{github.workspace}}/bin -# copy C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin/libwinpthread-1.dll ${{github.workspace}}/bin -# copy C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin/zlib1.dll ${{github.workspace}}/bin/zlib1__.dll -# copy C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin/zlib1.dll ${{github.workspace}}/bin/libzlib.dll - -# - uses: actions/upload-artifact@v3 -# with: -# name: windows-binaries -# path: ${{github.workspace}}/bin - -#################################################################### -# Linux Deploy -#################################################################### - -# build-n-cache-assimp-linux: -# runs-on: ubuntu-latest -# steps: -# - name: chmod /usr/local -# run: sudo chmod -R 777 /usr/local - -# - name: Cache Assimp -# id: cache-assimp-linux -# uses: actions/cache@v3 -# env: -# cache-name: cache-assimp-linux -# with: -# # Assimp cache files are stored in `/home/runner/work/QtMeshEditor/assimp` on Linux -# path: | -# /usr/local/lib/cmake/ -# /usr/local/include/assimp -# /usr/local/lib/pkgconfig/assimp.pc -# /usr/local/lib/libassimp* -# #key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('/home/runner/work/QtMeshEditor/QtMeshEditor/assimp') }} -# # Need to delete manually if needed to rebuild. Until I find a better solution for detecting changes in the assimp repo. -# key: ${{ runner.os }}-build-${{ env.cache-name }} - -# - if: steps.cache-assimp-linux.outputs.cache-hit != 'true' -# name: Check out Assimp repo -# uses: actions/checkout@master -# with: -# repository: assimp/assimp -# path: /home/runner/work/QtMeshEditor/QtMeshEditor/assimp - -# - if: steps.cache-assimp-linux.outputs.cache-hit != 'true' -# name: Build Assimp repo -# run: | -# cmake -B /home/runner/work/QtMeshEditor/QtMeshEditor/assimp-build -S /home/runner/work/QtMeshEditor/QtMeshEditor/assimp -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -# cd /home/runner/work/QtMeshEditor/QtMeshEditor/assimp-build/ -# sudo make install -j8 - -# build-n-cache-ogre-linux: -# needs: build-n-cache-assimp-linux -# runs-on: ubuntu-latest -# steps: -# - name: chmod /usr/local -# run: sudo chmod -R 777 /usr/local - -# - name: Cache Assimp -# id: cache-assimp-linux -# uses: actions/cache@v3 -# env: -# cache-name: cache-assimp-linux -# with: -# # Assimp cache files are stored in `/home/runner/work/QtMeshEditor/assimp` on Linux/macOS -# path: | -# /usr/local/lib/cmake/ -# /usr/local/include/assimp -# /usr/local/lib/pkgconfig/assimp.pc -# /usr/local/lib/libassimp* -# #key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('/home/runner/work/QtMeshEditor/QtMeshEditor/assimp') }} -# # Need to delete manually if needed to rebuild. Until I find a better solution for detecting changes in the assimp repo. -# key: ${{ runner.os }}-build-${{ env.cache-name }} - -# - name: Cache Ogre -# id: cache-ogre-linux -# uses: actions/cache@v3 -# env: -# cache-name: cache-ogre-linux -# with: -# path: | -# /usr/local/lib/lib* -# /usr/local/share/OGRE/ -# /usr/local/share/OGRE/ -# /usr/local/include/OGRE/ -# /usr/local/lib/OGRE/ -# /usr/local/lib/pkgconfig/ -# key: ${{ runner.os }}-build-${{ env.cache-name }} - -# - if: steps.cache-ogre-linux.outputs.cache-hit != 'true' -# name: install openGL -# run: | -# sudo apt update -# sudo apt-get install freeglut3-dev libxrandr-dev - -# - if: steps.cache-ogre-linux.outputs.cache-hit != 'true' -# name: Check out ogre repo -# uses: actions/checkout@master -# with: -# repository: OGRECave/ogre -# path: /home/runner/work/QtMeshEditor/QtMeshEditor/ogre - -# - if: steps.cache-ogre-linux.outputs.cache-hit != 'true' -# name: Build Ogre3D repo -# run: | -# sudo cmake -B /home/runner/work/QtMeshEditor/QtMeshEditor/ogre-build \ -# -S /home/runner/work/QtMeshEditor/QtMeshEditor/ogre \ -# -DOGRE_BUILD_PLUGIN_ASSIMP=ON -Dassimp_DIR=/usr/local/lib/cmake/assimp-5.2/ \ -# -DOGRE_BUILD_PLUGIN_DOT_SCENE=ON -DOGRE_BUILD_RENDERSYSTEM_GL=ON \ -# -DOGRE_BUILD_RENDERSYSTEM_GL3PLUS=ON -DOGRE_BUILD_RENDERSYSTEM_GLES2=OFF \ -# -DOGRE_BUILD_TESTS=OFF -DOGRE_BUILD_TOOLS=OFF -DOGRE_BUILD_SAMPLES=OFF \ -# -DOGRE_BUILD_COMPONENT_CSHARP=OFF -DOGRE_BUILD_COMPONENT_JAVA=OFF \ -# -DOGRE_BUILD_COMPONENT_BULLET=OFF \ -# -DOGRE_BUILD_COMPONENT_PYTHON=OFF -DOGRE_INSTALL_TOOLS=OFF \ -# -DOGRE_INSTALL_DOCS=OFF -DOGRE_INSTALL_SAMPLES=OFF \ -# -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -# cd /home/runner/work/QtMeshEditor/QtMeshEditor/ogre-build/ -# sudo make install -j8 - - build-linux: - # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. - # You can convert this to a matrix build if you need cross-platform coverage. - # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix -# needs: [build-n-cache-assimp-linux, build-n-cache-ogre-linux] - runs-on: ubuntu-latest - env: - LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.11.1/x64/lib:/home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/:/usr/local/lib/:/usr/local/lib/OGRE/:/usr/local/lib/pkgconfig/ - steps: - - uses: actions/checkout@v3 - with: - submodules: true - - - name: Install Qt - uses: jurplel/install-qt-action@v3 - with: - aqtversion: '==2.1.*' - version: '6.5.0' - host: 'linux' - target: 'desktop' - arch: 'gcc_64' - - - run: sudo chmod -R 777 /usr/local - - - name: Cache Assimp - id: cache-assimp-linux - uses: actions/cache@v3 - env: - cache-name: cache-assimp-linux - with: - # Assimp cache files are stored in `/home/runner/work/QtMeshEditor/assimp` on Linux/macOS - path: | - /usr/local/lib/cmake/ - /usr/local/include/assimp - /usr/local/lib/pkgconfig/assimp.pc - /usr/local/lib/libassimp* - key: ${{ runner.os }}-build-${{ env.cache-name }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - - - name: Cache Ogre - id: cache-ogre-linux - uses: actions/cache@v3 - env: - cache-name: cache-ogre-linux - with: - path: | - /usr/local/lib/lib* - /usr/local/share/OGRE/ - /usr/local/share/OGRE/ - /usr/local/include/OGRE/ - /usr/local/lib/OGRE/ - /usr/local/lib/pkgconfig/ - key: ${{ runner.os }}-build-${{ env.cache-name }} - - - name: Configure CMake - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - #run: sudo cmake -B ${{github.workspace}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DQt6_DIR=/home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/cmake/Qt6 -DQT_DIR=/home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/cmake/Qt6 -DQt6GuiTools_DIR=/home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/cmake/Qt6GuiTools - run: sudo cmake -S . -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DQt6_DIR=/home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/cmake/Qt6 -DQT_DIR=/home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/cmake/Qt6 -DQt6GuiTools_DIR=/home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/cmake/Qt6GuiTools - - - name: Build - # Build your program with the given configuration - run: | - sudo make install -j8 -# sudo chmod +X ./bin/QtMeshEditor - - - name: Add missing libraries - run: | - sudo cp -R /home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/libicui18n.* ./bin - sudo cp -R /home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/libicuuc.* ./bin - sudo cp -R /home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/libicudata.* ./bin - - - name: Manual Pack - run: | - echo "Creating folders 'n files" - mkdir -p ./pack-deb/usr/local/bin - mkdir -p ./pack-deb/usr/share/qtmesheditor/ - mkdir ./pack-deb/usr/share/qtmesheditor/cfg/ - mkdir ./pack-deb/usr/share/qtmesheditor/media/ - mkdir ./pack-deb/usr/share/qtmesheditor/platforms/ - mkdir -p ./pack-deb/lib/x86_64-linux-gnu/ - mkdir ./pack-deb/DEBIAN/ - cp ./bin/DEBIAN-control ./pack-deb/DEBIAN/control - cp ./bin/QtMeshEditor ./pack-deb/usr/share/qtmesheditor/qtmesheditor - touch ./pack-deb/usr/local/bin/qtmesheditor - echo "/usr/share/qtmesheditor/qtmesheditor" >> ./pack-deb/usr/local/bin/qtmesheditor - sudo chmod 755 ./pack-deb/usr/local/bin/qtmesheditor - cp -R ./bin/cfg/ ./pack-deb/usr/share/qtmesheditor/ - sudo chmod -R 755 ./pack-deb/usr/share/qtmesheditor/cfg - cp -R ./bin/media/ ./pack-deb/usr/share/qtmesheditor/ - cp -R ./bin/platforms/ ./pack-deb/usr/share/qtmesheditor/ - cp -R ./bin/*.so* ./pack-deb/lib/x86_64-linux-gnu/ - dpkg-deb --build --root-owner-group pack-deb - mv pack-deb.deb qtmesheditor_amd64.deb - -# - name: Pack -# env: -# LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.11.1/x64/lib:/home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/:/usr/local/lib/:/usr/local/lib/OGRE/:/usr/local/lib/pkgconfig/ -# run: | -# sudo apt install libxcb-cursor0 -# sudo cp -R ${{github.workspace}}/bin/Plugin_PCZSceneManager.* /usr/local/lib/ -# sudo cp -R /home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/ /usr/local/lib/ -# sudo cp -R /home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/libicui18n.* /usr/local/lib/ -# sudo cp -R /home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/libicuuc.* /usr/local/lib/ -# sudo cp -R /home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/libicudata.* /usr/local/lib/ -# sudo cp -R /home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/libicui18n.* ./bin -# sudo cp -R /home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/libicuuc.* ./bin -# sudo cp -R /home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/libicudata.* ./bin -# sudo ls /usr/local/lib/ -# sudo cpack -G DEB -C ./bin -P QtMeshEditor.deb - - - run: tar -zcvf QtMeshEditor-bin-Linux.tar.gz ./bin - - - uses: actions/upload-artifact@v3 - with: - name: linux-binaries - path: | - ${{github.workspace}}/QtMeshEditor-Linux.tar.gz - ${{github.workspace}}/QtMeshEditor-bin-Linux.tar.gz - ${{github.workspace}}/*.deb - #path: ${{github.workspace}}/bin - -# - name: Test -# working-directory: ${{github.workspace}} -# # Execute tests defined by the CMake configuration. -# # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail -# run: ctest -C ${{env.BUILD_TYPE}} - -#################################################################### -# MacOS Deploy -#################################################################### - -# build-n-cache-assimp-macos: -# runs-on: macos-latest -# steps: -# - name: Cache Assimp -# id: cache-assimp-macos -# uses: actions/cache@v3 -# env: -# cache-name: cache-assimp-macos -# with: -# path: | -# /usr/local/lib/cmake/ -# /usr/local/include/assimp -# /usr/local/lib/pkgconfig/assimp.pc -# /usr/local/lib/libassimp* -# #key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('/home/runner/work/QtMeshEditor/QtMeshEditor/assimp') }} -# # Need to delete manually if needed to rebuild. Until I find a better solution for detecting changes in the assimp repo. -# key: ${{ runner.os }}-build-${{ env.cache-name }} -# restore-keys: | -# ${{ runner.os }}-build-${{ env.cache-name }}- - -# - if: steps.cache-assimp-macos.outputs.cache-hit != 'true' -# name: Check out Assimp repo -# uses: actions/checkout@master -# with: -# repository: assimp/assimp -# path: /Users/runner/work/QtMeshEditor/QtMeshEditor/assimp - -# - if: steps.cache-assimp-macos.outputs.cache-hit != 'true' -# name: Build Assimp repo -# run: | -# cmake -B /Users/runner/work/QtMeshEditor/QtMeshEditor/assimp-build -S /Users/runner/work/QtMeshEditor/QtMeshEditor/assimp -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -# cd /Users/runner/work/QtMeshEditor/QtMeshEditor/assimp-build/ -# sudo make install -j8 - -# build-n-cache-ogre-macos: -# # needs: build-n-cache-assimp-macos -# runs-on: macos-latest -# steps: -# - name: Cache Assimp -# id: cache-assimp-macos -# uses: actions/cache@v3 -# env: -# cache-name: cache-assimp-macos -# with: -# path: | -# /usr/local/lib/cmake/ -# /usr/local/include/assimp -# /usr/local/lib/pkgconfig/assimp.pc -# /usr/local/lib/libassimp* -# key: ${{ runner.os }}-build-${{ env.cache-name }} -# restore-keys: | -# ${{ runner.os }}-build-${{ env.cache-name }}- - -# - name: Cache Ogre -# id: cache-ogre-macos -# uses: actions/cache@v3 -# env: -# cache-name: cache-ogre-macos -# with: -# path: ${{github.workspace}}/ogre/SDK -# key: ${{ runner.os }}-build-${{ env.cache-name }} - -# - run: ls /usr/local/lib/ -# - run: ls /usr/local/include -# - run: ls /Users -# # - run: ls ${{github.workspace}} -# # - run: ls /Users/runner/work/QtMeshEditor/QtMeshEditor/ogre/sdk/Media/ -# # - run: ls /Users/runner/work/QtMeshEditor/QtMeshEditor/ogre/sdk/CMake/ -# # - run: ls /Users/runner/work/QtMeshEditor/QtMeshEditor/ogre/sdk/lib/ -# # - run: ls /Users/runner/work/QtMeshEditor/QtMeshEditor/ogre/sdk/lib/pkgconfig -# # - run: echo ${{github.workspace}} - -# - if: steps.cache-ogre-macos.outputs.cache-hit != 'true' -# name: Check out ogre repo -# uses: actions/checkout@master -# with: -# repository: OGRECave/ogre -# path: ${{github.workspace}}/ogre - -# - if: steps.cache-ogre-macos.outputs.cache-hit != 'true' -# name: Build Ogre3D repo -# run: | -# cd ${{github.workspace}}/ogre/ -# sudo cmake -S . -DOGRE_BUILD_PLUGIN_ASSIMP=ON -Dassimp_DIR=/usr/local/lib/cmake/assimp-5.2/ -DOGRE_BUILD_PLUGIN_DOT_SCENE=ON -DOGRE_BUILD_RENDERSYSTEM_GL=ON -DOGRE_BUILD_RENDERSYSTEM_GL3PLUS=ON -DOGRE_BUILD_RENDERSYSTEM_GLES2=OFF -DOGRE_BUILD_TESTS=OFF -DOGRE_BUILD_TOOLS=OFF -DOGRE_BUILD_SAMPLES=OFF -DOGRE_BUILD_COMPONENT_CSHARP=OFF -DOGRE_BUILD_COMPONENT_JAVA=OFF -DOGRE_BUILD_COMPONENT_PYTHON=OFF -DOGRE_INSTALL_TOOLS=OFF -DOGRE_INSTALL_DOCS=OFF -DOGRE_INSTALL_SAMPLES=OFF -DOGRE_BUILD_LIBS_AS_FRAMEWORKS=OFF -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -# sudo make install -j8 - -# build-macos: -# # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. -# # You can convert this to a matrix build if you need cross-platform coverage. -# # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix -# # needs: [build-n-cache-assimp-macos, build-n-cache-ogre-macos] -# # needs: [build-n-cache-ogre-macos] -# runs-on: macos-latest -# steps: -# - uses: actions/checkout@v3 -# with: -# submodules: true - -# - run: | -# ls ${{github.workspace}}/src/dependencies/ogre-procedural -# cd ${{github.workspace}}/src/dependencies/ogre-procedural -# git checkout 978e34ffc4079b804bcde3a021686f5dec36e839 -# git branch -# git status - -# - name: Install Qt -# uses: jurplel/install-qt-action@v3 -# with: -# aqtversion: '==2.1.*' -# version: '6.5.0' -# host: 'mac' -# target: 'desktop' -# arch: 'clang_64' -# tools: 'tools_cmake' - -# - name: Cache Assimp -# id: cache-assimp-macos -# uses: actions/cache@v3 -# env: -# cache-name: cache-assimp-macos -# with: -# path: | -# /usr/local/lib/cmake/ -# /usr/local/include/assimp -# /usr/local/lib/pkgconfig/assimp.pc -# /usr/local/lib/libassimp* -# key: ${{ runner.os }}-build-${{ env.cache-name }} - -# - name: Cache Ogre -# id: cache-ogre-macos -# uses: actions/cache@v3 -# env: -# cache-name: cache-ogre-macos -# with: -# path: ${{github.workspace}}/ogre/SDK -# key: ${{ runner.os }}-build-${{ env.cache-name }} - -# - name: Configure CMake -# env: -# OGRE_DIR: ${{github.workspace}}/ogre/SDK/CMake/ -# run: | -# sudo cmake -S . \ -# -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ -# -DQt6_DIR=/Users/runner/work/QtMeshEditor/Qt/6.5.0/clang_64/lib/cmake/Qt6 \ -# -DQT_DIR=/Users/runner/work/QtMeshEditor/Qt/6.5.0/clang_64/lib/cmake/Qt6 \ -# -DQt6GuiTools_DIR=/Users/runner/work/QtMeshEditor/Qt/6.5.0/clang_64/lib/cmake/Qt6GuiTools \ -# -DOGRE_DIR=${{github.workspace}}/ogre/SDK/CMake/ - -# - name: Build -# # Build your program with the given configuration -# run: | -# sudo make install -j8 - -# - name: copy Qt libs to app folder -# run: | -# sudo cp -R /Users/runner/work/QtMeshEditor/Qt/6.5.0/macos/lib/QtWidgets.framework ${{github.workspace}}/bin/QtMeshEditor.app/Contents/MacOS/QtWidgets.framework -# sudo cp -R /Users/runner/work/QtMeshEditor/Qt/6.5.0/macos/lib/QtCore.framework ${{github.workspace}}/bin/QtMeshEditor.app/Contents/MacOS/QtCore.framework -# sudo cp -R /Users/runner/work/QtMeshEditor/Qt/6.5.0/macos/lib/QtGui.framework ${{github.workspace}}/bin/QtMeshEditor.app/Contents/MacOS/QtGui.framework -# sudo cp -R /Users/runner/work/QtMeshEditor/Qt/6.5.0/macos/lib/QtDBus.framework ${{github.workspace}}/bin/QtMeshEditor.app/Contents/MacOS/QtDBus.framework -# sudo cp -R /Users/runner/work/QtMeshEditor/Qt/6.5.0/macos/plugins/platforms ${{github.workspace}}/bin/QtMeshEditor.app/Contents/MacOS/platforms -# sudo cp -R /usr/local/lib/libassimp* ${{github.workspace}}/bin/QtMeshEditor.app/Contents/MacOS/ -# - run: sudo cp -R ${{github.workspace}}/bin/media ${{github.workspace}}/bin/QtMeshEditor.app/Contents/MacOS/media -# - run: sudo cp -R ${{github.workspace}}/bin/cfg ${{github.workspace}}/bin/QtMeshEditor.app/Contents/MacOS/cfg -# - run: sudo cp -R ${{github.workspace}}/resources/icon.icns ${{github.workspace}}/bin/QtMeshEditor.app/Contents/MacOS/media -# - run: sudo mkdir ${{github.workspace}}/bin/QtMeshEditor.app/Contents/Resources -# - run: sudo cp -R ${{github.workspace}}/resources/icon.icns ${{github.workspace}}/bin/QtMeshEditor.app/Contents/Resources -# - run: sudo cp -R ${{github.workspace}}/bin/Info.plist ${{github.workspace}}/bin/QtMeshEditor.app/Contents/ -# - run: sudo install_name_tool -add_rpath @loader_path/ ${{github.workspace}}/bin/QtMeshEditor.app/Contents/MacOS/QtMeshEditor - -# - name: Pack -# run: | -# brew install create-dmg -# sudo create-dmg \ -# --volname "QtMeshEditor Installer" \ -# --volicon "${{github.workspace}}/resources/icon.icns" \ -# --window-pos 200 120 \ -# --window-size 800 400 \ -# --icon-size 100 \ -# --icon "QtMeshEditor.app" 200 190 \ -# --app-drop-link 600 185 \ -# QtMeshEditor-MacOS.dmg \ -# ${{github.workspace}}/bin/QtMeshEditor.app -# # using create-dmg instead sudo cpack -G DragNDrop - -# - uses: actions/upload-artifact@v3.1.2 -# with: -# name: QtMeshEditor-MacOS -# path: ${{github.workspace}}/QtMeshEditor-MacOS.dmg diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100755 index 000000000..479c4af01 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,600 @@ +name: Deploy + +on: +# push: +# branches: [ "master" ] + pull_request: + branches: [ "master" ] + release: + types: [published] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: +# send-slack-notification: +# runs-on: ubuntu-latest +# steps: +# - name: send slack message +# uses: docker://technosophos/slack-notify +# env: +# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} +# SLACK_MESSAGE: "Building QtMeshEditor in GitHub Actions - works! :D" + +#################################################################### +# Windows Deploy +#################################################################### + + build-n-cache-assimp-windows: + runs-on: windows-latest + steps: + - name: Set up MinGW + uses: egor-tensin/setup-mingw@v2 + with: + platform: x64 + + - name: Cache Assimp + id: cache-assimp-windows + uses: actions/cache@v3 + env: + cache-name: cache-assimp-windows + with: + # It is caching the folder that also contains source and building files, maybe in the future it would be nice cache only the includes and dll + path: C:/Program Files (x86)/Assimp + key: ${{ runner.os }}-build-${{ env.cache-name }} + + - if: steps.cache-assimp-windows.outputs.cache-hit != 'true' + name: Check out Assimp repo + uses: actions/checkout@master + with: + repository: assimp/assimp + path: ${{github.workspace}}/assimp + + - if: steps.cache-assimp-windows.outputs.cache-hit != 'true' + name: Build Assimp repo + env: + CMAKE_GENERATOR: "MinGW Makefiles" + run: | + cd ${{github.workspace}}/assimp + cmake -S . -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_GENERATOR="MinGW Makefiles" -DASSIMP_WARNINGS_AS_ERRORS=OFF + mingw32-make install -j8 + + build-n-cache-ogre-windows: + needs: build-n-cache-assimp-windows + runs-on: windows-latest + steps: + - name: Cache Assimp + id: cache-assimp-windows + uses: actions/cache@v3 + env: + cache-name: cache-assimp-windows + with: + # It is caching the folder that also contains source and building files, maybe in the future it would be nice cache only the includes and dll + path: ${{github.workspace}}/assimp + key: ${{ runner.os }}-build-${{ env.cache-name }} + + - name: Cache Ogre + id: cache-ogre-windows + uses: actions/cache@v3 + env: + cache-name: cache-ogre-windows + with: + path: ${{github.workspace}}/ogre-build/SDK + # Need to delete manually if needed to rebuild. Until I find a better solution for detecting changes in the ogre repo. + key: ${{ runner.os }}-build-${{ env.cache-name }} + + - if: steps.cache-ogre-windows.outputs.cache-hit != 'true' + name: Check out ogre repo + uses: actions/checkout@master + with: + repository: OGRECave/ogre + path: ${{github.workspace}}/ogre + + - if: steps.cache-ogre-windows.outputs.cache-hit != 'true' + name: Set up MinGW + uses: egor-tensin/setup-mingw@v2 + with: + platform: x64 + + - if: steps.cache-ogre-windows.outputs.cache-hit != 'true' + name: Build Ogre3D + shell: cmd + env: + CMAKE_GENERATOR: "MinGW Makefiles" + ASSIMP_DIR: "C:/Program Files (x86)/Assimp/lib/cmake/assimp-5.2/" + run: | + cd ${{github.workspace}}/ogre + cmake -B ${{github.workspace}}/ogre-build -S . -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_CXX_STANDARD=17 -DOGRE_BUILD_PLUGIN_ASSIMP=ON -DOGRE_BUILD_PLUGIN_DOT_SCENE=ON -DOGRE_BUILD_RENDERSYSTEM_GL=ON -DOGRE_BUILD_RENDERSYSTEM_GL3PLUS=ON -DOGRE_BUILD_RENDERSYSTEM_GLES2=OFF -DOGRE_BUILD_RENDERSYSTEM_D3D9=OFF -DOGRE_BUILD_RENDERSYSTEM_D3D11=OFF -DOGRE_BUILD_TESTS=OFF -DOGRE_BUILD_TOOLS=OFF -DOGRE_BUILD_SAMPLES=OFF -DOGRE_BUILD_COMPONENT_CSHARP=OFF -DOGRE_BUILD_COMPONENT_JAVA=OFF -DOGRE_BUILD_COMPONENT_PYTHON=OFF -DOGRE_INSTALL_TOOLS=OFF -DOGRE_INSTALL_DOCS=OFF -DOGRE_INSTALL_SAMPLES=OFF -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + cd ${{github.workspace}}/ogre-build + mingw32-make install -j8 + + build-windows: + # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. + # You can convert this to a matrix build if you need cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + needs: [build-n-cache-assimp-windows, build-n-cache-ogre-windows] + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: true + + - name: Set up MinGW + uses: egor-tensin/setup-mingw@v2 + with: + platform: x64 + + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + aqtversion: '==2.1.*' + version: '6.5.0' + host: 'windows' + target: 'desktop' + arch: 'win64_mingw' + #arch: 'win64_msvc2019_64' + tools: 'tools_cmake' + + - name: Cache Assimp + id: cache-assimp-windows + uses: actions/cache@v3 + env: + cache-name: cache-assimp-windows + with: + # It is caching the folder that also contains source and building files, maybe in the future it would be nice cache only the includes and dll + path: C:/Program Files (x86)/Assimp + key: ${{ runner.os }}-build-${{ env.cache-name }} + + - name: Cache Ogre + id: cache-ogre-windows + uses: actions/cache@v3 + env: + cache-name: cache-ogre-windows + with: + path: ${{github.workspace}}/ogre-build/SDK + # Need to delete manually if needed to rebuild. Until I find a better solution for detecting changes in the ogre repo. + key: ${{ runner.os }}-build-${{ env.cache-name }} + + - run: dir ${{github.workspace}}/ogre-build/SDK/bin/ + - run: dir C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin + + - name: Configure CMake + env: + OGRE_DIR: ${{github.workspace}}/ogre-build/SDK/CMake/ + CMAKE_GENERATOR: "MinGW Makefiles" + run: cmake -S . -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DQT_QMAKE_EXECUTABLE=qmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_EXE_LINKER_FLAGS=-static -DQt6_DIR=D:/a/QtMeshEditor/Qt/6.5.0/gcc_64/lib/cmake/Qt6 -DQT_DIR=D:/a/QtMeshEditor/Qt/6.5.0/gcc_64/lib/cmake/Qt6 -DQt6GuiTools_DIR=D:/a/QtMeshEditor/Qt/6.5.0/gcc_64/lib/cmake/Qt6GuiTools -DOGRE_DIR=${{github.workspace}}/ogre-build/SDK/CMake/ + shell: cmd + + - name: Build + # Build your program with the given configuration + run: | + dir + mingw32-make install -j8 + + - name: Copy gcc dll to the binary folder + run: | + copy C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin/libgcc_s_seh-1.dll ${{github.workspace}}/bin + copy C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin/libstdc++-6.dll ${{github.workspace}}/bin + copy C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin/libwinpthread-1.dll ${{github.workspace}}/bin + copy C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin/zlib1.dll ${{github.workspace}}/bin/zlib1__.dll + copy C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin/zlib1.dll ${{github.workspace}}/bin/libzlib.dll + + - uses: actions/upload-artifact@v3 + with: + name: windows-binaries + path: ${{github.workspace}}/bin + +#################################################################### +# Linux Deploy +#################################################################### + + build-n-cache-assimp-linux: + runs-on: ubuntu-latest + steps: + - name: chmod /usr/local + run: sudo chmod -R 777 /usr/local + + - name: Cache Assimp + id: cache-assimp-linux + uses: actions/cache@v3 + env: + cache-name: cache-assimp-linux + with: + # Assimp cache files are stored in `/home/runner/work/QtMeshEditor/assimp` on Linux + path: | + /usr/local/lib/cmake/ + /usr/local/include/assimp + /usr/local/lib/pkgconfig/assimp.pc + /usr/local/lib/libassimp* + #key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('/home/runner/work/QtMeshEditor/QtMeshEditor/assimp') }} + # Need to delete manually if needed to rebuild. Until I find a better solution for detecting changes in the assimp repo. + key: ${{ runner.os }}-build-${{ env.cache-name }} + + - if: steps.cache-assimp-linux.outputs.cache-hit != 'true' + name: Check out Assimp repo + uses: actions/checkout@master + with: + repository: assimp/assimp + path: /home/runner/work/QtMeshEditor/QtMeshEditor/assimp + + - if: steps.cache-assimp-linux.outputs.cache-hit != 'true' + name: Build Assimp repo + run: | + cmake -B /home/runner/work/QtMeshEditor/QtMeshEditor/assimp-build -S /home/runner/work/QtMeshEditor/QtMeshEditor/assimp -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + cd /home/runner/work/QtMeshEditor/QtMeshEditor/assimp-build/ + sudo make install -j8 + + build-n-cache-ogre-linux: + needs: build-n-cache-assimp-linux + runs-on: ubuntu-latest + steps: + - name: chmod /usr/local + run: sudo chmod -R 777 /usr/local + + - name: Cache Assimp + id: cache-assimp-linux + uses: actions/cache@v3 + env: + cache-name: cache-assimp-linux + with: + # Assimp cache files are stored in `/home/runner/work/QtMeshEditor/assimp` on Linux/macOS + path: | + /usr/local/lib/cmake/ + /usr/local/include/assimp + /usr/local/lib/pkgconfig/assimp.pc + /usr/local/lib/libassimp* + #key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('/home/runner/work/QtMeshEditor/QtMeshEditor/assimp') }} + # Need to delete manually if needed to rebuild. Until I find a better solution for detecting changes in the assimp repo. + key: ${{ runner.os }}-build-${{ env.cache-name }} + + - name: Cache Ogre + id: cache-ogre-linux + uses: actions/cache@v3 + env: + cache-name: cache-ogre-linux + with: + path: | + /usr/local/lib/lib* + /usr/local/share/OGRE/ + /usr/local/share/OGRE/ + /usr/local/include/OGRE/ + /usr/local/lib/OGRE/ + /usr/local/lib/pkgconfig/ + key: ${{ runner.os }}-build-${{ env.cache-name }} + + - if: steps.cache-ogre-linux.outputs.cache-hit != 'true' + name: install openGL + run: | + sudo apt update + sudo apt-get install freeglut3-dev libxrandr-dev + + - if: steps.cache-ogre-linux.outputs.cache-hit != 'true' + name: Check out ogre repo + uses: actions/checkout@master + with: + repository: OGRECave/ogre + path: /home/runner/work/QtMeshEditor/QtMeshEditor/ogre + + - if: steps.cache-ogre-linux.outputs.cache-hit != 'true' + name: Build Ogre3D repo + run: | + sudo cmake -B /home/runner/work/QtMeshEditor/QtMeshEditor/ogre-build \ + -S /home/runner/work/QtMeshEditor/QtMeshEditor/ogre \ + -DOGRE_BUILD_PLUGIN_ASSIMP=ON -Dassimp_DIR=/usr/local/lib/cmake/assimp-5.2/ \ + -DOGRE_BUILD_PLUGIN_DOT_SCENE=ON -DOGRE_BUILD_RENDERSYSTEM_GL=ON \ + -DOGRE_BUILD_RENDERSYSTEM_GL3PLUS=ON -DOGRE_BUILD_RENDERSYSTEM_GLES2=OFF \ + -DOGRE_BUILD_TESTS=OFF -DOGRE_BUILD_TOOLS=OFF -DOGRE_BUILD_SAMPLES=OFF \ + -DOGRE_BUILD_COMPONENT_CSHARP=OFF -DOGRE_BUILD_COMPONENT_JAVA=OFF \ + -DOGRE_BUILD_COMPONENT_BULLET=OFF \ + -DOGRE_BUILD_COMPONENT_PYTHON=OFF -DOGRE_INSTALL_TOOLS=OFF \ + -DOGRE_INSTALL_DOCS=OFF -DOGRE_INSTALL_SAMPLES=OFF \ + -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + cd /home/runner/work/QtMeshEditor/QtMeshEditor/ogre-build/ + sudo make install -j8 + + build-linux: + # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. + # You can convert this to a matrix build if you need cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + needs: [build-n-cache-assimp-linux, build-n-cache-ogre-linux] + runs-on: ubuntu-latest + env: + LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.11.1/x64/lib:/home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/:/usr/local/lib/:/usr/local/lib/OGRE/:/usr/local/lib/pkgconfig/ + steps: + - uses: actions/checkout@v3 + with: + submodules: true + + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + aqtversion: '==2.1.*' + version: '6.5.0' + host: 'linux' + target: 'desktop' + arch: 'gcc_64' + + - run: sudo chmod -R 777 /usr/local + + - name: Cache Assimp + id: cache-assimp-linux + uses: actions/cache@v3 + env: + cache-name: cache-assimp-linux + with: + # Assimp cache files are stored in `/home/runner/work/QtMeshEditor/assimp` on Linux/macOS + path: | + /usr/local/lib/cmake/ + /usr/local/include/assimp + /usr/local/lib/pkgconfig/assimp.pc + /usr/local/lib/libassimp* + key: ${{ runner.os }}-build-${{ env.cache-name }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + + - name: Cache Ogre + id: cache-ogre-linux + uses: actions/cache@v3 + env: + cache-name: cache-ogre-linux + with: + path: | + /usr/local/lib/lib* + /usr/local/share/OGRE/ + /usr/local/share/OGRE/ + /usr/local/include/OGRE/ + /usr/local/lib/OGRE/ + /usr/local/lib/pkgconfig/ + key: ${{ runner.os }}-build-${{ env.cache-name }} + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + #run: sudo cmake -B ${{github.workspace}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DQt6_DIR=/home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/cmake/Qt6 -DQT_DIR=/home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/cmake/Qt6 -DQt6GuiTools_DIR=/home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/cmake/Qt6GuiTools + run: sudo cmake -S . -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DQt6_DIR=/home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/cmake/Qt6 -DQT_DIR=/home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/cmake/Qt6 -DQt6GuiTools_DIR=/home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/cmake/Qt6GuiTools + + - name: Build + # Build your program with the given configuration + run: | + sudo make install -j8 + + - name: Add missing libraries + run: | + sudo cp -R /home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/libicui18n.* ./bin + sudo cp -R /home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/libicuuc.* ./bin + sudo cp -R /home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/libicudata.* ./bin + + - name: Manual Pack + run: | + echo "Creating folders 'n files" + mkdir -p ./pack-deb/usr/local/bin + mkdir -p ./pack-deb/usr/share/qtmesheditor/ + mkdir ./pack-deb/usr/share/qtmesheditor/cfg/ + mkdir ./pack-deb/usr/share/qtmesheditor/media/ + mkdir ./pack-deb/usr/share/qtmesheditor/platforms/ + mkdir -p ./pack-deb/lib/x86_64-linux-gnu/ + mkdir ./pack-deb/DEBIAN/ + cp ./bin/DEBIAN-control ./pack-deb/DEBIAN/control + cp ./bin/QtMeshEditor ./pack-deb/usr/share/qtmesheditor/qtmesheditor + touch ./pack-deb/usr/local/bin/qtmesheditor + echo "/usr/share/qtmesheditor/qtmesheditor" >> ./pack-deb/usr/local/bin/qtmesheditor + sudo chmod 755 ./pack-deb/usr/local/bin/qtmesheditor + cp -R ./bin/cfg/ ./pack-deb/usr/share/qtmesheditor/ + sudo chmod -R 755 ./pack-deb/usr/share/qtmesheditor/cfg + cp -R ./bin/media/ ./pack-deb/usr/share/qtmesheditor/ + cp -R ./bin/platforms/ ./pack-deb/usr/share/qtmesheditor/ + cp -R ./bin/*.so* ./pack-deb/lib/x86_64-linux-gnu/ + dpkg-deb --build --root-owner-group pack-deb + mv pack-deb.deb qtmesheditor_amd64.deb + +# - name: CPack +# env: +# LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.11.1/x64/lib:/home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/:/usr/local/lib/:/usr/local/lib/OGRE/:/usr/local/lib/pkgconfig/ +# run: | +# sudo apt install libxcb-cursor0 +# sudo cp -R ${{github.workspace}}/bin/Plugin_PCZSceneManager.* /usr/local/lib/ +# sudo cp -R /home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/ /usr/local/lib/ +# sudo cp -R /home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/libicui18n.* /usr/local/lib/ +# sudo cp -R /home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/libicuuc.* /usr/local/lib/ +# sudo cp -R /home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/libicudata.* /usr/local/lib/ +# sudo cp -R /home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/libicui18n.* ./bin +# sudo cp -R /home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/libicuuc.* ./bin +# sudo cp -R /home/runner/work/QtMeshEditor/Qt/6.5.0/gcc_64/lib/libicudata.* ./bin +# sudo ls /usr/local/lib/ +# sudo cpack -G DEB -C ./bin -P QtMeshEditor.deb + +# - run: tar -zcvf QtMeshEditor-bin-Linux.tar.gz ./bin + + - uses: actions/upload-artifact@v3 + with: + name: linux-binaries + path: ${{github.workspace}}/*.deb +# path: | +# ${{github.workspace}}/*.deb +# ${{github.workspace}}/QtMeshEditor-bin-Linux.tar.gz + +# - name: Test +# working-directory: ${{github.workspace}} +# # Execute tests defined by the CMake configuration. +# # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail +# run: ctest -C ${{env.BUILD_TYPE}} + +#################################################################### +# MacOS Deploy +#################################################################### + + build-n-cache-assimp-macos: + runs-on: macos-latest + steps: + - name: Cache Assimp + id: cache-assimp-macos + uses: actions/cache@v3 + env: + cache-name: cache-assimp-macos + with: + path: | + /usr/local/lib/cmake/ + /usr/local/include/assimp + /usr/local/lib/pkgconfig/assimp.pc + /usr/local/lib/libassimp* + #key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('/home/runner/work/QtMeshEditor/QtMeshEditor/assimp') }} + # Need to delete manually if needed to rebuild. Until I find a better solution for detecting changes in the assimp repo. + key: ${{ runner.os }}-build-${{ env.cache-name }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + + - if: steps.cache-assimp-macos.outputs.cache-hit != 'true' + name: Check out Assimp repo + uses: actions/checkout@master + with: + repository: assimp/assimp + path: /Users/runner/work/QtMeshEditor/QtMeshEditor/assimp + + - if: steps.cache-assimp-macos.outputs.cache-hit != 'true' + name: Build Assimp repo + run: | + cmake -B /Users/runner/work/QtMeshEditor/QtMeshEditor/assimp-build -S /Users/runner/work/QtMeshEditor/QtMeshEditor/assimp -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + cd /Users/runner/work/QtMeshEditor/QtMeshEditor/assimp-build/ + sudo make install -j8 + + build-n-cache-ogre-macos: + needs: build-n-cache-assimp-macos + runs-on: macos-latest + steps: + - name: Cache Assimp + id: cache-assimp-macos + uses: actions/cache@v3 + env: + cache-name: cache-assimp-macos + with: + path: | + /usr/local/lib/cmake/ + /usr/local/include/assimp + /usr/local/lib/pkgconfig/assimp.pc + /usr/local/lib/libassimp* + key: ${{ runner.os }}-build-${{ env.cache-name }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + + - name: Cache Ogre + id: cache-ogre-macos + uses: actions/cache@v3 + env: + cache-name: cache-ogre-macos + with: + path: ${{github.workspace}}/ogre/SDK + key: ${{ runner.os }}-build-${{ env.cache-name }} + + - if: steps.cache-ogre-macos.outputs.cache-hit != 'true' + name: Check out ogre repo + uses: actions/checkout@master + with: + repository: OGRECave/ogre + path: ${{github.workspace}}/ogre + + - if: steps.cache-ogre-macos.outputs.cache-hit != 'true' + name: Build Ogre3D repo + run: | + cd ${{github.workspace}}/ogre/ + sudo cmake -S . -DOGRE_BUILD_PLUGIN_ASSIMP=ON -Dassimp_DIR=/usr/local/lib/cmake/assimp-5.2/ -DOGRE_BUILD_PLUGIN_DOT_SCENE=ON -DOGRE_BUILD_RENDERSYSTEM_GL=ON -DOGRE_BUILD_RENDERSYSTEM_GL3PLUS=ON -DOGRE_BUILD_RENDERSYSTEM_GLES2=OFF -DOGRE_BUILD_TESTS=OFF -DOGRE_BUILD_TOOLS=OFF -DOGRE_BUILD_SAMPLES=OFF -DOGRE_BUILD_COMPONENT_CSHARP=OFF -DOGRE_BUILD_COMPONENT_JAVA=OFF -DOGRE_BUILD_COMPONENT_PYTHON=OFF -DOGRE_INSTALL_TOOLS=OFF -DOGRE_INSTALL_DOCS=OFF -DOGRE_INSTALL_SAMPLES=OFF -DOGRE_BUILD_LIBS_AS_FRAMEWORKS=OFF -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + sudo make install -j8 + + build-macos: + needs: [build-n-cache-assimp-macos, build-n-cache-ogre-macos] + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: true + + - run: | + ls ${{github.workspace}}/src/dependencies/ogre-procedural + cd ${{github.workspace}}/src/dependencies/ogre-procedural + git checkout 978e34ffc4079b804bcde3a021686f5dec36e839 + git branch + git status + + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + aqtversion: '==2.1.*' + version: '6.5.0' + host: 'mac' + target: 'desktop' + arch: 'clang_64' + tools: 'tools_cmake' + + - name: Cache Assimp + id: cache-assimp-macos + uses: actions/cache@v3 + env: + cache-name: cache-assimp-macos + with: + path: | + /usr/local/lib/cmake/ + /usr/local/include/assimp + /usr/local/lib/pkgconfig/assimp.pc + /usr/local/lib/libassimp* + key: ${{ runner.os }}-build-${{ env.cache-name }} + + - name: Cache Ogre + id: cache-ogre-macos + uses: actions/cache@v3 + env: + cache-name: cache-ogre-macos + with: + path: ${{github.workspace}}/ogre/SDK + key: ${{ runner.os }}-build-${{ env.cache-name }} + + - name: Configure CMake + env: + OGRE_DIR: ${{github.workspace}}/ogre/SDK/CMake/ + run: | + sudo cmake -S . \ + -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ + -DQt6_DIR=/Users/runner/work/QtMeshEditor/Qt/6.5.0/clang_64/lib/cmake/Qt6 \ + -DQT_DIR=/Users/runner/work/QtMeshEditor/Qt/6.5.0/clang_64/lib/cmake/Qt6 \ + -DQt6GuiTools_DIR=/Users/runner/work/QtMeshEditor/Qt/6.5.0/clang_64/lib/cmake/Qt6GuiTools \ + -DOGRE_DIR=${{github.workspace}}/ogre/SDK/CMake/ + + - name: Build + # Build your program with the given configuration + run: | + sudo make install -j8 + + - name: copy Qt libs to app folder + run: | + sudo cp -R /Users/runner/work/QtMeshEditor/Qt/6.5.0/macos/lib/QtWidgets.framework ${{github.workspace}}/bin/QtMeshEditor.app/Contents/MacOS/QtWidgets.framework + sudo cp -R /Users/runner/work/QtMeshEditor/Qt/6.5.0/macos/lib/QtCore.framework ${{github.workspace}}/bin/QtMeshEditor.app/Contents/MacOS/QtCore.framework + sudo cp -R /Users/runner/work/QtMeshEditor/Qt/6.5.0/macos/lib/QtGui.framework ${{github.workspace}}/bin/QtMeshEditor.app/Contents/MacOS/QtGui.framework + sudo cp -R /Users/runner/work/QtMeshEditor/Qt/6.5.0/macos/lib/QtDBus.framework ${{github.workspace}}/bin/QtMeshEditor.app/Contents/MacOS/QtDBus.framework + sudo cp -R /Users/runner/work/QtMeshEditor/Qt/6.5.0/macos/plugins/platforms ${{github.workspace}}/bin/QtMeshEditor.app/Contents/MacOS/platforms + sudo cp -R /usr/local/lib/libassimp* ${{github.workspace}}/bin/QtMeshEditor.app/Contents/MacOS/ + - run: sudo cp -R ${{github.workspace}}/bin/media ${{github.workspace}}/bin/QtMeshEditor.app/Contents/MacOS/media + - run: sudo cp -R ${{github.workspace}}/bin/cfg ${{github.workspace}}/bin/QtMeshEditor.app/Contents/MacOS/cfg + - run: sudo cp -R ${{github.workspace}}/resources/icon.icns ${{github.workspace}}/bin/QtMeshEditor.app/Contents/MacOS/media + - run: sudo mkdir ${{github.workspace}}/bin/QtMeshEditor.app/Contents/Resources + - run: sudo cp -R ${{github.workspace}}/resources/icon.icns ${{github.workspace}}/bin/QtMeshEditor.app/Contents/Resources + - run: sudo cp -R ${{github.workspace}}/bin/Info.plist ${{github.workspace}}/bin/QtMeshEditor.app/Contents/ + - run: sudo install_name_tool -add_rpath @loader_path/ ${{github.workspace}}/bin/QtMeshEditor.app/Contents/MacOS/QtMeshEditor + + - name: Pack + run: | + brew install create-dmg + sudo create-dmg \ + --volname "QtMeshEditor Installer" \ + --volicon "${{github.workspace}}/resources/icon.icns" \ + --window-pos 200 120 \ + --window-size 800 400 \ + --icon-size 100 \ + --icon "QtMeshEditor.app" 200 190 \ + --app-drop-link 600 185 \ + QtMeshEditor-MacOS.dmg \ + ${{github.workspace}}/bin/QtMeshEditor.app +# using create-dmg instead sudo cpack -G DragNDrop + + - uses: actions/upload-artifact@v3.1.2 + with: + name: QtMeshEditor-MacOS + path: ${{github.workspace}}/QtMeshEditor-MacOS.dmg