From a4d7bc1c166dbb2fc8173251b0ed09518e57b36e Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Fri, 30 Sep 2022 15:58:04 -0400 Subject: [PATCH 01/16] Fix minor doc typos --- src/qmpi.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qmpi.cpp b/src/qmpi.cpp index d02e4c1..76de009 100644 --- a/src/qmpi.cpp +++ b/src/qmpi.cpp @@ -607,7 +607,7 @@ void Qmpi::abort() } /*! - * Returns @c true if the interfaces connection is active is any way. That is, the interface is in any + * Returns @c true if the interface's connection is active is any way. That is, the interface is in any * state other than @ref Disconnected; otherwise, returns @c false. * * @sa isConnected(). @@ -615,7 +615,7 @@ void Qmpi::abort() bool Qmpi::isConnectionActive() const { return mState != State::Disconnected; } /*! - * Returns @c true if the interfaces has fully connected to the QEMU instance, meaning the underlying + * Returns @c true if the interface has fully connected to the QEMU instance, meaning the underlying * socket successfully established a connection and the server's greeting was received. * * @sa isConnectionActive(). @@ -769,7 +769,7 @@ void Qmpi::handleTransactionTimeout() { raiseCommunicationError(CommunicationErr * @fn void Qmpi::finished() * * This signal is emitted when the interface returns to the @ref Disconnected state for any reason, - * regardless of whether or a complete connection to the server was ever achieved. + * regardless of whether or not a complete connection to the server was ever achieved. * * @warning If you need to delete the sender() of this signal in a slot connected to it, use the * deleteLater() function. From 8eb1d80cccd9d38a63c8d241bc5cce67f64c5c52 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Wed, 19 Oct 2022 15:24:32 -0400 Subject: [PATCH 02/16] Actions: Refactor to new set-output syntax --- .github/workflows/build-qi-qmp-linux.yml | 2 +- .github/workflows/build-qi-qmp-windows.yml | 2 +- .github/workflows/master-pull-request-merge-reaction.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-qi-qmp-linux.yml b/.github/workflows/build-qi-qmp-linux.yml index a23e8af..c489e40 100644 --- a/.github/workflows/build-qi-qmp-linux.yml +++ b/.github/workflows/build-qi-qmp-linux.yml @@ -143,7 +143,7 @@ jobs: run: | cpack_name=$(find * -type f -name "*.zip") artifact_name=$(basename "$cpack_name" .zip) - echo "::set-output name=${{ env.artifact_output_var }}::$artifact_name" + echo "${{ env.artifact_output_var }}=$artifact_name" >> $GITHUB_OUTPUT - name: Upload QI-QMP build artifact uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/build-qi-qmp-windows.yml b/.github/workflows/build-qi-qmp-windows.yml index c9302d7..980d880 100644 --- a/.github/workflows/build-qi-qmp-windows.yml +++ b/.github/workflows/build-qi-qmp-windows.yml @@ -117,7 +117,7 @@ jobs: echo "Build complete." - name: Get QI-QMP artifact name id: get_artifact_name - run: echo "::set-output name=${{ env.artifact_output_var }}::$((Get-ChildItem -Path "${{ env.qi_qmp_package_path }}" -Filter *.zip)[0].BaseName)" + run: echo "${{ env.artifact_output_var }}=$((Get-ChildItem -Path "${{ env.qi_qmp_package_path }}" -Filter *.zip)[0].BaseName)" >> $Env:GITHUB_OUTPUT - name: Upload QI-QMP build artifact uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/master-pull-request-merge-reaction.yml b/.github/workflows/master-pull-request-merge-reaction.yml index c64fe5e..ab1fa27 100644 --- a/.github/workflows/master-pull-request-merge-reaction.yml +++ b/.github/workflows/master-pull-request-merge-reaction.yml @@ -39,7 +39,7 @@ jobs: throw "Could not get base version!" } $new_tag = "v$($Matches[1].Trim())" - echo "::set-output name=new_tag::$new_tag" + echo "new_tag=$new_tag" >> $Env:GITHUB_OUTPUT git tag -a $new_tag -m "Release $new_tag" git push --tags - name: Move 'latest' tag From f2000252a9d74290417a3591d1b9d4536bb3bde6 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Sun, 23 Oct 2022 16:28:44 -0400 Subject: [PATCH 03/16] Update kanga333/variable-mapper to v0.3.0 --- .github/workflows/build-qi-qmp-linux.yml | 2 +- .github/workflows/build-qi-qmp-windows.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-qi-qmp-linux.yml b/.github/workflows/build-qi-qmp-linux.yml index c489e40..70b0958 100644 --- a/.github/workflows/build-qi-qmp-linux.yml +++ b/.github/workflows/build-qi-qmp-linux.yml @@ -39,7 +39,7 @@ jobs: qt_static_artifact_name: ${{ steps.get_artifact_name.outputs.qt_static_artifact_name }} steps: - name: Set matrix derived variables - uses: kanga333/variable-mapper@v0.2.2 + uses: kanga333/variable-mapper@v0.3.0 with: key: ${{ matrix.qt_linkage }} map: | diff --git a/.github/workflows/build-qi-qmp-windows.yml b/.github/workflows/build-qi-qmp-windows.yml index 980d880..53fd92f 100644 --- a/.github/workflows/build-qi-qmp-windows.yml +++ b/.github/workflows/build-qi-qmp-windows.yml @@ -37,7 +37,7 @@ jobs: qt_static_artifact_name: ${{ steps.get_artifact_name.outputs.qt_static_artifact_name }} steps: - name: Set matrix derived variables - uses: kanga333/variable-mapper@v0.2.2 + uses: kanga333/variable-mapper@v0.3.0 with: key: ${{ matrix.qt_linkage }} map: | From 282d2be601a77a97a3d8bd1b3118e615d714087a Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Thu, 17 Nov 2022 23:38:07 -0500 Subject: [PATCH 04/16] Install doxygen via sourceforge composite action --- .github/workflows/build-qi-qmp-linux.yml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-qi-qmp-linux.yml b/.github/workflows/build-qi-qmp-linux.yml index 70b0958..75f790a 100644 --- a/.github/workflows/build-qi-qmp-linux.yml +++ b/.github/workflows/build-qi-qmp-linux.yml @@ -97,16 +97,9 @@ jobs: - name: Install XCB Related libs run: sudo apt-get install libx11-xcb-dev libxkbcommon-dev libxkbcommon-x11-dev libxcb-*-dev - name: Install Doxygen - env: - doxy_build: doxygen-1.9.4 - doxy_arch_ext: linux.bin.tar.gz - doxy_repo: https://www.doxygen.nl/files - run: | - curl "$doxy_repo/$doxy_build.$doxy_arch_ext" --output "$general_download_dir/$doxy_build.$doxy_arch_ext" --create-dirs --location --silent --show-error - cd $general_download_dir - tar xf "$doxy_build.$doxy_arch_ext" - cd "$doxy_build" - sudo make install + uses: oblivioncth/actions/ubuntu/install-doxygen-from-sourceforge@dev + with: + version: 1.9.5 - name: Install Graphviz run: sudo apt-get install graphviz - name: Install Ninja From 71139f0965b7d47d9707142ecfb2501b33be66d0 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Fri, 18 Nov 2022 00:36:23 -0500 Subject: [PATCH 05/16] Actions: Install megatools using composite action on Ubuntu --- .github/workflows/build-qi-qmp-linux.yml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-qi-qmp-linux.yml b/.github/workflows/build-qi-qmp-linux.yml index 75f790a..9dd6230 100644 --- a/.github/workflows/build-qi-qmp-linux.yml +++ b/.github/workflows/build-qi-qmp-linux.yml @@ -68,16 +68,9 @@ jobs: key: ${{ env.qt_install_url }} - name: Install megatools if: steps.cache-qt.outputs.cache-hit != 'true' - env: - mt_build: megatools-1.11.0.20220519-linux-x86_64 - mt_arch_ext: tar.gz - mt_repo: https://megatools.megous.com/builds/builds/ - run: | - curl "$mt_repo/$mt_build.$mt_arch_ext" --output "$general_download_dir/$mt_build.$mt_arch_ext" --create-dirs --location --silent --show-error - cd $general_download_dir - tar xf "$mt_build.$mt_arch_ext" - cd "$mt_build" - cp -p megatools /usr/local/bin + uses: oblivioncth/actions/ubuntu/install-megatools-from-megous@dev + with: + version: 1.11.0.20220519 - name: Create Qt Download Directory if: steps.cache-qt.outputs.cache-hit != 'true' run: mkdir -p "${{ env.qt_download_dir }}" From 14ac08159c111014011ca327718d2ba96281ed79 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Fri, 18 Nov 2022 01:29:18 -0500 Subject: [PATCH 06/16] Use composite action for master PR version check --- .../workflows/master-pull-request-checks.yml | 40 +++---------------- 1 file changed, 6 insertions(+), 34 deletions(-) diff --git a/.github/workflows/master-pull-request-checks.yml b/.github/workflows/master-pull-request-checks.yml index 48df723..bf464c9 100644 --- a/.github/workflows/master-pull-request-checks.yml +++ b/.github/workflows/master-pull-request-checks.yml @@ -5,40 +5,12 @@ on: branches: master jobs: - ensure-higher-version: - name: Ensure higher version than last tag has been set + check-pr-correctness: + name: Master PR correctness check runs-on: windows-latest - env: - qi_qmp_src_suffix: QI-QMP/Source/ - qi_qmp_src_dir: ${{ github.workspace }}/QI-QMP/Source/ steps: - - name: Checkout QI-QMP - uses: actions/checkout@v3 + - name: Ensure higher version + uses: oblivioncth/actions/cmake/ensure-project-version-gt-tag@dev with: - path: ${{ env.qi_qmp_src_suffix }} - fetch-depth: 0 # Required for tag search to find previous tag - - name: Compare versions - env: - match_start: set\(QI_QMP_BASE_VERSION - match_end: \) - run: | - cd "${{ env.qi_qmp_src_dir }}" - echo "Checking for version tags..." - if(git tag -l v*.*){ - echo "Version tags found, comparing new and last tag..." - $last_tag_version = $(git describe --abbrev=0 --match v*.*).substring(1) - echo "Last tag version: ${last_tag_version}" - $project_lists = Get-Content -Raw CMakeLists.txt - if(!($project_lists -match '(?<=${{ env.match_start }})(.*)(?=${{ env.match_end }})')){ - throw "Could not get project version!" - } - $new_tag_version = $Matches[1].Trim() - echo "New tag version: ${new_tag_version}" - if(!([version]$new_tag_version -gt [version]$last_tag_version)){ - throw "Project version was not increased to be above previous tagged version!" - } - } - else{ - echo "No existing version tags present. Proceeding..." - } - \ No newline at end of file + ver_match_start: set\(QI_QMP_BASE_VERSION + ver_match_end: \) \ No newline at end of file From ecccf0ef70dddf80b235853d1dd77d427beb6122 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Fri, 18 Nov 2022 02:08:03 -0500 Subject: [PATCH 07/16] Use composite action for pr labeler --- .github/workflows/pull-request-labeler.yml | 27 ++++------------------ 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/.github/workflows/pull-request-labeler.yml b/.github/workflows/pull-request-labeler.yml index 0fa9b81..a53e72d 100644 --- a/.github/workflows/pull-request-labeler.yml +++ b/.github/workflows/pull-request-labeler.yml @@ -4,28 +4,9 @@ on: types: [opened] jobs: - label_master_pr: - name: Label master pull-request - if: github.base_ref == 'master' + label_pr: + name: Label pull-request runs-on: ubuntu-latest steps: - - name: Create label - uses: actions-ecosystem/action-add-labels@v1 - with: - labels: release-pr - label_other_pr: - name: Label other standard pull-requests - if: github.base_ref != 'master' - runs-on: ubuntu-latest - steps: - - name: Label bugfix PR - if: startsWith(github.head_ref, 'bugfix/') - uses: actions-ecosystem/action-add-labels@v1 - with: - labels: bug - - name: Label feature PR - if: startsWith(github.head_ref, 'feature/') - uses: actions-ecosystem/action-add-labels@v1 - with: - labels: enhancement - \ No newline at end of file + - name: Label via convention + uses: oblivioncth/actions/pull-request/label-pr-conventionally@dev \ No newline at end of file From e5d744f1deacadcb2e39cc72f2fe5c14934877fa Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Tue, 6 Dec 2022 08:08:09 -0500 Subject: [PATCH 08/16] Actions: Further use of composite actions --- .../workflows/master-pull-request-checks.yml | 3 -- .../master-pull-request-merge-reaction.yml | 28 +++++++++---------- CMakeLists.txt | 3 +- 3 files changed, 14 insertions(+), 20 deletions(-) diff --git a/.github/workflows/master-pull-request-checks.yml b/.github/workflows/master-pull-request-checks.yml index bf464c9..e26b5db 100644 --- a/.github/workflows/master-pull-request-checks.yml +++ b/.github/workflows/master-pull-request-checks.yml @@ -11,6 +11,3 @@ jobs: steps: - name: Ensure higher version uses: oblivioncth/actions/cmake/ensure-project-version-gt-tag@dev - with: - ver_match_start: set\(QI_QMP_BASE_VERSION - ver_match_end: \) \ No newline at end of file diff --git a/.github/workflows/master-pull-request-merge-reaction.yml b/.github/workflows/master-pull-request-merge-reaction.yml index ab1fa27..5bd0a3a 100644 --- a/.github/workflows/master-pull-request-merge-reaction.yml +++ b/.github/workflows/master-pull-request-merge-reaction.yml @@ -20,29 +20,26 @@ jobs: outputs: version_tag: ${{ steps.tag_master.outputs.new_tag }} steps: - - name: Checkout QI-QMP Master - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Setup git user for bot - run: | - git config --global user.name "${{ env.ci_bot_username }}" - git config --global user.email "${{ env.ci_bot_email }}" + - name: Get project version + id: get-proj-ver + uses: oblivioncth/actions/cmake/get-project-version@dev + - name: Set Git user to ObyBotCI + uses: oblivioncth/actions/git/set-git-user-to-oby-bot@dev + - name: Checkout Project + id: proj-checkout + uses: oblivioncth/actions/git/smart-checkout@dev - name: Tag master with new version tag id: tag_master + working-directory: ${{ steps.proj-checkout.outputs.path }} env: - match_start: set\(QI_QMP_BASE_VERSION - match_end: \) + new_version: ${{ steps.get-proj-ver.outputs.version }} run: | - $project_lists = Get-Content -Raw CMakeLists.txt - if(!($project_lists -match '(?<=${{ env.match_start }})(.*)(?=${{ env.match_end }})')){ - throw "Could not get base version!" - } - $new_tag = "v$($Matches[1].Trim())" + $new_tag = "v${Env:new_version}" echo "new_tag=$new_tag" >> $Env:GITHUB_OUTPUT git tag -a $new_tag -m "Release $new_tag" git push --tags - name: Move 'latest' tag + working-directory: ${{ steps.proj-checkout.outputs.path }} run: | echo "Checking for 'latest' tag..." if(git tag -l latest){ @@ -57,6 +54,7 @@ jobs: git push origin latest - name: Fast-forward merge master into to dev if: always() + working-directory: ${{ steps.proj-checkout.outputs.path }} run: | git checkout dev git merge master --ff-only diff --git a/CMakeLists.txt b/CMakeLists.txt index d63c3eb..6cf9b64 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,9 +12,8 @@ option(QI_QMP_DOCS_TARGET "Build QI-QMP documentation" OFF) # Project # NOTE: DON'T USE TRAILING ZEROS IN VERSIONS -set(QI_QMP_BASE_VERSION 0.1.3) # Required for CI/CD project(QI-QMP - VERSION ${QI_QMP_BASE_VERSION} + VERSION 0.1.3 LANGUAGES CXX DESCRIPTION "Qt-based Interface for QEMU Machine Protocol" ) From 6236a11220c0efeb61062ac4de99c26c7410b294 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Tue, 6 Dec 2022 12:31:22 -0500 Subject: [PATCH 09/16] Actions: Remove Doxygen_ROOT workaround Requires CMake 3.25.0 --- .github/workflows/build-qi-qmp-windows.yml | 4 +--- CMakeLists.txt | 2 +- README.md | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-qi-qmp-windows.yml b/.github/workflows/build-qi-qmp-windows.yml index 53fd92f..93d4556 100644 --- a/.github/workflows/build-qi-qmp-windows.yml +++ b/.github/workflows/build-qi-qmp-windows.yml @@ -93,13 +93,11 @@ jobs: - name: Build/Install QI-QMP working-directory: ${{ env.qi_qmp_src_dir }} shell: cmd - env: - doxygen_root: C:\Program Files\doxygen # Required because of #42 run: | echo "Setup C++ Build Environment..." CALL "${{ env.vs_dir }}\Common7\Tools\VsDevCmd.bat" -arch=amd64 echo "Configure CMake using Qt wrapper..." - CALL "${{ env.qt_cmake }}" -G "${{ env.cmake_gen }}" -S "${{ env.qi_qmp_src_dir}}" -B "${{ env.qi_qmp_build_dir }}" -D QI_QMP_DOCS_TARGET=ON -D Doxygen_ROOT="${{ env.doxygen_root }}" + CALL "${{ env.qt_cmake }}" -G "${{ env.cmake_gen }}" -S "${{ env.qi_qmp_src_dir}}" -B "${{ env.qi_qmp_build_dir }}" -D QI_QMP_DOCS_TARGET=ON" echo "Changing to build directory..." cd "%qi_qmp_build_dir%" echo "Building QI-QMP debug..." diff --git a/CMakeLists.txt b/CMakeLists.txt index 6cf9b64..952cbcd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ #================= Project Setup ========================== # CMake -cmake_minimum_required(VERSION 3.21.1) +cmake_minimum_required(VERSION 3.25.0) # Store minimum required version for later since it can be overwritten # by find_package/macro calls in dependencies (stupid) diff --git a/README.md b/README.md index 2a3710b..c4ff817 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Finally, the [Minimal Example](https://oblivioncth.github.io/QI-QMP/index.html#a ### Summary - C++20 - - CMake 3.21.1 + - CMake 3.25.0 ### Dependencies - Qt6 From 5e0558c83ba77172a888daff24c06141ff05cc26 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Sun, 29 Jan 2023 17:40:08 -0500 Subject: [PATCH 10/16] Use OB Actions to install Qt --- .github/workflows/build-qi-qmp-linux.yml | 59 ++++--------------- .github/workflows/build-qi-qmp-windows.yml | 59 +++++-------------- .../master-pull-request-merge-reaction.yml | 6 +- .github/workflows/push-reaction.yml | 12 ++-- 4 files changed, 33 insertions(+), 103 deletions(-) diff --git a/.github/workflows/build-qi-qmp-linux.yml b/.github/workflows/build-qi-qmp-linux.yml index 9dd6230..a3d1775 100644 --- a/.github/workflows/build-qi-qmp-linux.yml +++ b/.github/workflows/build-qi-qmp-linux.yml @@ -2,11 +2,8 @@ name: Linux - Build QI-QMP on: workflow_call: secrets: - qt_shared_url: - description: 'MEGA Qt shared install archive URL' - required: true - qt_static_url: - description: 'MEGA Qt static install archive URL' + qt_ffynnon_cred: + description: 'Credentials for getting Qt from Ffynnon' required: true outputs: qt_shared_artifact_name: @@ -18,7 +15,6 @@ on: env: general_download_dir: ${{ github.workspace }}/Download qt_install_dir: ${{ github.workspace }}/Qt/Install - qt_download_dir: ${{ github.workspace }}/Qt/Download qi_qmp_src_suffix: QI-QMP/Source qi_qmp_src_dir: ${{ github.workspace }}/QI-QMP/Source qi_qmp_build_dir: ${{ github.workspace }}/QI-QMP/Build @@ -38,53 +34,21 @@ jobs: qt_shared_artifact_name: ${{ steps.get_artifact_name.outputs.qt_shared_artifact_name }} qt_static_artifact_name: ${{ steps.get_artifact_name.outputs.qt_static_artifact_name }} steps: - - name: Set matrix derived variables - uses: kanga333/variable-mapper@v0.3.0 - with: - key: ${{ matrix.qt_linkage }} - map: | - { - "shared": { - "qt_install_url": "${{ secrets.qt_shared_url }}", - "artifact_output_var": "qt_shared_artifact_name" - }, - "static": { - "qt_install_url": "${{ secrets.qt_static_url }}", - "artifact_output_var": "qt_static_artifact_name" - } - } - export_to: env,log - name: Set derived variables with shell because GitHub Actions env context sucks run: | echo "qi_qmp_package_path=${{ env.qi_qmp_build_dir }}/out/dist" >> $GITHUB_ENV qi_qmp_install_path="${{ env.qi_qmp_build_dir }}/out/install" echo "qi_qmp_install_path=$qi_qmp_install_path" >> $GITHUB_ENV echo "qt_cmake=$qt_install_dir/bin/qt-cmake" >> $GITHUB_ENV - - name: Cache Qt Build - id: cache-qt - uses: actions/cache@v3 + - name: Install Qt (custom build) + uses: oblivioncth/actions/general/install-and-cache-qt-from-ffynnon@dev with: + version: 6.4.0 + os: linux + compiler: clang + linkage: ${{ matrix.qt_linkage }} path: ${{ env.qt_install_dir }} - key: ${{ env.qt_install_url }} - - name: Install megatools - if: steps.cache-qt.outputs.cache-hit != 'true' - uses: oblivioncth/actions/ubuntu/install-megatools-from-megous@dev - with: - version: 1.11.0.20220519 - - name: Create Qt Download Directory - if: steps.cache-qt.outputs.cache-hit != 'true' - run: mkdir -p "${{ env.qt_download_dir }}" - - name: Download Qt Install - if: steps.cache-qt.outputs.cache-hit != 'true' - run: megatools dl "$qt_install_url" --path "${{ env.qt_download_dir }}" - - name: Determine Qt Install Package Name - if: steps.cache-qt.outputs.cache-hit != 'true' - run: | - qt_install_name=$(ls "${{ env.qt_download_dir }}" | grep "qt-.*7z") - echo "qt_install_dest=${{ env.qt_download_dir }}/$qt_install_name" >> $GITHUB_ENV - - name: Extract Qt Install - if: steps.cache-qt.outputs.cache-hit != 'true' - run: 7z x ${{ env.qt_install_dest }} -o${{ env.qt_install_dir }} + credentials: ${{ secrets.qt_ffynnon_cred }} - name: Install OpenGL lib run: sudo apt-get install libglu1-mesa-dev - name: Install XCB Related libs @@ -129,10 +93,11 @@ jobs: run: | cpack_name=$(find * -type f -name "*.zip") artifact_name=$(basename "$cpack_name" .zip) - echo "${{ env.artifact_output_var }}=$artifact_name" >> $GITHUB_OUTPUT + echo "qi_qmp_current_artifact_name=$artifact_name" >> $GITHUB_ENV + echo "qt_${{ matrix.qt_linkage }}_artifact_name=$artifact_name" >> $GITHUB_OUTPUT - name: Upload QI-QMP build artifact uses: actions/upload-artifact@v3 with: - name: ${{ steps.get_artifact_name.outputs[env.artifact_output_var] }} + name: ${{ env.qi_qmp_current_artifact_name }} path: ${{ env.qi_qmp_install_path }} if-no-files-found: error diff --git a/.github/workflows/build-qi-qmp-windows.yml b/.github/workflows/build-qi-qmp-windows.yml index 93d4556..e6bae5e 100644 --- a/.github/workflows/build-qi-qmp-windows.yml +++ b/.github/workflows/build-qi-qmp-windows.yml @@ -2,11 +2,8 @@ name: Windows - Build QI-QMP on: workflow_call: secrets: - qt_shared_url: - description: 'MEGA Qt shared install archive URL' - required: true - qt_static_url: - description: 'MEGA Qt static install archive URL' + qt_ffynnon_cred: + description: 'Credentials for getting Qt from Ffynnon' required: true outputs: qt_shared_artifact_name: @@ -17,7 +14,6 @@ on: value: ${{ jobs.build-qi-qmp.outputs.qt_static_artifact_name }} env: qt_install_dir: ${{ github.workspace }}/Qt/Install - qt_download_dir: ${{ github.workspace }}/Qt/Download qi_qmp_src_suffix: QI-QMP/Source qi_qmp_src_dir: ${{ github.workspace }}/QI-QMP/Source qi_qmp_build_dir: ${{ github.workspace }}/QI-QMP/Build @@ -36,51 +32,21 @@ jobs: qt_shared_artifact_name: ${{ steps.get_artifact_name.outputs.qt_shared_artifact_name }} qt_static_artifact_name: ${{ steps.get_artifact_name.outputs.qt_static_artifact_name }} steps: - - name: Set matrix derived variables - uses: kanga333/variable-mapper@v0.3.0 - with: - key: ${{ matrix.qt_linkage }} - map: | - { - "shared": { - "qt_install_url": "${{ secrets.qt_shared_url }}", - "artifact_output_var": "qt_shared_artifact_name" - }, - "static": { - "qt_install_url": "${{ secrets.qt_static_url }}", - "artifact_output_var": "qt_static_artifact_name" - } - } - export_to: env,log - name: Set derived variables with shell because GitHub Actions env context sucks run: | echo "qi_qmp_package_path=${{ env.qi_qmp_build_dir }}/out/dist" >> $Env:GITHUB_ENV $qi_qmp_install_path="${{ env.qi_qmp_build_dir }}/out/install" echo "qi_qmp_install_path=$qi_qmp_install_path" >> $Env:GITHUB_ENV echo "qt_cmake=${Env:qt_install_dir}/bin/qt-cmake.bat" >> $Env:GITHUB_ENV - - name: Cache Qt Build - id: cache-qt - uses: actions/cache@v3 + - name: Install Qt (custom build) + uses: oblivioncth/actions/general/install-and-cache-qt-from-ffynnon@dev with: + version: 6.4.0 + os: win32 + compiler: msvc + linkage: ${{ matrix.qt_linkage }} path: ${{ env.qt_install_dir }} - key: ${{ env.qt_install_url }} - - name: Install megatools - if: steps.cache-qt.outputs.cache-hit != 'true' - run: choco install megatools - - name: Create Qt Download Directory - if: steps.cache-qt.outputs.cache-hit != 'true' - run: New-Item -Path "${{ env.qt_download_dir }}" -ItemType "directory" - - name: Download Qt Install - if: steps.cache-qt.outputs.cache-hit != 'true' - run: megatools dl "${Env:qt_install_url}" --path "${{ env.qt_download_dir }}" - - name: Determine Qt Install Package Name - if: steps.cache-qt.outputs.cache-hit != 'true' - run: | - $qt_install_name=(Get-ChildItem -Path "${{ env.qt_download_dir }}" -Name -Filter qt-*.7z) - echo "qt_install_dest=${{ env.qt_download_dir }}/${qt_install_name}" >> $Env:GITHUB_ENV - - name: Extract Qt Install - if: steps.cache-qt.outputs.cache-hit != 'true' - run: 7z x ${{ env.qt_install_dest }} -o${{ env.qt_install_dir }} + credentials: ${{ secrets.qt_ffynnon_cred }} - name: Install Doxygen & Graphviz run: | choco install doxygen.install --version 1.9.4 @@ -115,10 +81,13 @@ jobs: echo "Build complete." - name: Get QI-QMP artifact name id: get_artifact_name - run: echo "${{ env.artifact_output_var }}=$((Get-ChildItem -Path "${{ env.qi_qmp_package_path }}" -Filter *.zip)[0].BaseName)" >> $Env:GITHUB_OUTPUT + run: | + $artifact_name=$((Get-ChildItem -Path "${{ env.qi_qmp_package_path }}" -Filter *.zip)[0].BaseName) + echo "qi_qmp_current_artifact_name=$artifact_name" >> $Env:GITHUB_ENV + echo "qt_${{ matrix.qt_linkage }}_artifact_name=$artifact_name" >> $Env:GITHUB_OUTPUT - name: Upload QI-QMP build artifact uses: actions/upload-artifact@v3 with: - name: ${{ steps.get_artifact_name.outputs[env.artifact_output_var] }} + name: ${{ env.qi_qmp_current_artifact_name }} path: ${{ env.qi_qmp_install_path }} if-no-files-found: error diff --git a/.github/workflows/master-pull-request-merge-reaction.yml b/.github/workflows/master-pull-request-merge-reaction.yml index 5bd0a3a..41d37a4 100644 --- a/.github/workflows/master-pull-request-merge-reaction.yml +++ b/.github/workflows/master-pull-request-merge-reaction.yml @@ -66,8 +66,7 @@ jobs: if: github.event.pull_request.merged == true uses: ./.github/workflows/build-qi-qmp-windows.yml secrets: - qt_shared_url: ${{ secrets.QT_WINDOWS_SHARED_URL }} - qt_static_url: ${{ secrets.QT_WINDOWS_STATIC_URL }} + qt_ffynnon_cred: ${{ secrets.OBYBOT_FFYNNON_CREDS }} build_qi_qmp_release_linux: name: Build QI-QMP Release (Linux) @@ -75,8 +74,7 @@ jobs: if: github.event.pull_request.merged == true uses: ./.github/workflows/build-qi-qmp-linux.yml secrets: - qt_shared_url: ${{ secrets.QT_LINUX_SHARED_URL }} - qt_static_url: ${{ secrets.QT_LINUX_STATIC_URL }} + qt_ffynnon_cred: ${{ secrets.OBYBOT_FFYNNON_CREDS }} update-docs: name: Update gh-pages diff --git a/.github/workflows/push-reaction.yml b/.github/workflows/push-reaction.yml index d0e19ae..c69982b 100644 --- a/.github/workflows/push-reaction.yml +++ b/.github/workflows/push-reaction.yml @@ -10,12 +10,10 @@ jobs: name: Build QI-QMP (Windows) uses: ./.github/workflows/build-qi-qmp-windows.yml secrets: - qt_shared_url: ${{ secrets.QT_WINDOWS_SHARED_URL }} - qt_static_url: ${{ secrets.QT_WINDOWS_STATIC_URL }} + qt_ffynnon_cred: ${{ secrets.OBYBOT_FFYNNON_CREDS }} trigger-linux-build: - name: Build QI-QMP (Linux) - uses: ./.github/workflows/build-qi-qmp-linux.yml - secrets: - qt_shared_url: ${{ secrets.QT_LINUX_SHARED_URL }} - qt_static_url: ${{ secrets.QT_LINUX_STATIC_URL }} \ No newline at end of file + name: Build QI-QMP (Linux) + uses: ./.github/workflows/build-qi-qmp-linux.yml + secrets: + qt_ffynnon_cred: ${{ secrets.OBYBOT_FFYNNON_CREDS }} \ No newline at end of file From 95e3ca2eea6bd38132e4b15f9f4c9bc42bf0e99e Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Mon, 6 Feb 2023 09:50:50 -0500 Subject: [PATCH 11/16] Use proper find path for Linux artifact name --- .github/workflows/build-qi-qmp-linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-qi-qmp-linux.yml b/.github/workflows/build-qi-qmp-linux.yml index a3d1775..56a5d8a 100644 --- a/.github/workflows/build-qi-qmp-linux.yml +++ b/.github/workflows/build-qi-qmp-linux.yml @@ -91,7 +91,7 @@ jobs: - name: Get QI-QMP artifact name id: get_artifact_name run: | - cpack_name=$(find * -type f -name "*.zip") + cpack_name=$(find "${{ env.qi_qmp_package_path }}" -type f -name "*.zip") artifact_name=$(basename "$cpack_name" .zip) echo "qi_qmp_current_artifact_name=$artifact_name" >> $GITHUB_ENV echo "qt_${{ matrix.qt_linkage }}_artifact_name=$artifact_name" >> $GITHUB_OUTPUT From 0e74aecf7915774ac9505239aa7a5e76534f4c73 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Mon, 6 Feb 2023 11:09:07 -0500 Subject: [PATCH 12/16] Update to latest Qx and OBCMake --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 952cbcd..34a327c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,7 +36,7 @@ list(APPEND CMAKE_MODULE_PATH "${PROJ_SCRIPTS_PATH}/module") # Get helper scripts include(QI-QMP/FetchOBCMake) -fetch_ob_cmake("v0.1") +fetch_ob_cmake("100e0e42f85024f051eebbe800af9b1e213180d3") # Include utility functions include(OB/Utility) @@ -112,7 +112,11 @@ find_qt6_package(REQUIRED COMPONENTS ${QT_FIND_COMPONENTS}) # Fetch Qx (build and import from source) include(OB/FetchQx) -fetch_qx("v0.4") +fetch_qx( + REF "v0.4.2" + COMPONENTS + Core +) # Set lib sources set(INCLUDE_HEADERS From 5effea8dfd1f32ce5ac5d434c986c7c340366162 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Tue, 7 Feb 2023 03:21:58 -0500 Subject: [PATCH 13/16] Update OBCMake --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 34a327c..c9b29a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,7 +36,7 @@ list(APPEND CMAKE_MODULE_PATH "${PROJ_SCRIPTS_PATH}/module") # Get helper scripts include(QI-QMP/FetchOBCMake) -fetch_ob_cmake("100e0e42f85024f051eebbe800af9b1e213180d3") +fetch_ob_cmake("v0.2") # Include utility functions include(OB/Utility) From b4bc2e67c529daa2816d91f54d4cee4647b0ac29 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Tue, 7 Feb 2023 03:23:21 -0500 Subject: [PATCH 14/16] Replace instances of 'throw' with more informative qFatal --- src/qmpi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qmpi.cpp b/src/qmpi.cpp index 76de009..57d9224 100644 --- a/src/qmpi.cpp +++ b/src/qmpi.cpp @@ -567,7 +567,7 @@ void Qmpi::connectToHost() else if(std::holds_alternative(mHostId)) mSocket.connectToHost(std::get(mHostId), mPort); else - throw std::runtime_error(std::string(Q_FUNC_INFO) + " unhandled host id variant"); + qFatal("Unhandled host id variant"); } /*! From 13fc932dd2e4863ca5ac0d70cbe29072b8a6c8e4 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Tue, 7 Feb 2023 03:23:44 -0500 Subject: [PATCH 15/16] Bump for v0.1.4 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c9b29a6..af32f44 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ option(QI_QMP_DOCS_TARGET "Build QI-QMP documentation" OFF) # Project # NOTE: DON'T USE TRAILING ZEROS IN VERSIONS project(QI-QMP - VERSION 0.1.3 + VERSION 0.1.4 LANGUAGES CXX DESCRIPTION "Qt-based Interface for QEMU Machine Protocol" ) From ce5fa9465678e3c42b92c60d350b89fb02182b79 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Tue, 7 Feb 2023 03:24:15 -0500 Subject: [PATCH 16/16] Update Qx --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index af32f44..7511ce8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -113,7 +113,7 @@ find_qt6_package(REQUIRED COMPONENTS ${QT_FIND_COMPONENTS}) # Fetch Qx (build and import from source) include(OB/FetchQx) fetch_qx( - REF "v0.4.2" + REF "v0.4.3" COMPONENTS Core )