PDF4QT/.github/workflows/LinuxInstall.yml

106 lines
3.4 KiB
YAML
Raw Normal View History

2024-01-21 11:20:31 +01:00
name: LinuxInstall
2024-01-21 14:08:14 +01:00
on:
create:
tags:
- 'v*'
2024-01-21 11:20:31 +01:00
workflow_dispatch:
jobs:
build_ubuntu:
runs-on: ubuntu-20.04
steps:
2024-01-21 13:33:08 +01:00
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libxcb-cursor0
2024-01-21 13:44:44 +01:00
sudo apt-get install -y libspeechd2
2024-01-21 13:33:08 +01:00
2024-01-21 11:20:31 +01:00
- name: Checkout repository
uses: actions/checkout@v4
with:
path: pdf4qt
2024-01-21 11:43:41 +01:00
- name: Set up GCC
uses: egor-tensin/setup-gcc@v1
with:
2024-01-21 11:50:52 +01:00
version: 11
2024-01-21 11:43:41 +01:00
platform: x64
2024-01-21 11:20:31 +01:00
- name: 'VCPKG: Set up VCPKG'
run: |
git clone --depth=1 https://github.com/microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
- name: 'VCPKG: Cache vcpkg dependencies'
uses: actions/cache@v4
2024-01-21 11:20:31 +01:00
with:
path: |
./vcpkg/downloads
./vcpkg/packages
key: ${{ runner.os }}-vcpkg-v2-${{ hashFiles('**/vcpkg.json') }}
restore-keys: |
${{ runner.os }}-vcpkg-v2-
- name: 'VCPKG: Install project dependencies'
run: |
2024-02-24 18:00:03 +01:00
./vcpkg install tbb openssl lcms zlib openjpeg freetype ijg-libjpeg libpng blend2d
2024-01-21 11:20:31 +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'
modules: 'qtspeech qtmultimedia'
cache: 'true'
cache-key-prefix: ${{ runner.os }}-qt-660
- name: Build project
working-directory: pdf4qt
run: |
2024-01-21 12:57:30 +01:00
cmake -B build -S . -DPDF4QT_INSTALL_QT_DEPENDENCIES=0 -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release -DVCPKG_OVERLAY_PORTS=vcpkg/overlays -DPDF4QT_INSTALL_TO_USR=ON
2024-01-21 11:20:31 +01:00
cmake --build build -j6
cmake --install build
2024-01-21 14:35:26 +01:00
cp -rp build/install build/install_appimage
2024-01-21 12:34:57 +01:00
2024-01-21 12:39:01 +01:00
- name: 'Linux Deploy Qt'
working-directory: pdf4qt/build
run: |
wget -O deploy.AppImage https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
chmod +x deploy.AppImage
2024-01-21 13:33:08 +01:00
./deploy.AppImage install/usr/share/applications/io.github.JakubMelka.Pdf4qt.desktop -executable-dir=install/usr/bin -extra-plugins=iconengines,imageformats,texttospeech
2024-01-21 11:20:31 +01:00
- name: Make DEB package
working-directory: pdf4qt/build
run: |
sh make-package.sh
2024-01-21 14:08:14 +01:00
2024-01-21 11:20:31 +01:00
- name: Upload DEB package
uses: actions/upload-artifact@v4
2024-01-21 11:20:31 +01:00
with:
name: ubuntu-deb-package
path: ./pdf4qt/build/*.deb
retention-days: 30
2024-01-21 14:08:14 +01:00
- name: 'Make AppImage'
working-directory: pdf4qt/build
run: |
2024-01-21 15:25:49 +01:00
cp install_appimage/usr/share/icons/hicolor/scalable/apps/io.github.JakubMelka.Pdf4qt.svg install_appimage/io.github.JakubMelka.Pdf4qt.svg
2024-01-21 14:35:26 +01:00
./deploy.AppImage install_appimage/usr/share/applications/io.github.JakubMelka.Pdf4qt.desktop -appimage -executable-dir=install_appimage/usr/bin -always-overwrite -extra-plugins=iconengines,imageformats,texttospeech
2024-01-21 14:08:14 +01:00
- name: Upload AppImage package
uses: actions/upload-artifact@v4
2024-01-21 14:08:14 +01:00
with:
name: ubuntu-appimage
path: ./pdf4qt/build/*.AppImage
retention-days: 30