From 92a4ddedce35c85cd99a7ee91dc891227b963829 Mon Sep 17 00:00:00 2001 From: Blessio <24902257+blessio@users.noreply.github.com> Date: Tue, 15 Oct 2024 17:08:01 +0200 Subject: [PATCH 1/4] Windows and Ubuntu Build and Test --- .github/workflows/bld-test-upload.yml | 197 ++++++++++++++++++++++++++ 1 file changed, 197 insertions(+) create mode 100644 .github/workflows/bld-test-upload.yml diff --git a/.github/workflows/bld-test-upload.yml b/.github/workflows/bld-test-upload.yml new file mode 100644 index 0000000000..675c5f8d92 --- /dev/null +++ b/.github/workflows/bld-test-upload.yml @@ -0,0 +1,197 @@ +# Used the starter here: +# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml +# BUILDS KeepasXC +name: BLD AND TEST MatrixBased-WIN64-UBUNTU-NotyetMacOS + +on: + push: + branches: [ "develop", "devbleo2", bleo8, bleo5_01 ] + pull_request: + branches: [ "devbleo" , bleo5_01 ] + +jobs: + build: + + #needs: [winprep] + runs-on: ${{ matrix.config.os }} + strategy: + # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. + fail-fast: false + matrix: + build_type: [RelWithDebInfo,Debug] #Release with no debug info is useless I believe + config: + - os: windows-2022 # , ubuntu-latest] #[windows-latest] # [ubuntu-latest, windows-latest] + vcpkg_triplet: x64-windows + github-binarycache: true + - os: ubuntu-22.04 # , ubuntu-latest] #[windows-latest] # [ubuntu-latest, windows-latest] + vcpkg_triplet: x64-linux + github-binarycache: true + + steps: + + + - name: Generate UUID + id: generate-uuid + uses: filipstefansson/uuid-action@v1 + + - name: Set reusable strings and Environment for actions + # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. + id: strings + shell: bash + run: | + echo "build-sub-dir=build" >> "$GITHUB_OUTPUT" + echo "build-root-vcpkg-dir=_vpkg" >> "$GITHUB_OUTPUT" + echo "build-winsdk=10.0.26100" >> "$GITHUB_OUTPUT" + echo "FORCE_JAVASCRIPT_ACTIONS_TO_NODE20=true" >> "$GITHUB_OUTPUT" + echo "bld-var-str=${{ matrix.build_type }}-BLD_ON_${{ matrix.config.os }}_${{ matrix.config.vcpkg_triplet }}_${{ steps.generate-uuid.outputs.uuid }}" >> "$GITHUB_OUTPUT" + echo "TRIPLET IS ${{ matrix.config.vcpkg_triplet }}" + echo "Running on ${{ matrix.config.os }}" + + - name: Windows Only // Install Winget so that e can use it to install SDK as needed + if: ${{ startsWith( matrix.config.os , 'windows' ) }} + uses: Cyberboss/install-winget@v1 + + - name: Windows Only // Set Up windows SDK and Ruby and the needed gem of asciidoctor + if: ${{ startsWith( matrix.config.os , 'windows' ) }} + run: | + winget install --source winget --exact --id Microsoft.WindowsSDK.${{ steps.strings.outputs.build-winsdk }} --silent + winget install RubyInstallerTeam.Ruby.3.2 --accept-package-agreements --accept-source-agreements + gem install asciidoctor + + - name: Windows Only // Set environment variable VCPKG_ROOT + if: ${{ startsWith( matrix.config.os , 'windows' ) }} + run: | + $env:VCPKG_ROOT = "$env:VCPKG_INSTALLATION_ROOT" + echo "VCPKG_ROOT=$env:VCPKG_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + + - name: LINUX Only // Prepare Linux packages that are needed + if: ${{ startsWith( matrix.config.os , 'ubuntu' ) }} + run: > + sudo apt update -y && + sudo apt upgrade -y && + sudo apt install -y build-essential cmake g++ asciidoctor && + sudo apt install -y qtbase5-dev qtbase5-private-dev qttools5-dev qttools5-dev-tools + libqt5svg5-dev libargon2-dev libminizip-dev libbotan-2-dev libqrencode-dev + libkeyutils-dev zlib1g-dev libreadline-dev libpcsclite-dev libusb-1.0-0-dev + libxi-dev libxtst-dev libqt5x11extras5-dev + + - name: get from Git + uses: actions/checkout@v4 + + - name: Windows Only // VCPKG build + id: vcpkg + if: ${{ startsWith( matrix.config.os , 'windows' ) }} + uses: blessio/vcpkg-actionB@vbleo7.0 + with: + manifest-dir: ${{ github.workspace }} # Set to directory containing vcpkg.json + triplet: ${{ matrix.config.vcpkg_triplet }} # x64-windows-release + token: ${{ github.token }} + github-binarycache: true + vcpkg-subdir: ${{ steps.strings.outputs.build-root-vcpkg-dir}} + cache-key: "kpxco5-${{ matrix.config.vcpkg_triplet }}" + fetch-depth: "0" + + - name: Print intermediate environment results + shell: bash + run: | + echo " *** RECOMENDED CMAKE CONFIG is ${{ steps.vcpkg.outputs.vcpkg-cmake-config }}" + echo " *** HASH IS ${{ steps.vcpkg.outputs.vcpkg-cache-hash }}" + + - name: Windows ONLY // Configure CMake + if: ${{ startsWith( matrix.config.os , 'windows' ) }} + run: > + mkdir ${{ steps.strings.outputs.build-sub-dir }} && + cd ${{ steps.strings.outputs.build-sub-dir }} && + cmake -DWITH_XC_ALL=ON + -DCMAKE_SYSTEM_VERSION=${{ steps.strings.outputs.build-winsdk }} + -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}\${{ steps.strings.outputs.build-root-vcpkg-dir}}\scripts\buildsystems\vcpkg.cmake + -DWITH_GUI_TESTS=ON + .. + + - name: LINUX ONLY // Configure CMake + if: ${{ startsWith( matrix.config.os , 'ubuntu' ) }} + run: > + mkdir ${{ steps.strings.outputs.build-sub-dir }} && + cd ${{ steps.strings.outputs.build-sub-dir }} && + cmake -DWITH_XC_ALL=ON + -DWITH_GUI_TESTS=ON + .. + + - name: Windows Check DiskSpace + if: ${{ startsWith( matrix.config.os , 'windows' ) }} + run: > + Get-PSDrive -PSProvider FileSystem | Select-Object Name, @{Name="Used (GB)";Expression={[math]::round($_.Used/1GB,2)}}, + @{Name="Free (GB)";Expression={[math]::round($_.Free/1GB,2)}} + + #- name: Print all environement Variables + # run: > + # Get-ChildItem Env: | Sort-Object Name + + - name: Build + # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). + working-directory: ${{ github.workspace }}/${{ steps.strings.outputs.build-sub-dir }} + run: | + cmake --build . --config ${{ matrix.build_type }} + + # Prep for the tests + - name: Windows Only // ADD paths to some specual DLLs needed for the testing + if: ${{ startsWith( matrix.config.os , 'windows' ) }} + run: | + $env:PATH="$env:PATH;${{ github.workspace }}\${{ steps.strings.outputs.build-sub-dir }}\src\autotype\test\${{ matrix.build_type }}" + echo "PATH=$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + - name: Linux // ADD paths to some specual DLLs needed for the testing + if: ${{ startsWith( matrix.config.os , 'ubuntu' ) }} + run: | + echo "export PATH=$PATH:${{ github.workspace }}/${{ steps.strings.outputs.build-sub-dir }}/src/autotype/test/${{ matrix.build_type }}" >> ~/.bashrc + source ~/.bashrc + + - name: PRINT Environment Variable + if: ${{ startsWith( matrix.config.os , 'windows' ) }} + run: | + Get-ChildItem Env: | Sort-Object Name + cd "${{ github.workspace }}\${{ steps.strings.outputs.build-sub-dir }}\src\autotype\test\${{ matrix.build_type }}" + ls + + - name: Test and Install + working-directory: ${{ github.workspace }}/${{ steps.strings.outputs.build-sub-dir }} + # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + shell: bash + continue-on-error: true + run: | + ctest --build-config ${{ matrix.build_type }} + ctest --build-config ${{ matrix.build_type }} --rerun-failed --output-on-failure + + - name: Install + working-directory: ${{ github.workspace }}/${{ steps.strings.outputs.build-sub-dir }} + # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + shell: bash + continue-on-error: true + run: > + cmake --install ${{ github.workspace }}/${{ steps.strings.outputs.build-sub-dir }} + --config ${{ matrix.build_type }} --prefix ${{ github.workspace }}/${{ steps.strings.outputs.build-sub-dir }}/_install -v + + - name: WINDOWS ONLY // Upload build Executables + if: ${{ startsWith( matrix.config.os , 'windows' ) }} + uses: actions/upload-artifact@v3 + with: + name: build-win-executables- ${{ steps.strings.outputs.bld-var-str }} + path: | + ${{ github.workspace }}/${{ steps.strings.outputs.build-sub-dir }}/src/${{ matrix.build_type }} + + - name: NON-WINDOWS // Upload build Executables + if: ${{ ! startsWith( matrix.config.os , 'windows' ) }} + uses: actions/upload-artifact@v3 + with: + name: build-non-win-executables- ${{ steps.strings.outputs.bld-var-str }} + path: | + ${{ github.workspace }}/${{ steps.strings.outputs.build-sub-dir }}/_install + + + - name: Upload build Test Result Logs + uses: actions/upload-artifact@v3 + with: + name: Test-Logs ${{ steps.strings.outputs.bld-var-str }} + path: | + ${{ github.workspace }}/${{ steps.strings.outputs.build-sub-dir }}/Testing/Temporary From 79625c70f203363d18cfa34ca7fde030a1e62d3a Mon Sep 17 00:00:00 2001 From: Blessio <24902257+blessio@users.noreply.github.com> Date: Tue, 15 Oct 2024 19:43:54 +0200 Subject: [PATCH 2/4] Build merged branch 5_01.1 --- .github/workflows/bld-test-upload.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bld-test-upload.yml b/.github/workflows/bld-test-upload.yml index 675c5f8d92..f210e66d07 100644 --- a/.github/workflows/bld-test-upload.yml +++ b/.github/workflows/bld-test-upload.yml @@ -5,7 +5,7 @@ name: BLD AND TEST MatrixBased-WIN64-UBUNTU-NotyetMacOS on: push: - branches: [ "develop", "devbleo2", bleo8, bleo5_01 ] + branches: [ "develop", "devbleo2", bleo8, bleo5_01, bleo5_01.1 ] pull_request: branches: [ "devbleo" , bleo5_01 ] From f07db033c6d5a4f2d21476850d7a66abd6a96fc1 Mon Sep 17 00:00:00 2001 From: vallode <18506096+vallode@users.noreply.github.com> Date: Thu, 17 Oct 2024 09:37:38 +0200 Subject: [PATCH 3/4] Fix MacOS login items showing ambigious name (#11373) --- src/gui/osutils/macutils/MacUtils.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/osutils/macutils/MacUtils.cpp b/src/gui/osutils/macutils/MacUtils.cpp index 107cd3a292..15f55d94c7 100644 --- a/src/gui/osutils/macutils/MacUtils.cpp +++ b/src/gui/osutils/macutils/MacUtils.cpp @@ -130,6 +130,8 @@ void MacUtils::setLaunchAtStartup(bool enable) if (enable) { QSettings agent(getLaunchAgentFilename(), QSettings::NativeFormat); agent.setValue("Label", qApp->property("KPXC_QUALIFIED_APPNAME").toString()); + agent.setValue("AssociatedBundleIdentifiers", qApp->property("KPXC_QUALIFIED_APPNAME").toString()); + agent.setValue("Program", QApplication::applicationFilePath()); agent.setValue("ProgramArguments", QStringList() << QApplication::applicationFilePath()); agent.setValue("RunAtLoad", true); agent.setValue("StandardErrorPath", "/dev/null"); From b53c0dd7bc8b5445a1c1c88971f595a5cc7fb745 Mon Sep 17 00:00:00 2001 From: Blessio <24902257+blessio@users.noreply.github.com> Date: Thu, 17 Oct 2024 20:51:24 +0200 Subject: [PATCH 4/4] Update bld-test-upload.yml --- .github/workflows/bld-test-upload.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/bld-test-upload.yml b/.github/workflows/bld-test-upload.yml index f210e66d07..647e484af6 100644 --- a/.github/workflows/bld-test-upload.yml +++ b/.github/workflows/bld-test-upload.yml @@ -1,3 +1,7 @@ +# File: .github/workflows/bld-test-upload.yml +# Copyright: 2024, Owner of blessio.com +# License: MIT +############################################ # Used the starter here: # See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml # BUILDS KeepasXC