Merge pull request #5775 from konero/navfix #174
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Linux Build | |
on: [push, pull_request] | |
jobs: | |
Ubuntu: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
compiler: [gcc, clang] | |
include: | |
- compiler: gcc | |
cc: gcc | |
cxx: g++ | |
- compiler: clang | |
cc: clang | |
cxx: clang++ | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install libraries | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y build-essential cmake pkg-config ninja-build ccache libboost-all-dev qtbase5-dev qt5-qmake qtscript5-dev qttools5-dev qttools5-dev-tools qtmultimedia5-dev qtwayland5 libqt5svg5-dev libqt5opengl5-dev libqt5multimedia5-plugins libqt5serialport5-dev libsuperlu-dev liblz4-dev libusb-1.0-0-dev liblzo2-dev libpng-dev libjpeg-dev libglew-dev freeglut3-dev libfreetype6-dev libjson-c-dev libmypaint-dev libopencv-dev libturbojpeg-dev libomp-dev libfuse2 | |
- name: Set up cache | |
run: mkdir -p /home/runner/.ccache | |
- uses: actions/cache@v4 | |
with: | |
path: /home/runner/.ccache | |
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.compiler }}- | |
${{ runner.os }}- | |
- name: Build libtiff | |
run: | | |
cd thirdparty/tiff-4.0.3 | |
CFLAGS='-fPIC' CXXFLAGS='-fPIC' ./configure --disable-jbig | |
make -j $(nproc) | |
- name: Build | |
run: | | |
export CCACHE_DIR=/home/runner/.ccache | |
export CC="ccache ${{ matrix.cc }}" | |
export CXX="ccache ${{ matrix.cxx }}" | |
cd toonz | |
mkdir build | |
cd build | |
cmake ../sources -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} -DCMAKE_C_COMPILER=${{ matrix.cc }} -DWITH_TRANSLATION=OFF | |
ninja | |
- name: Create Artifact | |
run: | | |
cd toonz/build | |
sudo ninja install | |
mkdir -p appdir/usr | |
cp -r /opt/opentoonz/* appdir/usr | |
cp appdir/usr/share/applications/*.desktop appdir | |
cp appdir/usr/share/icons/hicolor/*/apps/*.png appdir | |
mkdir artifact | |
mv appdir/usr/share/opentoonz/stuff artifact/portablestuff | |
rmdir appdir/usr/share/opentoonz | |
wget -q -c 'https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage' | |
wget -q -c 'https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage' | |
wget -q -c 'https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage' | |
chmod 755 linuxdeploy-x86_64.AppImage | |
chmod 755 linuxdeploy-plugin-qt-x86_64.AppImage | |
chmod 755 linuxdeploy-plugin-appimage-x86_64.AppImage | |
cat << EOF > apprun.sh | |
#!/usr/bin/env bash | |
exec "\${APPDIR}/usr/bin/OpenToonz" | |
EOF | |
chmod 755 apprun.sh | |
export LD_LIBRARY_PATH='appdir/usr/lib/opentoonz' | |
./linuxdeploy-x86_64.AppImage --appdir=appdir --plugin=qt --output=appimage --custom-apprun=apprun.sh \ | |
--executable=appdir/usr/bin/lzocompress \ | |
--executable=appdir/usr/bin/lzodecompress \ | |
--executable=appdir/usr/bin/tcleanup \ | |
--executable=appdir/usr/bin/tcomposer \ | |
--executable=appdir/usr/bin/tconverter \ | |
--executable=appdir/usr/bin/tfarmcontroller \ | |
--executable=appdir/usr/bin/tfarmserver | |
mv OpenToonz*.AppImage artifact/OpenToonz.AppImage | |
ARTIFACT_NAME=Opentoonz-${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} | |
mv artifact ${ARTIFACT_NAME} | |
tar zcf ${ARTIFACT_NAME}.tar.gz ${ARTIFACT_NAME} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: Opentoonz-${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} | |
path: toonz/build/Opentoonz-${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}.tar.gz |