PDF4QT/.github/workflows/LinuxInstall.yml

147 lines
6.0 KiB
YAML
Raw Normal View History

2024-06-29 18:02:35 +02:00
name: Linux_AppImage
2024-01-21 11:20:31 +01:00
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-06-29 18:02:35 +02:00
sudo apt-get install -y gnupg2 wget
2024-06-29 17:11:46 +02:00
wget -c "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
chmod +x appimagetool-x86_64.AppImage
sudo mv appimagetool-x86_64.AppImage /usr/local/bin/appimagetool
2024-06-29 18:02:35 +02:00
- name: Configure GPG
run: |
mkdir -p ~/.gnupg
echo "use-agent" >> ~/.gnupg/gpg.conf
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf
echo "allow-preset-passphrase" >> ~/.gnupg/gpg-agent.conf
gpgconf --kill gpg-agent
echo "GPG configuration complete."
chmod 700 ~/.gnupg
2024-06-29 17:11:46 +02:00
- name: Import PGP private key
run: |
echo "${{ secrets.PGP_PRIVATE_KEY }}" | gpg --batch --import
2024-06-29 18:02:35 +02:00
for keygrip in $(gpg --list-secret-keys --with-keygrip "${{ secrets.PGP_KEY_ID }}" | grep Keygrip | awk '{print $3}'); do
echo "${{ secrets.PGP_PASSPHRASE }}" | "$(gpgconf --list-dirs libexecdir)"/gpg-preset-passphrase --preset $keygrip
done
2024-06-29 17:11:46 +02:00
env:
GNUPGHOME: /home/runner/.gnupg
2024-06-29 18:02:35 +02:00
- name: Create Test signature
run: |
echo "TEST" >> ~/test_with_passphrase.txt
echo "TEST" >> ~/test_without_passphrase.txt
gpg --batch --yes --verbose --passphrase "${{ secrets.PGP_PASSPHRASE }}" --pinentry-mode loopback --detach-sign --local-user "${{ secrets.PGP_KEY_ID }}" --output ~/test_with_passphrase.txt.sig ~/test_with_passphrase.txt
gpg --batch --yes --verbose --pinentry-mode loopback --detach-sign --local-user "${{ secrets.PGP_KEY_ID }}" --output ~/test_without_passphrase.txt.sig ~/test_without_passphrase.txt
- name: Verify Test signature
run: |
gpg --batch --yes --verbose --verify ~/test_with_passphrase.txt.sig ~/test_with_passphrase.txt
gpg --batch --yes --verbose --verify ~/test_without_passphrase.txt.sig ~/test_without_passphrase.txt
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-
2024-06-29 18:02:35 +02:00
- name: 'VCPKG: Install Project Dependencies'
2024-01-21 11:20:31 +01:00
run: |
2024-06-29 18:02:35 +02:00
./vcpkg install tbb openssl lcms zlib openjpeg freetype ijg-libjpeg libpng blend2d brotli bzip2 --triplet x64-linux-release
2024-01-21 11:20:31 +01:00
working-directory: vcpkg
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: '6.7.2'
2024-01-21 11:20:31 +01:00
host: 'linux'
target: 'desktop'
dir: '${{ github.workspace }}/qt/'
install-deps: 'true'
modules: 'qtspeech qtmultimedia'
cache: 'true'
cache-key-prefix: ${{ runner.os }}-qt-672
2024-01-21 11:20:31 +01:00
2024-06-29 18:02:35 +02:00
- name: Build Project
2024-01-21 11:20:31 +01:00
working-directory: pdf4qt
run: |
2024-06-29 18:02:35 +02:00
cmake -B build -S . -DPDF4QT_INSTALL_QT_DEPENDENCIES=0 -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_VCPKG_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 12:34:57 +01:00
2024-01-21 12:39:01 +01:00
- name: 'Linux Deploy Qt'
working-directory: pdf4qt/build
run: |
2024-06-29 18:02:35 +02:00
cp install/usr/share/icons/hicolor/scalable/apps/io.github.JakubMelka.Pdf4qt.svg install/io.github.JakubMelka.Pdf4qt.svg
2024-01-21 12:39:01 +01:00
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 14:08:14 +01:00
2024-06-29 18:02:35 +02:00
- name: Sign and Repack AppImage
2024-01-21 14:08:14 +01:00
working-directory: pdf4qt/build
run: |
2024-06-29 18:02:35 +02:00
export GPG_TTY=$(tty)
echo "${{ secrets.PGP_PASSPHRASE }}" | appimagetool -s --sign-key "${{ secrets.PGP_KEY_ID }}" install/ io.github.JakubMelka.Pdf4qt.AppImage
2024-01-21 14:08:14 +01:00
2024-06-29 18:02:35 +02:00
- name: Manual signature
2024-06-29 17:11:46 +02:00
run: |
2024-06-29 18:02:35 +02:00
gpg --batch --yes --verbose --pinentry-mode loopback --detach-sign --passphrase "${{ secrets.PGP_PASSPHRASE }}" --local-user "${{ secrets.PGP_KEY_ID }}" --output pdf4qt/build/io.github.JakubMelka.Pdf4qt.AppImage.sig pdf4qt/build/io.github.JakubMelka.Pdf4qt.AppImage
- name: Verify AppImage Detached Signature
run: |
echo "${{ secrets.PGP_PUBLIC_KEY }}" | gpg --batch --import
gpg --verify pdf4qt/build/io.github.JakubMelka.Pdf4qt.AppImage.sig pdf4qt/build/io.github.JakubMelka.Pdf4qt.AppImage
- name: Upload AppImage Package
uses: actions/upload-artifact@v4
2024-01-21 14:08:14 +01:00
with:
name: ubuntu-appimage
2024-06-29 18:02:35 +02:00
path: ./pdf4qt/build/io.github.JakubMelka.Pdf4qt.AppImage
retention-days: 30
- name: Upload AppImage Signature File
uses: actions/upload-artifact@v4
with:
name: ubuntu-appimage-sig
path: ./pdf4qt/build/io.github.JakubMelka.Pdf4qt.AppImage.sig
2024-01-21 14:08:14 +01:00
retention-days: 30
2024-06-29 18:02:35 +02:00
if-no-files-found: warn
compression-level: 0