2023-12-09 17:22:21 +01:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
2023-12-11 20:03:08 +01:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
|
2023-12-09 17:22:21 +01:00
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
2023-12-09 17:34:48 +01:00
|
|
|
build_ubuntu:
|
2023-12-09 17:22:21 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2023-12-09 19:43:01 +01:00
|
|
|
uses: actions/checkout@v4
|
2023-12-09 17:22:21 +01:00
|
|
|
with:
|
|
|
|
path: pdf4qt
|
|
|
|
|
2023-12-09 17:23:19 +01:00
|
|
|
- name: 'VCPKG: Set up VCPKG'
|
2023-12-09 17:22:21 +01:00
|
|
|
run: |
|
|
|
|
git clone --depth=1 https://github.com/microsoft/vcpkg.git
|
|
|
|
cd vcpkg
|
|
|
|
./bootstrap-vcpkg.sh
|
|
|
|
./vcpkg integrate install
|
|
|
|
|
2023-12-09 17:23:19 +01:00
|
|
|
- name: 'VCPKG: Cache vcpkg dependencies'
|
2023-12-09 19:43:01 +01:00
|
|
|
uses: actions/cache@v3
|
2023-12-09 17:22:21 +01:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
./vcpkg/downloads
|
|
|
|
./vcpkg/packages
|
2023-12-09 19:43:01 +01:00
|
|
|
key: ${{ runner.os }}-vcpkg-v2-${{ hashFiles('**/vcpkg.json') }}
|
2023-12-09 17:22:21 +01:00
|
|
|
restore-keys: |
|
2023-12-09 19:43:01 +01:00
|
|
|
${{ runner.os }}-vcpkg-v2-
|
2023-12-09 17:22:21 +01:00
|
|
|
|
2023-12-09 17:23:19 +01:00
|
|
|
- name: 'VCPKG: Install project dependencies'
|
2023-12-09 17:22:21 +01:00
|
|
|
run: |
|
2023-12-09 17:34:48 +01:00
|
|
|
./vcpkg install tbb openssl lcms zlib openjpeg freetype ijg-libjpeg libpng
|
2023-12-09 17:22:21 +01:00
|
|
|
working-directory: vcpkg
|
|
|
|
|
|
|
|
- name: Install Qt
|
|
|
|
uses: jurplel/install-qt-action@v3
|
|
|
|
with:
|
|
|
|
version: '6.6.0'
|
|
|
|
host: 'linux'
|
|
|
|
target: 'desktop'
|
|
|
|
dir: '${{ github.workspace }}/qt/'
|
|
|
|
install-deps: 'true'
|
2023-12-09 19:11:10 +01:00
|
|
|
modules: 'qtspeech qtmultimedia'
|
2023-12-09 17:22:21 +01:00
|
|
|
cache: 'true'
|
|
|
|
cache-key-prefix: ${{ runner.os }}-qt-660
|
|
|
|
|
|
|
|
- name: Build project
|
2023-12-09 17:34:48 +01:00
|
|
|
working-directory: pdf4qt
|
2023-12-09 17:22:21 +01:00
|
|
|
run: |
|
|
|
|
cmake -B build -S . -DPDF4QT_INSTALL_QT_DEPENDENCIES=0 -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release
|
|
|
|
cmake --build build -j6
|
|
|
|
cmake --install build
|
|
|
|
|
|
|
|
- name: Make DEB package
|
2023-12-09 17:34:48 +01:00
|
|
|
working-directory: pdf4qt/build
|
2023-12-09 17:22:21 +01:00
|
|
|
run: |
|
|
|
|
sh make-package.sh
|
|
|
|
|
|
|
|
- name: Upload DEB package
|
2023-12-09 17:24:16 +01:00
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: ubuntu-deb-package
|
2023-12-09 17:43:16 +01:00
|
|
|
path: ./pdf4qt/build/*.deb
|
2023-12-11 20:03:08 +01:00
|
|
|
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
|