From 5e2d355a3aa3c2847dcdd0b48b19e59bfd63fae8 Mon Sep 17 00:00:00 2001 From: Kyle Bloom Date: Thu, 21 Oct 2021 08:25:57 +0100 Subject: [PATCH] SYNERGY-1254 Fix core builds (#7103) * SYNERGY-1254 Fix core builds * Changelog * Uncomment debian9 * Fix artifact name * Fix workflow name * Remove -j1 flag * Turn off pull_request operations * Add qt for ubuntu core builds * Switch to python3-yaml * Update ubuntu * Cmake automatically manages include_directories * Remove older fedora versions * Add DBus to platform to ensure dependancy * Change to synergy-vcpkg * build macos * Remove pull_request * Add centos 8 * Change container * Test core builds * Remove setup * Remove VCPKG_INSTALLATION_ROOT * change checkout to use submodules * Setup newer version of git for ubuntu * Remove git requirement * Remove pull_request event --- .github/workflows/aws-upload-linux-centos.yml | 29 ++++++++++++--- .github/workflows/aws-upload-linux-debian.yml | 28 ++++++++++---- .github/workflows/aws-upload-linux-fedora.yml | 29 ++++++++++----- .github/workflows/aws-upload-linux-ubuntu.yml | 37 +++++++++++++------ .github/workflows/aws-upload-mac.yml | 11 +++++- .github/workflows/aws-upload-raspberry.yml | 12 +++++- .github/workflows/aws-upload-windows.yml | 11 +++++- ChangeLog | 1 + src/lib/arch/CMakeLists.txt | 1 - src/lib/platform/CMakeLists.txt | 5 +++ 10 files changed, 127 insertions(+), 37 deletions(-) diff --git a/.github/workflows/aws-upload-linux-centos.yml b/.github/workflows/aws-upload-linux-centos.yml index 3cf9201a13..565d9a5a37 100644 --- a/.github/workflows/aws-upload-linux-centos.yml +++ b/.github/workflows/aws-upload-linux-centos.yml @@ -2,22 +2,27 @@ name: CentOS - Core on: release: - types: [created] + types: [published] + # pull_request: jobs: build-core-centos: runs-on: ubuntu-latest - container: symless/synergy-core:${{ matrix.distro }} + container: symless/synergy-vcpkg:${{ matrix.distro }} env: GIT_COMMIT: ${{ github.sha }} SYNERGY_NO_LEGACY: "1" SYNERGY_NO_TESTS: "1" SYNERGY_STATIC_OPENSSL: "1" + VCPKG_LIBRARY_LINKAGE: "static" + defaults: + run: + shell: bash strategy: matrix: - include: - - distro: centos7.6 - - distro: centos8 + distro: + # - centos7.6 + - centos8 name: ${{ matrix.distro }} @@ -28,14 +33,26 @@ jobs: run: | mkdir build cd build - cmake3 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=$(pwd)/rpm/BUILDROOT/usr .. + cmake3 \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX:PATH=$(pwd)/rpm/BUILDROOT/usr \ + -DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake \ + .. . ./version make -j - uses: shallwefootball/s3-upload-action@master + if: "github.event_name == 'release'" with: aws_key_id: ${{ secrets.AWS_S3_UPLOAD_KEY_ID }} aws_secret_access_key: ${{ secrets.AWS_S3_UPLOAD_SECRET }} aws_bucket: ${{ secrets.AWS_BUCKET }} source_dir: ./build/bin destination_dir: "./synergy3/latest/${{matrix.distro}}/" + + - uses: actions/upload-artifact@v2 + if: "github.event_name == 'pull_request'" + with: + name: ${{ matrix.distro }} + path: build/bin/* + retention-days: 1 diff --git a/.github/workflows/aws-upload-linux-debian.yml b/.github/workflows/aws-upload-linux-debian.yml index e4cbc7abcb..91d8d5ae55 100644 --- a/.github/workflows/aws-upload-linux-debian.yml +++ b/.github/workflows/aws-upload-linux-debian.yml @@ -1,23 +1,26 @@ -name: Debian- Core +name: Debian - Core on: release: - types: [created] + types: [published] + # pull_request: jobs: build-core-debian: runs-on: ubuntu-latest - container: symless/synergy-core:${{ matrix.distro }} + container: symless/synergy-vcpkg:${{ matrix.distro }} env: GIT_COMMIT: ${{ github.sha }} SYNERGY_NO_LEGACY: "1" SYNERGY_NO_TESTS: "1" SYNERGY_STATIC_OPENSSL: "1" + VCPKG_LIBRARY_LINKAGE: "static" strategy: matrix: - include: - - distro: debian9 - - distro: debian10 + distro: + - debian9 + - debian10 + - debian11 name: ${{ matrix.distro }} @@ -28,14 +31,25 @@ jobs: run: | mkdir build cd build - cmake -DCMAKE_BUILD_TYPE=Release .. + cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake \ + .. . ./version make -j - uses: shallwefootball/s3-upload-action@master + if: "github.event_name == 'release'" with: aws_key_id: ${{ secrets.AWS_S3_UPLOAD_KEY_ID }} aws_secret_access_key: ${{ secrets.AWS_S3_UPLOAD_SECRET }} aws_bucket: ${{ secrets.AWS_BUCKET }} source_dir: ./build/bin destination_dir: "./synergy3/latest/${{matrix.distro}}/" + + - uses: actions/upload-artifact@v2 + if: "github.event_name == 'pull_request'" + with: + name: ${{ matrix.distro }} + path: build/bin/* + retention-days: 1 diff --git a/.github/workflows/aws-upload-linux-fedora.yml b/.github/workflows/aws-upload-linux-fedora.yml index 38b1fa0f00..c851dcd5f3 100644 --- a/.github/workflows/aws-upload-linux-fedora.yml +++ b/.github/workflows/aws-upload-linux-fedora.yml @@ -2,25 +2,24 @@ name: Fedora - Core on: release: - types: [created] + types: [published] + # pull_request: jobs: build-core-fedora: runs-on: ubuntu-latest - container: symless/synergy-core:${{ matrix.distro }} + container: symless/synergy-vcpkg:${{ matrix.distro }} env: GIT_COMMIT: ${{ github.sha }} SYNERGY_NO_LEGACY: "1" SYNERGY_NO_TESTS: "1" SYNERGY_STATIC_OPENSSL: "1" + VCPKG_LIBRARY_LINKAGE: "static" strategy: matrix: - include: - # - distro: fedora28 #Need to install git 2.18+ - - distro: fedora29 - - distro: fedora30 - - distro: fedora33 - - distro: fedora34 + distro: + - fedora33 + - fedora34 name: ${{ matrix.distro }} @@ -31,14 +30,26 @@ jobs: run: | mkdir build cd build - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=$(pwd)/rpm/BUILDROOT/usr .. + cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX:PATH=$(pwd)/rpm/BUILDROOT/usr \ + -DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake \ + .. . ./version make -j - uses: shallwefootball/s3-upload-action@master + if: "github.event_name == 'release'" with: aws_key_id: ${{ secrets.AWS_S3_UPLOAD_KEY_ID }} aws_secret_access_key: ${{ secrets.AWS_S3_UPLOAD_SECRET }} aws_bucket: ${{ secrets.AWS_BUCKET }} source_dir: ./build/bin destination_dir: "./synergy3/latest/${{matrix.distro}}/" + + - uses: actions/upload-artifact@v2 + if: "github.event_name == 'pull_request'" + with: + name: ${{ matrix.distro }} + path: build/bin/* + retention-days: 1 diff --git a/.github/workflows/aws-upload-linux-ubuntu.yml b/.github/workflows/aws-upload-linux-ubuntu.yml index 838e3b1def..3e4f0e37c0 100644 --- a/.github/workflows/aws-upload-linux-ubuntu.yml +++ b/.github/workflows/aws-upload-linux-ubuntu.yml @@ -2,42 +2,57 @@ name: Ubuntu - Core on: release: - types: [created] + types: [published] + # pull_request: jobs: build-core-ubuntu: runs-on: ubuntu-latest - container: symless/synergy-core:ubuntu${{ matrix.distro }} + container: symless/synergy-vcpkg:${{ matrix.distro }} env: GIT_COMMIT: ${{ github.sha }} SYNERGY_NO_LEGACY: "1" SYNERGY_NO_TESTS: "1" SYNERGY_STATIC_OPENSSL: "1" + VCPKG_LIBRARY_LINKAGE: "static" strategy: matrix: - distro: ["20.04", "21.04", "18.04"] - flag: ["-j"] - include: - - distro: "16.04" - flag: "-j1" + distro: + - ubuntu18.04 + - ubuntu20.04 + - ubuntu21.04 - name: ubuntu${{ matrix.distro }} + name: ${{ matrix.distro }} steps: - uses: actions/checkout@v2 + with: + submodules: recursive - name: Build run: | + git submodule mkdir build cd build - cmake -DCMAKE_BUILD_TYPE=Release .. + cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake \ + .. . ./version - make ${{ matrix.flag }} + make -j - uses: shallwefootball/s3-upload-action@master + if: "github.event_name == 'release'" with: aws_key_id: ${{ secrets.AWS_S3_UPLOAD_KEY_ID }} aws_secret_access_key: ${{ secrets.AWS_S3_UPLOAD_SECRET }} aws_bucket: ${{ secrets.AWS_BUCKET }} source_dir: ./build/bin - destination_dir: "./synergy3/latest/Ubuntu_${{matrix.distro}}/" + destination_dir: "./synergy3/latest/${{matrix.distro}}/" + + - uses: actions/upload-artifact@v2 + if: "github.event_name == 'pull_request'" + with: + name: ${{ matrix.distro }} + path: build/bin/* + retention-days: 1 diff --git a/.github/workflows/aws-upload-mac.yml b/.github/workflows/aws-upload-mac.yml index 2e2533a6bc..d5fa86998d 100644 --- a/.github/workflows/aws-upload-mac.yml +++ b/.github/workflows/aws-upload-mac.yml @@ -2,7 +2,8 @@ name: macOS - Core on: release: - types: [created] + types: [published] + # pull_request: jobs: build-core-macos: @@ -50,9 +51,17 @@ jobs: make -j - uses: shallwefootball/s3-upload-action@master + if: "github.event_name == 'release'" with: aws_key_id: ${{ secrets.AWS_S3_UPLOAD_KEY_ID }} aws_secret_access_key: ${{ secrets.AWS_S3_UPLOAD_SECRET }} aws_bucket: ${{ secrets.AWS_BUCKET }} source_dir: ./build/bin destination_dir: "./synergy3/latest/${{ matrix.destination }}/" + + - uses: actions/upload-artifact@v2 + if: "github.event_name == 'pull_request'" + with: + name: ${{ matrix.destination }} + path: build/bin/* + retention-days: 1 diff --git a/.github/workflows/aws-upload-raspberry.yml b/.github/workflows/aws-upload-raspberry.yml index 10e492dc02..da82bb8d00 100644 --- a/.github/workflows/aws-upload-raspberry.yml +++ b/.github/workflows/aws-upload-raspberry.yml @@ -2,7 +2,9 @@ name: Raspberry Pi - Core on: release: - types: [created] + types: [published] + # pull_request: + jobs: build-core-pi: runs-on: ${{ matrix.os }} @@ -29,9 +31,17 @@ jobs: make - uses: shallwefootball/s3-upload-action@master + if: "github.event_name == 'release'" with: aws_key_id: ${{ secrets.AWS_S3_UPLOAD_KEY_ID }} aws_secret_access_key: ${{ secrets.AWS_S3_UPLOAD_SECRET }} aws_bucket: ${{ secrets.AWS_BUCKET }} source_dir: ./build/bin destination_dir: "./synergy3/latest/${{ matrix.destination }}" + + - uses: actions/upload-artifact@v2 + if: "github.event_name == 'pull_request'" + with: + name: ${{ matrix.destination }} + path: build/bin/* + retention-days: 1 diff --git a/.github/workflows/aws-upload-windows.yml b/.github/workflows/aws-upload-windows.yml index e9895ec2c1..ed74ac12aa 100644 --- a/.github/workflows/aws-upload-windows.yml +++ b/.github/workflows/aws-upload-windows.yml @@ -2,7 +2,8 @@ name: Windows - Core on: release: - types: [created] + types: [published] + # pull_request: jobs: build-core-windows: @@ -52,9 +53,17 @@ jobs: msbuild synergy-core.sln /p:Configuration=Release - uses: anshulrgoyal/upload-s3-action@master + if: "github.event_name == 'release'" with: aws_key_id: ${{ secrets.AWS_S3_UPLOAD_KEY_ID }} aws_secret_access_key: ${{ secrets.AWS_S3_UPLOAD_SECRET }} aws_bucket: ${{ secrets.AWS_BUCKET }} source_dir: ./build/bin/Release destination_dir: "./synergy3/latest/Windows_x64/" + + - uses: actions/upload-artifact@v2 + if: "github.event_name == 'pull_request'" + with: + name: windows + path: build/bin/Release/* + retention-days: 1 diff --git a/ChangeLog b/ChangeLog index 1b39fcc5c5..459b6d5fbb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,6 +26,7 @@ Enhancements: Github Actions: - #1043 Adding upload to s3 feature on all OSes - #7098 Add Apple M1 runner +- #7103 Fix core builds - #7109 Fix build version for M1 builds =========== diff --git a/src/lib/arch/CMakeLists.txt b/src/lib/arch/CMakeLists.txt index 2aa4cf65e8..59ec1ff544 100644 --- a/src/lib/arch/CMakeLists.txt +++ b/src/lib/arch/CMakeLists.txt @@ -44,7 +44,6 @@ if (UNIX) if (NOT APPLE) find_package (Qt5 COMPONENTS DBus) - include_directories(${Qt5DBus_INCLUDE_DIRS}) target_link_libraries (arch Qt5::DBus) endif() endif() diff --git a/src/lib/platform/CMakeLists.txt b/src/lib/platform/CMakeLists.txt index af36c55f21..f01c32dcec 100644 --- a/src/lib/platform/CMakeLists.txt +++ b/src/lib/platform/CMakeLists.txt @@ -41,6 +41,11 @@ target_link_libraries(platform client ${libs}) if (UNIX) target_link_libraries(platform io net ipc synlib client ${libs}) + + if (NOT APPLE) + find_package (Qt5 COMPONENTS DBus) + target_link_libraries (platform Qt5::DBus) + endif() endif() if (APPLE)