diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml deleted file mode 100644 index 3f2d5aa8e..000000000 --- a/.github/workflows/cmake.yml +++ /dev/null @@ -1,286 +0,0 @@ -name: Linux Release - -on: - push: - branches: - - 'master' - - 'dev' - tags: - - 'v*' - pull_request: - branches: - - 'master' - - 'dev' - -defaults: - run: - shell: bash - -env: - SOURCE_DIR: ${{ github.workspace }} - QT_VERSION: 5.15.2 - ARTIFACT: qt-planets-linux-build.AppImage - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout repo - uses: actions/checkout@v2 - with: - submodules: recursive - - - name: boost - run: sudo apt-get update && sudo apt-get install -yq libboost-dev - - - name: Installing system libs - shell: cmake -P {0} - run: | - if ("${{ runner.os }}" STREQUAL "Linux") - execute_process( - COMMAND sudo apt install libgl1-mesa-dev - ) - endif() - - - name: Download Qt - id: qt - shell: cmake -P {0} - run: | - set(qt_version $ENV{QT_VERSION}) - string(REPLACE "." "" qt_version_dotless "${qt_version}") - if ("${{ runner.os }}" STREQUAL "Windows") - set(url_os "windows_x86") - if ("${{ matrix.config.environment_script }}" MATCHES "vcvars64.bat") - set(qt_package_name "qt.qt5.${qt_version_dotless}.win64_msvc2017_64") - set(qt_dir_prefix "${qt_version}/msvc2017_64") - elseif ("${{ matrix.config.environment_script }}" MATCHES "vcvars32.bat") - set(qt_package_name "qt.qt5.${qt_version_dotless}.win32_msvc2017") - set(qt_dir_prefix "${qt_version}/msvc2017") - else() - endif() - elseif ("${{ runner.os }}" STREQUAL "Linux") - set(url_os "linux_x64") - set(qt_package_name "qt.qt5.${qt_version_dotless}.gcc_64") - set(qt_dir_prefix "${qt_version}/gcc_64") - elseif ("${{ runner.os }}" STREQUAL "macOS") - set(url_os "mac_x64") - set(qt_package_name "qt.qt5.${qt_version_dotless}.clang_64") - set(qt_dir_prefix "${qt_version}/clang_64") - endif() - set(qt_base_url "https://download.qt.io/online/qtsdkrepository/${url_os}/desktop/qt5_${qt_version_dotless}") - file(DOWNLOAD "${qt_base_url}/Updates.xml" ./Updates.xml SHOW_PROGRESS) - file(READ ./Updates.xml updates_xml) - string(REGEX MATCH "${qt_package_name}.*([0-9+-.]+).*qtbase([a-zA-Z0-9_-]+).7z" - updates_xml_output "${updates_xml}") - set(package_version ${CMAKE_MATCH_1}) - set(package_suffix ${CMAKE_MATCH_2}) - string(REPLACE "-debug-symbols" "" package_suffix "${package_suffix}") - # Workaround for CMake's greedy regex - if ("${{ matrix.config.environment_script }}" MATCHES "vcvars32.bat") - string(REPLACE "X86_64" "X86" package_suffix "${package_suffix}") - endif() - file(MAKE_DIRECTORY qt5) - # Save the path for other steps - file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/qt5/${qt_dir_prefix}" qt_dir) - message("::set-output name=qt_dir::${qt_dir}") - foreach(package qtbase qtdeclarative qttools qtsvg) - file(DOWNLOAD - "${qt_base_url}/${qt_package_name}/${package_version}${package}${package_suffix}.7z" ./${package}.7z - SHOW_PROGRESS - ) - execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ../${package}.7z WORKING_DIRECTORY qt5) - endforeach() - file(READ "qt5/${qt_dir_prefix}/mkspecs/qconfig.pri" qtconfig) - string(REPLACE "Enterprise" "OpenSource" qtconfig "${qtconfig}") - string(REPLACE "licheck.exe" "" qtconfig "${qtconfig}") - string(REPLACE "licheck64" "" qtconfig "${qtconfig}") - string(REPLACE "licheck_mac" "" qtconfig "${qtconfig}") - file(WRITE "qt5/${qt_dir_prefix}/mkspecs/qconfig.pri" "${qtconfig}") - - - - name: Create build directory - run: mkdir ${{ env.SOURCE_DIR }}/build - - - name: Build - working-directory: ${{ env.SOURCE_DIR }}/build - # Build your program with the given configuration - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - - name: AppImage - working-directory: ${{ env.SOURCE_DIR }}/build - run: | - wget -O deploy.AppImage https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage - chmod +x deploy.AppImage - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${{ github.workspace }}/Qt/5.15.2/gcc_64/lib/ - cp ${{ env.SOURCE_DIR }}/linux/* . - ./deploy.AppImage planets-qml.desktop -appimage -no-translations -qmldir=${{ env.SOURCE_DIR }} -extra-plugins=renderers - mv Qt_planets_app*.AppImage ${{ env.ARTIFACT }} - - - name: Linux artefact - uses: actions/upload-artifact@v1 - with: - name: ${{ env.ARTIFACT }} - path: ${{ env.SOURCE_DIR }}/build/${{ env.ARTIFACT }} - - - - - - - - - - - - - - - - - - - - - - - - - -# name: CMake - -# on: -# push: -# branches: [ dev ] # master -# pull_request: -# branches: [ dev ] # master - -# env: -# QT_VERSION: 5.15.2 -# # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) -# BUILD_TYPE: Release - -# jobs: -# build: -# # 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 -# runs-on: ubuntu-latest - -# steps: -# - uses: actions/checkout@v2 -# # install dependencies -# - name: boost -# run: sudo apt-get update && sudo apt-get install -yq libboost-dev - -# - name: Installing system libs -# shell: cmake -P {0} -# run: | -# if ("${{ runner.os }}" STREQUAL "Linux") -# execute_process( -# COMMAND sudo apt install libgl1-mesa-dev -# ) -# endif() - -# - name: Download Qt -# id: qt -# shell: cmake -P {0} -# run: | -# set(qt_version $ENV{QT_VERSION}) -# string(REPLACE "." "" qt_version_dotless "${qt_version}") -# if ("${{ runner.os }}" STREQUAL "Windows") -# set(url_os "windows_x86") -# if ("${{ matrix.config.environment_script }}" MATCHES "vcvars64.bat") -# set(qt_package_name "qt.qt5.${qt_version_dotless}.win64_msvc2017_64") -# set(qt_dir_prefix "${qt_version}/msvc2017_64") -# elseif ("${{ matrix.config.environment_script }}" MATCHES "vcvars32.bat") -# set(qt_package_name "qt.qt5.${qt_version_dotless}.win32_msvc2017") -# set(qt_dir_prefix "${qt_version}/msvc2017") -# else() -# endif() -# elseif ("${{ runner.os }}" STREQUAL "Linux") -# set(url_os "linux_x64") -# set(qt_package_name "qt.qt5.${qt_version_dotless}.gcc_64") -# set(qt_dir_prefix "${qt_version}/gcc_64") -# elseif ("${{ runner.os }}" STREQUAL "macOS") -# set(url_os "mac_x64") -# set(qt_package_name "qt.qt5.${qt_version_dotless}.clang_64") -# set(qt_dir_prefix "${qt_version}/clang_64") -# endif() -# set(qt_base_url "https://download.qt.io/online/qtsdkrepository/${url_os}/desktop/qt5_${qt_version_dotless}") -# file(DOWNLOAD "${qt_base_url}/Updates.xml" ./Updates.xml SHOW_PROGRESS) -# file(READ ./Updates.xml updates_xml) -# string(REGEX MATCH "${qt_package_name}.*([0-9+-.]+).*qtbase([a-zA-Z0-9_-]+).7z" -# updates_xml_output "${updates_xml}") -# set(package_version ${CMAKE_MATCH_1}) -# set(package_suffix ${CMAKE_MATCH_2}) -# string(REPLACE "-debug-symbols" "" package_suffix "${package_suffix}") -# # Workaround for CMake's greedy regex -# if ("${{ matrix.config.environment_script }}" MATCHES "vcvars32.bat") -# string(REPLACE "X86_64" "X86" package_suffix "${package_suffix}") -# endif() -# file(MAKE_DIRECTORY qt5) -# # Save the path for other steps -# file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/qt5/${qt_dir_prefix}" qt_dir) -# message("::set-output name=qt_dir::${qt_dir}") -# foreach(package qtbase qtdeclarative qttools qtsvg) -# file(DOWNLOAD -# "${qt_base_url}/${qt_package_name}/${package_version}${package}${package_suffix}.7z" ./${package}.7z -# SHOW_PROGRESS -# ) -# execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ../${package}.7z WORKING_DIRECTORY qt5) -# endforeach() -# file(READ "qt5/${qt_dir_prefix}/mkspecs/qconfig.pri" qtconfig) -# string(REPLACE "Enterprise" "OpenSource" qtconfig "${qtconfig}") -# string(REPLACE "licheck.exe" "" qtconfig "${qtconfig}") -# string(REPLACE "licheck64" "" qtconfig "${qtconfig}") -# string(REPLACE "licheck_mac" "" qtconfig "${qtconfig}") -# file(WRITE "qt5/${qt_dir_prefix}/mkspecs/qconfig.pri" "${qtconfig}") - - -# # - 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: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -# - name: Configure -# shell: cmake -P {0} -# run: | -# if ("${{ runner.os }}" STREQUAL "Windows" AND NOT "x${{ matrix.config.environment_script }}" STREQUAL "x") -# execute_process( -# COMMAND "${{ matrix.config.environment_script }}" && set -# OUTPUT_FILE environment_script_output.txt -# ) -# file(STRINGS environment_script_output.txt output_lines) -# foreach(line IN LISTS output_lines) -# if (line MATCHES "^([a-zA-Z0-9_-]+)=(.*)$") -# set(ENV{${CMAKE_MATCH_1}} "${CMAKE_MATCH_2}") -# # Set for other steps -# message("::set-env name=${CMAKE_MATCH_1}::${CMAKE_MATCH_2}") -# endif() -# endforeach() -# endif() -# file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/qtcreator" qtcreator_dir) -# execute_process( -# COMMAND ${{ steps.qt.outputs.qt_dir }}/bin/qmake -# $ENV{PLUGIN_PRO} -# CONFIG+=release -# QTC_SOURCE="${qtcreator_dir}" -# QTC_BUILD="${qtcreator_dir}" -# RESULT_VARIABLE result -# ) -# if (NOT result EQUAL 0) -# message(FATAL_ERROR "Bad exit status") -# endif() -# - name: Build -# # Build your program with the given configuration -# run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - -# # - name: Test -# # working-directory: ${{github.workspace}}/build -# # # 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}} - - - diff --git a/.github/workflows/cmake_win.yml b/.github/workflows/cmake_win.yml deleted file mode 100644 index 47ca4456b..000000000 --- a/.github/workflows/cmake_win.yml +++ /dev/null @@ -1,103 +0,0 @@ -name: Compile and Release Qt6 Proyect - -on: push - -env: - QT_VERSION: "5.15.2" - MINGW_VERSION: "win64_mingw122" - MINGW_PATH: "mingw81_64" - BUILD_TYPE: Release - -jobs: - build: - runs-on: windows-latest - steps: - - - uses: actions/checkout@v2 -# - -# name: Check mingw g++ version -# run: | -# Write-Output (Get-Command g++.exe).Path -# g++.exe --version - - - name: Install correct version of mingw - uses: crazy-max/ghaction-chocolatey@v1 - with: - args: install mingw --version=12.2.0 -y - - - name: Install boost - uses: MarkusJx/install-boost@v2.0.0 - id: install-boost - with: - boost_version: 1.71.0 - if: runner.os == 'Windows' - -# - -# name: Check mingw directory -# run: | -# ls C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin - - - name: Install Qt - uses: jurplel/install-qt-action@v2 - with: - host: windows - target: "desktop" - version: ${{ env.QT_VERSION }} - arch: ${{ env.MINGW_VERSION }} - dir: "${{github.workspace}}/qt" - install-deps: "true" - - - name: Set Qt path and refresh - run: | - echo "${{github.workspace}}/qt/Qt/${{ env.QT_VERSION }}/${{ env.MINGW_PATH }}/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - refreshenv - #Write-Output (Get-Command g++.exe).Path - #g++.exe --version -# - -# name: Check availability of libraries -# run: | -# ls ${{github.workspace}}/qt/Qt/${{ env.QT_VERSION }}/${{ env.MINGW_PATH }}/lib/ -# - -# name: Check availability of binaries -# run: | -# ls ${{github.workspace}}/qt/Qt/${{ env.QT_VERSION }}/${{ env.MINGW_PATH }}/bin/ -# - -# name: Prepend path -# run: echo ":${{github.workspace}}/qt/Qt/${{ env.QT_VERSION }}/mingw73_32/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append -# - -# name: Check QMake, CMake and make -# run: | -# Write-Output (Get-Command qmake.exe).Path -# qmake.exe -version -# Write-Output (Get-Command cmake.exe).Path -# cmake.exe -version -# Write-Output (Get-Command mingw32-make.exe).Path -# mingw32-make.exe -version - - - name: Configure CMake Proyect - working-directory: ${{github.workspace}} - env: - CMAKE_PREFIX_PATH: ${{env.Qt5_Dir}} - run: cmake -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -G "CodeBlocks - MinGW Makefiles" -B ${{github.workspace}}/build - - - name: Build proyect - working-directory: ${{github.workspace}}/build - run: | - mingw32-make.exe - - - name: Compress portable program - run: | - mkdir ${{github.workspace}}\build\all\ - cp ${{github.workspace}}/build/RePr.exe ${{github.workspace}}\build\all\ - cd ${{github.workspace}}\build\all\ - windeployqt.exe RePr.exe --release - ls - Compress-Archive -Path ${{github.workspace}}\build\all\ -DestinationPath ${{github.workspace}}\build\final.zip - - - name: Release - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - files: ${{github.workspace}}/build/final.zip - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/push-linux.yml b/.github/workflows/push-linux.yml new file mode 100644 index 000000000..34b034eee --- /dev/null +++ b/.github/workflows/push-linux.yml @@ -0,0 +1,71 @@ +name: Compile-Qt5-linux64 + +on: push + +env: + QT_VERSION: "5.15.2" + QT_ARCH: "gcc_64" + QT_SUBDIR: "gcc_64" + BOOST_VERSION: "1.84.0" + BUILD_TYPE: "Release" + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: "true" + + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + host: linux + target: desktop + version: ${{env.QT_VERSION}} + arch: ${{env.QT_ARCH}} + dir: "${{github.workspace}}/qt" + install-deps: "true" + cache: "true" + - name: Add Qt to env + run: | + QT_DIR="${{github.workspace}}/qt/Qt/${{env.QT_VERSION}}/${{env.QT_SUBDIR}}" + echo "Qt dir: $QT_DIR" + echo "$QT_DIR/bin" >> ${GITHUB_PATH} + echo "CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$QT_DIR/lib/cmake/Qt5" >> ${GITHUB_ENV} + + - name: Install boost + uses: MarkusJx/install-boost@v2.4.5 + id: install-boost + with: + boost_version: ${{ env.BOOST_VERSION }} + cache: "true" + - name: Add Boost to env + run: | + BOOST_DIR="${{github.workspace}}/boost/boost" + echo "Boost dir: $BOOST_DIR" + echo "CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$BOOST_DIR" >> ${GITHUB_ENV} + + - name: Install cqtdeployer + run: | + curl 'https://github.com/QuasarApp/CQtDeployer/releases/download/v1.6.2351/CQtDeployer_1.6.2351.ec4840f_Linux_x86_64.deb' -L > ./cqtdeployer.deb + sudo dpkg -i ./cqtdeployer.deb + rm ./cqtdeployer.deb + cqtdeployer version + + - name: Configure + working-directory: "." + run: | + cmake -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DGIT_REF_NAME=${{github.ref_name}} -DGIT_SHA=${{github.sha}} -B ${{github.workspace}}/build + - name: Build + working-directory: "./build" + run: | + cmake --build . --config Release -j $(nproc) + cmake --build . --target=deploy + + - name: Dist + uses: actions/upload-artifact@v4 + with: + name: linux_prebuild + path: ./bin diff --git a/.github/workflows/push-win.yml b/.github/workflows/push-win.yml new file mode 100644 index 000000000..8c52e6026 --- /dev/null +++ b/.github/workflows/push-win.yml @@ -0,0 +1,62 @@ +name: Compile-Qt5-win64 + +on: push + +env: + QT_VERSION: "5.15.2" + QT_ARCH: "win64_msvc2019_64" + QT_SUBDIR: "msvc2019_64" + BOOST_VERSION: "1.84.0" + BUILD_TYPE: "Release" + +jobs: + build: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: "true" + + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + host: windows + target: desktop + version: ${{env.QT_VERSION}} + arch: ${{env.QT_ARCH}} + dir: "${{github.workspace}}/qt" + install-deps: "true" + cache: "true" + - name: Add Qt to env + run: | + $QT_DIR="${{github.workspace}}/qt/Qt/${{env.QT_VERSION}}/${{env.QT_SUBDIR}}" + echo "Qt dir: $QT_DIR" + echo ";$QT_DIR/bin" > $env:GITHUB_PATH + echo "CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH;$QT_DIR/lib/cmake/Qt5" >> $env:GITHUB_ENV + + - name: Install boost + uses: MarkusJx/install-boost@v2.4.5 + id: install-boost + with: + boost_version: ${{ env.BOOST_VERSION }} + cache: "true" + - name: Add Boost to env + run: | + $BOOST_DIR="${{github.workspace}}/boost/boost" + echo "Boost dir: $BOOST_DIR" + echo "CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH;$BOOST_DIR" >> $env:GITHUB_ENV + + - name: Configure + working-directory: "." + run: | + cmake -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DGIT_REF_NAME=${{github.ref_name}} -DGIT_SHA=${{github.sha}} -B ${{github.workspace}}/build + - name: Build + working-directory: "./build" + run: cmake --build . --config Release -j (Get-CimInstance -ClassName Win32_Processor | Measure-Object -Property NumberOfLogicalProcessors -Sum).Sum + + - name: Dist + uses: actions/upload-artifact@v4 + with: + name: win_prebuild + path: ./bin diff --git a/GGEasy/CMakeLists.txt b/GGEasy/CMakeLists.txt index f3a024287..a7c9cb11f 100644 --- a/GGEasy/CMakeLists.txt +++ b/GGEasy/CMakeLists.txt @@ -40,6 +40,8 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIRECTORY}) string(TIMESTAMP DT "%d.%m.%Y - %H:%M:%S")# [] [UTC]) add_definitions(-DBUILD_DATE="${DT}") +add_definitions(-DGIT_REF_NAME="${GIT_REF_NAME}") +add_definitions(-DGIT_SHA="${GIT_SHA}") find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Gui Widgets LinguistTools) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS @@ -175,8 +177,8 @@ elseif (UNIX)#LINUX add_custom_target( deploy - COMMAND cqtdeployer clear -bin ${CURENT_PROJECT} -qmake ${Q_MAKE_EXE} -libDir ${PROJECT_SOURCE_DIR} -qmlDir ${PROJECT_SOURCE_DIR} -recursiveDepth 5 - COMMENT "Deploy: cqtdeployer clear -bin ${CURENT_PROJECT} -qmake ${Q_MAKE_EXE} -libDir ${PROJECT_SOURCE_DIR} -qmlDir ${PROJECT_SOURCE_DIR} -recursiveDepth 5" + COMMAND cqtdeployer clear -bin "${OUTPUT_DIRECTORY}/${PROJECT_NAME}" -extraData "${OUTPUT_DIRECTORY}/plugins" -extraDataOut /bin -qmake "${Q_MAKE_EXE}" -libDir "${PROJECT_SOURCE_DIR}" -qmlDir "${PROJECT_SOURCE_DIR}" -recursiveDepth 5 -targetDir "${OUTPUT_DIRECTORY}/../cqt-deploy" + COMMENT "Deploy app with cqtdeployer" WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} ) diff --git a/GGEasy/aboutform.cpp b/GGEasy/aboutform.cpp index a896b6da0..0f36884f1 100644 --- a/GGEasy/aboutform.cpp +++ b/GGEasy/aboutform.cpp @@ -26,6 +26,7 @@ AboutForm::AboutForm(QWidget* parent) #else QString str(QString(/*BUILD_DATE*/ __DATE__ " " __TIME__).append("
MSC_VER: ") + QString::number(_MSC_VER)); #endif + str.append("
Git: " GIT_REF_NAME ":" GIT_SHA); str.push_back("
Application Version: " + qApp->applicationVersion()); ui->lblAbout->setText(ui->lblAbout->text().arg(/*qApp->applicationVersion()*/ str)); connect(ui->cmdOk_2, &QPushButton::clicked, this, &AboutForm::accept);