From 15e7b93393e8df6e091ee2a8fc8306d400efe464 Mon Sep 17 00:00:00 2001 From: Jakub Melka Date: Mon, 11 Dec 2023 20:03:08 +0100 Subject: [PATCH] CI: Finish work --- .github/workflows/ci.yml | 67 +++++++++++++++++++++++++++++++++++- .github/workflows/ci_win.yml | 66 ----------------------------------- 2 files changed, 66 insertions(+), 67 deletions(-) delete mode 100644 .github/workflows/ci_win.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 205be7d..ad44fd1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,10 @@ name: CI on: + push: + branches: + - master + workflow_dispatch: jobs: @@ -64,4 +68,65 @@ jobs: with: name: ubuntu-deb-package path: ./pdf4qt/build/*.deb - retention-days: 30 \ No newline at end of file + retention-days: 30 + + build_windows: + runs-on: windows-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + path: pdf4qt + + - name: 'VCPKG: Set up VCPKG' + run: | + git clone --depth=1 https://github.com/microsoft/vcpkg.git + cd vcpkg + .\bootstrap-vcpkg.bat -disableMetrics + .\vcpkg integrate install + set VCPKG_ROOT=${env:GITHUB_WORKSPACE}\vcpkg\ + set "VCPKG_BINARY_SOURCES=clear;files,${env:GITHUB_WORKSPACE}\vcpkg\archives,readwrite" + + - name: 'VCPKG: Cache vcpkg dependencies' + uses: actions/cache@v3 + with: + path: | + ./vcpkg/downloads + ./vcpkg/packages + ./vcpkg/installed + ./vcpkg/archives + key: ${{ runner.os }}-vcpkg-${{ hashFiles('**/vcpkg.json') }} + + + - name: 'VCPKG: Install project dependencies' + run: | + .\vcpkg install tbb openssl lcms zlib openjpeg freetype ijg-libjpeg libpng --triplet x64-windows + working-directory: vcpkg + + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + version: '6.6.0' + host: 'windows' + target: 'desktop' + dir: '${{ github.workspace }}/qt/' + install-deps: 'true' + modules: 'qtspeech qtmultimedia' + cache: 'true' + cache-key-prefix: ${{ runner.os }}-qt-660 + + - name: Build project + working-directory: pdf4qt + shell: pwsh + run: | + cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DPDF4QT_INSTALL_QT_DEPENDENCIES=ON -DPDF4QT_INSTALL_DEPENDENCIES=ON -DCMAKE_TOOLCHAIN_FILE="${env:GITHUB_WORKSPACE}\vcpkg\scripts\buildsystems\vcpkg.cmake" -DPDF4QT_QT_ROOT="${env:Qt6_DIR}" -DPDF4QT_INSTALL_MSVC_REDISTRIBUTABLE=ON -DPDF4QT_INSTALL_PREPARE_WIX_INSTALLER=ON -DPDF4QT_INSTALL_TO_USR=ON + cmake --build build --config Release -j6 + cmake --install build + + - name: Upload Windows package + uses: actions/upload-artifact@v3 + with: + name: 'pdf4qt-${{ runner.os }}.zip' + path: .\pdf4qt\build\install\usr\bin + retention-days: 30 diff --git a/.github/workflows/ci_win.yml b/.github/workflows/ci_win.yml deleted file mode 100644 index 032e2f9..0000000 --- a/.github/workflows/ci_win.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: CIWIN - -on: - workflow_dispatch: - -jobs: - build_windows: - runs-on: windows-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - path: pdf4qt - - - name: 'VCPKG: Set up VCPKG' - run: | - git clone --depth=1 https://github.com/microsoft/vcpkg.git - cd vcpkg - .\bootstrap-vcpkg.bat -disableMetrics - .\vcpkg integrate install - set VCPKG_ROOT=${env:GITHUB_WORKSPACE}\vcpkg\ - set "VCPKG_BINARY_SOURCES=clear;files,${env:GITHUB_WORKSPACE}\vcpkg\archives,readwrite" - - - name: 'VCPKG: Cache vcpkg dependencies' - uses: actions/cache@v3 - with: - path: | - ./vcpkg/downloads - ./vcpkg/packages - ./vcpkg/installed - ./vcpkg/archives - key: ${{ runner.os }}-vcpkg-${{ hashFiles('**/vcpkg.json') }} - - - - name: 'VCPKG: Install project dependencies' - run: | - .\vcpkg install tbb openssl lcms zlib openjpeg freetype ijg-libjpeg libpng --triplet x64-windows - working-directory: vcpkg - - - name: Install Qt - uses: jurplel/install-qt-action@v3 - with: - version: '6.6.0' - host: 'windows' - target: 'desktop' - dir: '${{ github.workspace }}/qt/' - install-deps: 'true' - modules: 'qtspeech qtmultimedia' - cache: 'true' - cache-key-prefix: ${{ runner.os }}-qt-660 - - - name: Build project - working-directory: pdf4qt - shell: pwsh - run: | - cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DPDF4QT_INSTALL_QT_DEPENDENCIES=ON -DPDF4QT_INSTALL_DEPENDENCIES=ON -DCMAKE_TOOLCHAIN_FILE="${env:GITHUB_WORKSPACE}\vcpkg\scripts\buildsystems\vcpkg.cmake" -DPDF4QT_QT_ROOT="${env:Qt6_DIR}" -DPDF4QT_INSTALL_MSVC_REDISTRIBUTABLE=ON -DPDF4QT_INSTALL_PREPARE_WIX_INSTALLER=ON -DPDF4QT_INSTALL_TO_USR=ON - cmake --build build --config Release -j6 - cmake --install build - - - name: Upload Windows package - uses: actions/upload-artifact@v3 - with: - name: 'pdf4qt-${{ runner.os }}.zip' - path: .\pdf4qt\build\install\usr\bin - retention-days: 30