Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/appimage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build AppImage
on:
workflow_dispatch:
push:
branches:
- master
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Abs62 - This "on" section tells GitHub when to run this build. Right now I have it set to run "when a maintainer asks for it" ("workflow_dispatch") and when "master" branch is pushed. You can also set it up to run on pull requests, new releases, etc. See the full set of triggering option here: https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows

jobs:
build:
runs-on: ubuntu-22.04

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get -y install git pkg-config build-essential fuse libfuse2 qt5-qmake \
libvorbis-dev zlib1g-dev libhunspell-dev x11proto-record-dev \
qtdeclarative5-dev qtwebengine5-dev libxtst-dev liblzo2-dev libbz2-dev \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QtWebEngine is not a dependency of GoldenDict master, only of goldendict#1542. So I do not think it should be here. libqtwebkit-dev probably refers to the Qt4 WebKit, so it isn't needed either. libqt5webkit5-dev (below) is sufficient.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does installing the unnecessary dependency qtwebengine5-dev affect the resulting AppImage in any way? If not, I guess it can remain so that goldendict#1542 does not need to be adjusted.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. apt-get install here only effects the image of the machine that builds the AppImage. It doesn't effect the AppImage itself at all.

libao-dev libavutil-dev libavformat-dev libswresample-dev libtiff5-dev libeb16-dev \
libqt5webkit5-dev libqt5svg5-dev libqt5x11extras5-dev qttools5-dev \
qttools5-dev-tools qtmultimedia5-dev libqt5multimedia5-plugins libopencc-dev liblzma-dev libzstd-dev doxygen cmake

- name: Build OpenCC
run: |
git clone https://github.com/BYVoid/OpenCC
cd OpenCC/
make PREFIX=/usr -j$(nproc)
sudo make install

- name: Build GoldenDict
run: |
qmake CONFIG+=release PREFIX=/usr CONFIG+=old_hunspell CONFIG+=zim_support
make -j$(nproc)
make INSTALL_ROOT=appdir -j$(nproc) install
find appdir/

- name: Download and prepare linuxdeployqt
run: |
wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
chmod a+x linuxdeployqt-continuous-x86_64.AppImage
unset QTDIR
unset QT_PLUGIN_PATH
unset LD_LIBRARY_PATH
mkdir -p appdir/usr/lib/
cp /usr/lib/x86_64-linux-gnu/libssl.so.1.1 appdir/usr/lib/ || \
cp /usr/lib/x86_64-linux-gnu/libssl.so.3 appdir/usr/lib/ || true
cp /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 appdir/usr/lib/ || \
cp /usr/lib/x86_64-linux-gnu/libcrypto.so.3 appdir/usr/lib/ || true
./linuxdeployqt-continuous-x86_64.AppImage appdir/usr/share/applications/*.desktop -appimage

- name: Inspect linked libraries
if: success()
run: |
find appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq

- name: Upload AppImage artifact
uses: actions/upload-artifact@v4
with:
name: GoldenDict-AppImage
path: GoldenDict*.AppImage*