|
| 1 | +# Author: Kang Lin<kl222@126.com> |
| 2 | + |
| 3 | +name: vcpkg |
| 4 | + |
| 5 | +on: |
| 6 | + push: |
| 7 | + pull_request: |
| 8 | + |
| 9 | +jobs: |
| 10 | + vcpkg: |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + os: windows-2022 |
| 14 | + |
| 15 | + env: |
| 16 | + VCPKGGITCOMMITID: de46587b4beaa638743916fe5674825cecfb48b3 |
| 17 | + RabbitRemoteControl_VERSION: v0.0.36 |
| 18 | + BUILD_DIR: ${{github.workspace}}\build |
| 19 | + SOURCE_DIR: ${{github.workspace}}\.cache\source |
| 20 | + TOOLS_DIR: ${{github.workspace}}\.cache\tools |
| 21 | + INSTALL_DIR: ${{github.workspace}}\.cache\install |
| 22 | + VCPKG_MANIFEST_FEATURES: "freerdp;vnc;terminal;filetransfer;qt" |
| 23 | + |
| 24 | + runs-on: ${{matrix.os}} |
| 25 | + steps: |
| 26 | + - name: Checkout Repository |
| 27 | + uses: actions/checkout@v3 |
| 28 | + with: |
| 29 | + submodules: true |
| 30 | + fetch-depth: 0 |
| 31 | + |
| 32 | + - name: Make directories |
| 33 | + run: | |
| 34 | + cmake -E make_directory ${{env.BUILD_DIR}} |
| 35 | + cmake -E make_directory ${{env.SOURCE_DIR}} |
| 36 | + cmake -E make_directory ${{env.TOOLS_DIR}} |
| 37 | + cmake -E make_directory ${{env.INSTALL_DIR}} |
| 38 | +
|
| 39 | + - name: run-vcpkg |
| 40 | + uses: lukka/run-vcpkg@v11 |
| 41 | + with: |
| 42 | + vcpkgGitCommitId: ${{env.VCPKGGITCOMMITID}} |
| 43 | + vcpkgDirectory: ${{env.SOURCE_DIR}}/vcpkg |
| 44 | + |
| 45 | + - name: RabbitCommon |
| 46 | + working-directory: ${{env.SOURCE_DIR}} |
| 47 | + run: git clone https://github.com/KangLin/RabbitCommon.git |
| 48 | + |
| 49 | + - name: Build RabbitRemoteControl |
| 50 | + working-directory: ${{env.BUILD_DIR}} |
| 51 | + env: |
| 52 | + RabbitCommon_ROOT: ${{env.SOURCE_DIR}}/RabbitCommon |
| 53 | + run: | |
| 54 | + cmake ${{github.workspace}} ^ |
| 55 | + -A ${{matrix.CMAKE_GENERATOR_PLATFORM}} ^ |
| 56 | + -T ${{matrix.VCPKG_PLATFORM_TOOLSET}} ^ |
| 57 | + -DCMARK_SHARED=OFF ^ |
| 58 | + -DCMARK_TESTS=OFF ^ |
| 59 | + -DCMARK_STATIC=ON ^ |
| 60 | + -DWITH_CMARK=OFF ^ |
| 61 | + -DWITH_CMARK_GFM=ON ^ |
| 62 | + -DWITH_WebEngineWidgets=ON ^ |
| 63 | + -DRABBIT_ENABLE_INSTALL_DEPENDENT=ON ^ |
| 64 | + -DRABBIT_ENABLE_INSTALL_QT=ON ^ |
| 65 | + -DRABBIT_ENABLE_INSTALL_TO_BUILD_PATH=ON ^ |
| 66 | + -DCMAKE_BUILD_TYPE=Release ^ |
| 67 | + -DCMAKE_INSTALL_PREFIX=${{env.BUILD_DIR}}/install ^ |
| 68 | + -DCMAKE_PREFIX_PATH=${{env.INSTALL_DIR}} ^ |
| 69 | + -DCMAKE_TOOLCHAIN_FILE=${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake ^ |
| 70 | + -DVCPKG_VERBOSE=ON ^ |
| 71 | + -DVCPKG_TARGET_TRIPLET=${{matrix.VCPKG_TARGET_TRIPLET}} ^ |
| 72 | + -DX_VCPKG_APPLOCAL_DEPS_INSTALL=ON ^ |
| 73 | + -DVCPKG_APPLOCAL_DEPS=ON ^ |
| 74 | + -DVCPKG_TRACE_FIND_PACKAGE=ON ^ |
| 75 | + -DBUILD_QUIWidget=OFF ^ |
| 76 | + -DBUILD_APP=ON ^ |
| 77 | + -DBUILD_FREERDP=ON ^ |
| 78 | + -DPCAP_ROOT=${{env.INSTALL_DIR}}/npcap ^ |
| 79 | + -DPacket_ROOT=${{env.INSTALL_DIR}}/npcap ^ |
| 80 | + -DINSTALL_QTKEYCHAIN=ON |
| 81 | + cmake --build . --config Release |
| 82 | + IF "Release" == "Release" ( |
| 83 | + echo "cmake install config: Release component: Runtime" |
| 84 | + cmake --install . --config Release --component Runtime --strip |
| 85 | + echo "cmake install config: Release component: Plugin" |
| 86 | + cmake --install . --config Release --component Plugin --strip |
| 87 | + echo "cmake install config: Release component: DependLibraries" |
| 88 | + cmake --install . --config Release --component DependLibraries --strip |
| 89 | + echo "cmake install config: Release component: Application" |
| 90 | + cmake --install . --config Release --component Application --strip |
| 91 | + ) else ( |
| 92 | + echo "cmake install config: Release component: Runtime Application Plugin" |
| 93 | + cmake --install . --config Release --component Runtime |
| 94 | + cmake --install . --config Release --component Plugin |
| 95 | + cmake --install . --config Release --component DependLibraries |
| 96 | + cmake --install . --config Release --component Application |
| 97 | + ) |
| 98 | + |
0 commit comments