fix(docker): correct Qt6 package names for Ubuntu 24.04 #710
This file contains hidden or 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: Build Rats Search | |
| on: | |
| push: | |
| branches: [ master, main, develop, cpp ] | |
| tags: [ 'v*' ] | |
| pull_request: | |
| branches: [ master, main ] | |
| workflow_dispatch: | |
| permissions: {} | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: ${{ github.head_ref != '' }} | |
| env: | |
| QT_VERSION: '6.10.1' | |
| BUILD_TYPE: Release | |
| jobs: | |
| build-windows: | |
| runs-on: windows-latest | |
| name: Windows x64 | |
| permissions: | |
| actions: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| persist-credentials: false | |
| - name: Setup MSVC | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| with: | |
| arch: x64 | |
| - name: Install Ninja | |
| run: | | |
| if ((Get-Command "ninja.exe" -ErrorAction SilentlyContinue) -eq $null) { | |
| choco install ninja | |
| } | |
| - name: Install Qt | |
| uses: jurplel/install-qt-action@v4 | |
| with: | |
| version: ${{ env.QT_VERSION }} | |
| arch: 'win64_msvc2022_64' | |
| modules: qtwebsockets | |
| cache: true | |
| - name: Download Qt MySQL plugin | |
| shell: powershell | |
| run: | | |
| # Download pre-built Qt MySQL driver from thecodemonkey86 | |
| $driverUrl = "https://github.com/thecodemonkey86/qt_mysql_driver/releases/download/qmysql_${{ env.QT_VERSION }}/qsqlmysql.dll_Qt_SQL_driver_${{ env.QT_VERSION }}_MSVC2022_64-bit.zip" | |
| $driverZip = "$env:TEMP\qsqlmysql.zip" | |
| $driverDir = "$env:TEMP\qsqlmysql" | |
| Write-Host "Downloading MySQL driver from: $driverUrl" | |
| Invoke-WebRequest -Uri $driverUrl -OutFile $driverZip | |
| Expand-Archive -Path $driverZip -DestinationPath $driverDir -Force | |
| # Use QT_ROOT_DIR which is set by jurplel/install-qt-action | |
| $qtRoot = "$env:QT_ROOT_DIR" | |
| Write-Host "Qt root directory: $qtRoot" | |
| # Ensure directories exist | |
| $pluginDir = "$qtRoot\plugins\sqldrivers" | |
| $binDir = "$qtRoot\bin" | |
| New-Item -ItemType Directory -Force -Path $pluginDir | Out-Null | |
| New-Item -ItemType Directory -Force -Path $binDir | Out-Null | |
| # Copy SQL driver plugins | |
| if (Test-Path "$driverDir\sqldrivers") { | |
| Copy-Item "$driverDir\sqldrivers\*.dll" -Destination $pluginDir -Force | |
| Write-Host "Copied SQL driver plugins to $pluginDir" | |
| } | |
| # Copy runtime DLLs (libmysql, libcrypto, libssl) to bin directory | |
| Get-ChildItem -Path $driverDir -Filter "*.dll" -File | ForEach-Object { | |
| Copy-Item $_.FullName -Destination $binDir -Force | |
| Write-Host "Copied $($_.Name) to bin directory" | |
| } | |
| - name: Configure CMake | |
| run: | | |
| cmake -B build -G "Ninja" ` | |
| -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} ` | |
| -DRATS_SEARCH_USE_SYSTEM_LIBRATS=OFF ` | |
| -DRATS_SEARCH_BUILD_TESTS=ON | |
| - name: Build | |
| run: cmake --build build --config ${{ env.BUILD_TYPE }} --parallel | |
| - name: Copy MySQL libraries for tests | |
| shell: powershell | |
| run: | | |
| $testDir = "build/tests" | |
| $qtRoot = "$env:QT_ROOT_DIR" | |
| # Copy libmysql.dll next to test executables | |
| $libmysql = "imports/win/x64/libmysql.dll" | |
| if (Test-Path $libmysql) { | |
| Copy-Item $libmysql -Destination $testDir -Force | |
| Write-Host "Copied libmysql.dll to $testDir" | |
| } | |
| - name: Run tests | |
| run: | | |
| cd build | |
| ctest --output-on-failure --parallel | |
| - name: Copy Manticore binaries | |
| shell: powershell | |
| run: | | |
| $binDir = "build/bin" | |
| # Copy all Manticore files for Windows x64 | |
| Copy-Item "imports/win/x64/*" -Destination $binDir -Force -Recurse | |
| Write-Host "Copied Manticore binaries:" | |
| Get-ChildItem $binDir | ForEach-Object { Write-Host $_.Name } | |
| - name: Copy Qt MySQL plugin | |
| shell: powershell | |
| run: | | |
| $binDir = "build/bin" | |
| $qtRoot = "$env:QT_ROOT_DIR" | |
| $pluginSrc = "$qtRoot/plugins/sqldrivers" | |
| $pluginDst = "$binDir/sqldrivers" | |
| New-Item -ItemType Directory -Force -Path $pluginDst | Out-Null | |
| # Copy MySQL plugin and dependencies | |
| Get-ChildItem "$pluginSrc" -Filter "*.dll" | ForEach-Object { | |
| Copy-Item $_.FullName -Destination $pluginDst -Force | |
| Write-Host "Copied: $($_.Name)" | |
| } | |
| # Copy libmysql.dll to bin directory | |
| if (Test-Path "$qtRoot/bin/libmysql.dll") { | |
| Copy-Item "$qtRoot/bin/libmysql.dll" -Destination $binDir -Force | |
| Write-Host "Copied libmysql.dll to bin" | |
| } | |
| - name: Get version | |
| id: version | |
| shell: powershell | |
| run: | | |
| if ("${{ github.ref }}" -match "refs/tags/(.+)") { | |
| $version = $matches[1] | |
| } else { | |
| $version = "dev-${{ github.sha }}".Substring(0, 15) | |
| } | |
| echo "VERSION=$version" >> $env:GITHUB_OUTPUT | |
| Write-Host "Version: $version" | |
| - name: Create deployment package | |
| shell: powershell | |
| run: | | |
| $version = "${{ steps.version.outputs.VERSION }}" | |
| $packageDir = "RatsSearch-Windows-x64" | |
| $zipName = "RatsSearch-Windows-x64-${version}.zip" | |
| New-Item -ItemType Directory -Force -Path $packageDir | Out-Null | |
| # Copy all files from bin directory | |
| Copy-Item "build/bin/*" -Destination $packageDir -Recurse -Force | |
| # Copy config if exists | |
| if (Test-Path "build/bin/config.json") { | |
| Copy-Item "build/bin/config.json" -Destination $packageDir -Force | |
| } | |
| # Copy PDB files if they exist | |
| Get-ChildItem "build/bin" -Filter "*.pdb" | ForEach-Object { | |
| Copy-Item $_.FullName -Destination $packageDir -Force | |
| Write-Host "Copied PDB: $($_.Name)" | |
| } | |
| # Create zip | |
| Compress-Archive -Path $packageDir -DestinationPath $zipName -Force | |
| Write-Host "Created: $zipName" | |
| - name: Create installer | |
| shell: powershell | |
| run: | | |
| $version = "${{ steps.version.outputs.VERSION }}" | |
| $packageDir = (Resolve-Path "RatsSearch-Windows-x64").Path | |
| $issFile = "installer/windows.iss" | |
| # Inno Setup is pre-installed on windows-latest runners | |
| $iscc = "${env:ProgramFiles(x86)}\Inno Setup 6\ISCC.exe" | |
| if (-not (Test-Path $iscc)) { | |
| Write-Host "Inno Setup not found, installing..." | |
| choco install innosetup -y | |
| $iscc = "${env:ProgramFiles(x86)}\Inno Setup 6\ISCC.exe" | |
| } | |
| Write-Host "Building installer with version: $version" | |
| Write-Host "Source directory: $packageDir" | |
| & $iscc /DMyAppVersion="$version" /DSourceDir="$packageDir" "$issFile" | |
| Write-Host "Installer created:" | |
| Get-ChildItem "installer\*.exe" | ForEach-Object { Write-Host $_.Name } | |
| - name: Upload artifact (ZIP) | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: RatsSearch-Windows-x64-zip | |
| path: RatsSearch-Windows-x64-*.zip | |
| retention-days: 30 | |
| - name: Upload artifact (Installer) | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: RatsSearch-Windows-x64-setup | |
| path: installer/RatsSearch-Windows-x64-*-setup.exe | |
| retention-days: 30 | |
| build-macos-intel: | |
| if: false # Temporarily disabled | |
| runs-on: macos-latest | |
| name: macOS Intel (x64) | |
| permissions: | |
| actions: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| persist-credentials: false | |
| - name: Install Ninja | |
| run: brew install ninja | |
| - name: Install Qt | |
| uses: jurplel/install-qt-action@v4 | |
| with: | |
| version: ${{ env.QT_VERSION }} | |
| cache: true | |
| - name: Install MySQL client | |
| run: | | |
| brew install mysql-client | |
| echo "MYSQL_DIR=$(brew --prefix mysql-client)" >> $GITHUB_ENV | |
| echo "MYSQL_INCLUDE_DIR=$(brew --prefix mysql-client)/include/mysql" >> $GITHUB_ENV | |
| echo "MYSQL_LIB_DIR=$(brew --prefix mysql-client)/lib" >> $GITHUB_ENV | |
| - name: Build Qt MySQL plugin (if not available) | |
| run: | | |
| # Use QT_ROOT_DIR which is set by jurplel/install-qt-action | |
| QT_ROOT="${{ env.QT_ROOT_DIR }}" | |
| QT_PLUGIN_DIR="$QT_ROOT/plugins/sqldrivers" | |
| PLUGIN_PATH="$QT_PLUGIN_DIR/libqsqlmysql.dylib" | |
| echo "Qt root: $QT_ROOT" | |
| echo "Plugin path: $PLUGIN_PATH" | |
| if [ ! -f "$PLUGIN_PATH" ]; then | |
| echo "MySQL plugin not found in Qt installation, building from source..." | |
| # Clone Qt base for sqldrivers source | |
| git clone --depth 1 --branch v${{ env.QT_VERSION }} https://github.com/qt/qtbase.git qtbase-src | |
| cd qtbase-src/src/plugins/sqldrivers | |
| cmake -B build -G "Ninja" \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DMySQL_INCLUDE_DIR="$MYSQL_INCLUDE_DIR" \ | |
| -DMySQL_LIBRARY="$MYSQL_LIB_DIR/libmysqlclient.dylib" | |
| cmake --build build --target qsqlmysql --config Release | |
| if [ -f "build/plugins/sqldrivers/libqsqlmysql.dylib" ]; then | |
| mkdir -p "$QT_PLUGIN_DIR" | |
| cp build/plugins/sqldrivers/libqsqlmysql.dylib "$QT_PLUGIN_DIR/" | |
| echo "Successfully built and installed MySQL plugin" | |
| fi | |
| cd ../../../.. | |
| else | |
| echo "MySQL plugin already available at $PLUGIN_PATH" | |
| fi | |
| - name: Configure CMake | |
| run: | | |
| cmake -B build -G "Ninja" \ | |
| -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ | |
| -DRATS_SEARCH_USE_SYSTEM_LIBRATS=OFF \ | |
| -DRATS_SEARCH_BUILD_TESTS=ON | |
| - name: Build | |
| run: cmake --build build --config ${{ env.BUILD_TYPE }} --parallel | |
| - name: Run tests | |
| run: | | |
| cd build | |
| ctest --output-on-failure --parallel | |
| - name: Copy Manticore binaries | |
| run: | | |
| BUNDLE_DIR="build/bin/RatsSearch.app/Contents/MacOS" | |
| # Copy Manticore binaries for macOS Intel | |
| cp imports/darwin/x64/* "$BUNDLE_DIR/" || true | |
| chmod +x "$BUNDLE_DIR/searchd" "$BUNDLE_DIR/indexer" 2>/dev/null || true | |
| echo "Copied Manticore binaries:" | |
| ls -la "$BUNDLE_DIR/" | |
| - name: Get version | |
| id: version | |
| run: | | |
| if [[ "${{ github.ref }}" == refs/tags/* ]]; then | |
| VERSION="${{ github.ref_name }}" | |
| else | |
| VERSION="dev-$(echo ${{ github.sha }} | cut -c1-7)" | |
| fi | |
| echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Version: $VERSION" | |
| - name: Create DMG | |
| run: | | |
| VERSION="${{ steps.version.outputs.VERSION }}" | |
| DMG_NAME="RatsSearch-macOS-Intel-${VERSION}.dmg" | |
| # Create a temporary directory for DMG contents | |
| mkdir -p dmg-contents | |
| cp -R build/bin/RatsSearch.app dmg-contents/ | |
| ln -s /Applications dmg-contents/Applications | |
| # Create DMG | |
| hdiutil create \ | |
| -volname "Rats Search" \ | |
| -srcfolder dmg-contents \ | |
| -ov \ | |
| -format UDZO \ | |
| "$DMG_NAME" | |
| echo "Created: $DMG_NAME" | |
| ls -la "$DMG_NAME" | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: RatsSearch-macOS-Intel | |
| path: RatsSearch-macOS-Intel-*.dmg | |
| retention-days: 30 | |
| build-macos-arm: | |
| runs-on: macos-latest | |
| name: macOS ARM (Apple Silicon) | |
| permissions: | |
| actions: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| persist-credentials: false | |
| - name: Install Ninja | |
| run: brew install ninja | |
| - name: Install Qt | |
| uses: jurplel/install-qt-action@v4 | |
| with: | |
| version: ${{ env.QT_VERSION }} | |
| modules: qtwebsockets | |
| cache: true | |
| - name: Install MySQL client | |
| run: | | |
| brew install mysql-client | |
| echo "MYSQL_DIR=$(brew --prefix mysql-client)" >> $GITHUB_ENV | |
| echo "MYSQL_INCLUDE_DIR=$(brew --prefix mysql-client)/include/mysql" >> $GITHUB_ENV | |
| echo "MYSQL_LIB_DIR=$(brew --prefix mysql-client)/lib" >> $GITHUB_ENV | |
| - name: Build Qt MySQL plugin (if not available) | |
| run: | | |
| # Use QT_ROOT_DIR which is set by jurplel/install-qt-action | |
| QT_ROOT="${{ env.QT_ROOT_DIR }}" | |
| QT_PLUGIN_DIR="$QT_ROOT/plugins/sqldrivers" | |
| PLUGIN_PATH="$QT_PLUGIN_DIR/libqsqlmysql.dylib" | |
| echo "Qt root: $QT_ROOT" | |
| echo "Plugin path: $PLUGIN_PATH" | |
| echo "Host arch: $(uname -m)" | |
| echo "MySQL lib arch: $(file "$MYSQL_LIB_DIR/libmysqlclient.dylib")" | |
| if [ ! -f "$PLUGIN_PATH" ]; then | |
| echo "MySQL plugin not found in Qt installation, building from source..." | |
| # Clone Qt base for sqldrivers source | |
| git clone --depth 1 --branch v${{ env.QT_VERSION }} https://github.com/qt/qtbase.git qtbase-src | |
| cd qtbase-src/src/plugins/sqldrivers | |
| # Configure using cmake | |
| cmake -B build -G "Ninja" \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DCMAKE_OSX_ARCHITECTURES=arm64 \ | |
| -DMySQL_INCLUDE_DIR="$MYSQL_INCLUDE_DIR" \ | |
| -DMySQL_LIBRARY="$MYSQL_LIB_DIR/libmysqlclient.dylib" | |
| # Qt's internal build system (BuildInternals) may override CMAKE_OSX_ARCHITECTURES | |
| # Force arm64 in the generated build files | |
| if [ -f "build/build.ninja" ]; then | |
| echo "Patching build.ninja to force arm64 architecture..." | |
| sed -i '' 's/-arch x86_64/-arch arm64/g' build/build.ninja | |
| fi | |
| cmake --build build --target qsqlmysql --config Release | |
| if [ -f "build/plugins/sqldrivers/libqsqlmysql.dylib" ]; then | |
| mkdir -p "$QT_PLUGIN_DIR" | |
| cp build/plugins/sqldrivers/libqsqlmysql.dylib "$QT_PLUGIN_DIR/" | |
| echo "Successfully built and installed MySQL plugin" | |
| echo "Plugin arch: $(file build/plugins/sqldrivers/libqsqlmysql.dylib)" | |
| fi | |
| cd ../../../.. | |
| else | |
| echo "MySQL plugin already available at $PLUGIN_PATH" | |
| fi | |
| - name: Configure CMake | |
| run: | | |
| cmake -B build -G "Ninja" \ | |
| -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ | |
| -DRATS_SEARCH_USE_SYSTEM_LIBRATS=OFF \ | |
| -DRATS_SEARCH_BUILD_TESTS=ON | |
| - name: Build | |
| run: cmake --build build --config ${{ env.BUILD_TYPE }} --parallel | |
| - name: Run tests | |
| run: | | |
| cd build | |
| ctest --output-on-failure --parallel | |
| - name: Copy Manticore binaries | |
| run: | | |
| BUNDLE_DIR="build/bin/RatsSearch.app/Contents/MacOS" | |
| # Copy Manticore binaries for macOS ARM | |
| cp imports/darwin/arm64/* "$BUNDLE_DIR/" || true | |
| chmod +x "$BUNDLE_DIR/searchd" "$BUNDLE_DIR/indexer" 2>/dev/null || true | |
| echo "Copied Manticore binaries:" | |
| ls -la "$BUNDLE_DIR/" | |
| - name: Get version | |
| id: version | |
| run: | | |
| if [[ "${{ github.ref }}" == refs/tags/* ]]; then | |
| VERSION="${{ github.ref_name }}" | |
| else | |
| VERSION="dev-$(echo ${{ github.sha }} | cut -c1-7)" | |
| fi | |
| echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Version: $VERSION" | |
| - name: Create DMG | |
| run: | | |
| VERSION="${{ steps.version.outputs.VERSION }}" | |
| DMG_NAME="RatsSearch-macOS-ARM-${VERSION}.dmg" | |
| # Create a temporary directory for DMG contents | |
| mkdir -p dmg-contents | |
| cp -R build/bin/RatsSearch.app dmg-contents/ | |
| ln -s /Applications dmg-contents/Applications | |
| # Create DMG | |
| hdiutil create \ | |
| -volname "Rats Search" \ | |
| -srcfolder dmg-contents \ | |
| -ov \ | |
| -format UDZO \ | |
| "$DMG_NAME" | |
| echo "Created: $DMG_NAME" | |
| ls -la "$DMG_NAME" | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: RatsSearch-macOS-ARM | |
| path: RatsSearch-macOS-ARM-*.dmg | |
| retention-days: 30 | |
| build-linux: | |
| runs-on: ubuntu-22.04 | |
| name: Linux x64 | |
| permissions: | |
| actions: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| persist-credentials: false | |
| - name: Install dependencies | |
| run: | | |
| sudo apt update | |
| sudo apt install -y \ | |
| build-essential \ | |
| ninja-build \ | |
| libgl1-mesa-dev \ | |
| libxkbcommon-dev \ | |
| libxkbcommon-x11-dev \ | |
| libxcb-xinerama0-dev \ | |
| libxcb-cursor-dev \ | |
| libxcb-cursor0 \ | |
| libfuse2 \ | |
| unzip | |
| - name: Install Qt | |
| uses: jurplel/install-qt-action@v4 | |
| with: | |
| version: ${{ env.QT_VERSION }} | |
| modules: qtwebsockets | |
| cache: true | |
| - name: Download Qt MySQL plugin | |
| run: | | |
| # Download pre-built Qt MySQL driver from thecodemonkey86 | |
| DRIVER_URL="https://github.com/thecodemonkey86/qt_mysql_driver/releases/download/qmysql_${{ env.QT_VERSION }}/libqsqlmysql.so_Qt_SQL_driver_${{ env.QT_VERSION }}_gcc_64-bit.zip" | |
| # Use QT_ROOT_DIR which is set by jurplel/install-qt-action | |
| QT_ROOT="${{ env.QT_ROOT_DIR }}" | |
| QT_PLUGIN_DIR="$QT_ROOT/plugins/sqldrivers" | |
| echo "Downloading MySQL driver from: $DRIVER_URL" | |
| echo "QT_ROOT_DIR is: ${{ env.QT_ROOT_DIR }}" | |
| echo "Qt root is: $QT_ROOT" | |
| echo "Plugin dir is: $QT_PLUGIN_DIR" | |
| wget -q "$DRIVER_URL" -O /tmp/qsqlmysql.zip | |
| unzip -o /tmp/qsqlmysql.zip -d /tmp/qsqlmysql | |
| # Copy plugin to Qt plugins directory | |
| mkdir -p "$QT_PLUGIN_DIR" | |
| cp /tmp/qsqlmysql/*.so "$QT_PLUGIN_DIR/" 2>/dev/null || \ | |
| cp /tmp/qsqlmysql/*/*.so "$QT_PLUGIN_DIR/" 2>/dev/null || true | |
| echo "Installed MySQL plugin:" | |
| ls -la "$QT_PLUGIN_DIR/" | |
| - name: Configure CMake | |
| run: | | |
| cmake -B build -G "Ninja" \ | |
| -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ | |
| -DCMAKE_INSTALL_PREFIX="/usr" \ | |
| -DRATS_SEARCH_USE_SYSTEM_LIBRATS=OFF \ | |
| -DRATS_SEARCH_BUILD_TESTS=ON | |
| - name: Build | |
| run: cmake --build build --config ${{ env.BUILD_TYPE }} --parallel | |
| - name: Run tests | |
| run: | | |
| cd build | |
| QT_QPA_PLATFORM=offscreen ctest --output-on-failure --parallel | |
| - name: Copy Manticore binaries | |
| run: | | |
| BIN_DIR="build/bin" | |
| # Copy Manticore binaries for Linux x64 | |
| cp imports/linux/x64/* "$BIN_DIR/" || true | |
| chmod +x "$BIN_DIR/searchd" "$BIN_DIR/indexer" 2>/dev/null || true | |
| echo "Copied Manticore binaries:" | |
| ls -la "$BIN_DIR/" | |
| - name: Get version | |
| id: version | |
| run: | | |
| if [[ "${{ github.ref }}" == refs/tags/* ]]; then | |
| VERSION="${{ github.ref_name }}" | |
| else | |
| VERSION="dev-$(echo ${{ github.sha }} | cut -c1-7)" | |
| fi | |
| echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Version: $VERSION" | |
| - name: Install linuxdeploy | |
| run: | | |
| curl -L -Z \ | |
| -O https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage \ | |
| -O https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage \ | |
| -O https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage | |
| chmod +x linuxdeploy-x86_64.AppImage linuxdeploy-plugin-qt-x86_64.AppImage linuxdeploy-plugin-appimage-x86_64.AppImage | |
| - name: Create AppImage | |
| run: | | |
| VERSION="${{ steps.version.outputs.VERSION }}" | |
| # Use QT_ROOT_DIR which is set by jurplel/install-qt-action | |
| QT_ROOT="${{ env.QT_ROOT_DIR }}" | |
| QT_PLUGIN_DIR="$QT_ROOT/plugins/sqldrivers" | |
| QT_LIB_DIR="$QT_ROOT/lib" | |
| echo "Qt root: $QT_ROOT" | |
| echo "Qt plugin dir: $QT_PLUGIN_DIR" | |
| echo "Qt lib dir: $QT_LIB_DIR" | |
| echo "Version: $VERSION" | |
| # Remove problematic SQL plugins that require unavailable dependencies | |
| # Oracle (libclntsh.so), Mimer, ODBC - we only need MySQL | |
| echo "Removing problematic SQL plugins..." | |
| rm -f "$QT_PLUGIN_DIR/libqsqloci.so" 2>/dev/null || true | |
| rm -f "$QT_PLUGIN_DIR/libqsqlmimer.so" 2>/dev/null || true | |
| rm -f "$QT_PLUGIN_DIR/libqsqlodbc.so" 2>/dev/null || true | |
| rm -f "$QT_PLUGIN_DIR/libqsqlpsql.so" 2>/dev/null || true | |
| echo "Remaining SQL plugins:" | |
| ls -la "$QT_PLUGIN_DIR/" || true | |
| # Create AppDir structure | |
| mkdir -p AppDir/usr/bin | |
| mkdir -p AppDir/usr/lib | |
| mkdir -p AppDir/usr/share/applications | |
| mkdir -p AppDir/usr/share/icons/hicolor/512x512/apps | |
| mkdir -p AppDir/usr/plugins/sqldrivers | |
| # Copy executable and Manticore binaries | |
| cp build/bin/RatsSearch AppDir/usr/bin/ | |
| cp build/bin/searchd AppDir/usr/bin/ 2>/dev/null || true | |
| cp build/bin/indexer AppDir/usr/bin/ 2>/dev/null || true | |
| cp build/bin/indextool AppDir/usr/bin/ 2>/dev/null || true | |
| # Copy MySQL plugin | |
| if [ -f "$QT_PLUGIN_DIR/libqsqlmysql.so" ]; then | |
| cp "$QT_PLUGIN_DIR/libqsqlmysql.so" AppDir/usr/plugins/sqldrivers/ | |
| fi | |
| # Create desktop file | |
| printf '%s\n' \ | |
| '[Desktop Entry]' \ | |
| 'Type=Application' \ | |
| 'Name=Rats Search' \ | |
| 'Exec=RatsSearch' \ | |
| 'Icon=ratssearch' \ | |
| 'Categories=Network;P2P;' \ | |
| 'Comment=DHT Torrent Search Engine' \ | |
| > AppDir/usr/share/applications/ratssearch.desktop | |
| # Copy icon | |
| cp resources/icons/512x512.png AppDir/usr/share/icons/hicolor/512x512/apps/ratssearch.png | |
| # Create symlinks for AppImage | |
| ln -sf usr/share/applications/ratssearch.desktop AppDir/ratssearch.desktop | |
| ln -sf usr/share/icons/hicolor/512x512/apps/ratssearch.png AppDir/ratssearch.png | |
| # Run linuxdeploy with Qt plugin | |
| OUTPUT="RatsSearch-Linux-x64-${VERSION}.AppImage" \ | |
| ./linuxdeploy-x86_64.AppImage \ | |
| --appdir AppDir \ | |
| --plugin qt \ | |
| --output appimage || APPIMAGE_FAILED=1 | |
| # If AppImage creation failed, create a tar.gz instead | |
| if [ "${APPIMAGE_FAILED:-0}" = "1" ] || [ ! -f "RatsSearch-Linux-x64-${VERSION}.AppImage" ]; then | |
| echo "AppImage creation failed, creating tar.gz package instead" | |
| mkdir -p RatsSearch-Linux-x64 | |
| cp -r build/bin/* RatsSearch-Linux-x64/ | |
| # Create lib and plugins directories | |
| mkdir -p RatsSearch-Linux-x64/lib | |
| mkdir -p RatsSearch-Linux-x64/plugins/sqldrivers | |
| mkdir -p RatsSearch-Linux-x64/plugins/platforms | |
| mkdir -p RatsSearch-Linux-x64/plugins/xcbglintegrations | |
| mkdir -p RatsSearch-Linux-x64/plugins/wayland-shell-integration | |
| mkdir -p RatsSearch-Linux-x64/plugins/wayland-decoration-client | |
| mkdir -p RatsSearch-Linux-x64/plugins/wayland-graphics-integration-client | |
| mkdir -p RatsSearch-Linux-x64/plugins/imageformats | |
| mkdir -p RatsSearch-Linux-x64/plugins/iconengines | |
| mkdir -p RatsSearch-Linux-x64/plugins/tls | |
| # Copy Qt core libraries | |
| echo "Copying Qt libraries..." | |
| for lib in Core Gui Widgets Network WebSockets Sql Svg DBus XcbQpa WaylandClient WaylandEglClientHwIntegration OpenGL; do | |
| if [ -f "$QT_LIB_DIR/libQt6${lib}.so.6" ]; then | |
| cp -L "$QT_LIB_DIR/libQt6${lib}.so.6" RatsSearch-Linux-x64/lib/ | |
| echo " Copied libQt6${lib}.so.6" | |
| fi | |
| done | |
| # Copy ICU libraries (required by Qt) | |
| for lib in "$QT_LIB_DIR"/libicu*.so.*; do | |
| if [ -f "$lib" ]; then | |
| cp -L "$lib" RatsSearch-Linux-x64/lib/ | |
| echo " Copied $(basename $lib)" | |
| fi | |
| done | |
| # Copy MySQL plugin | |
| if [ -f "$QT_PLUGIN_DIR/libqsqlmysql.so" ]; then | |
| cp "$QT_PLUGIN_DIR/libqsqlmysql.so" RatsSearch-Linux-x64/plugins/sqldrivers/ | |
| echo " Copied libqsqlmysql.so" | |
| fi | |
| # Copy SQLite plugin (built-in, useful fallback) | |
| if [ -f "$QT_PLUGIN_DIR/libqsqlite.so" ]; then | |
| cp "$QT_PLUGIN_DIR/libqsqlite.so" RatsSearch-Linux-x64/plugins/sqldrivers/ | |
| echo " Copied libqsqlite.so" | |
| fi | |
| # Copy platform plugins | |
| if [ -d "$QT_ROOT/plugins/platforms" ]; then | |
| cp "$QT_ROOT/plugins/platforms/libqxcb.so" RatsSearch-Linux-x64/plugins/platforms/ 2>/dev/null || true | |
| cp "$QT_ROOT/plugins/platforms/libqwayland"*.so RatsSearch-Linux-x64/plugins/platforms/ 2>/dev/null || true | |
| cp "$QT_ROOT/plugins/platforms/libqoffscreen.so" RatsSearch-Linux-x64/plugins/platforms/ 2>/dev/null || true | |
| echo " Copied platform plugins" | |
| fi | |
| # Copy xcbglintegrations plugins | |
| if [ -d "$QT_ROOT/plugins/xcbglintegrations" ]; then | |
| cp "$QT_ROOT/plugins/xcbglintegrations/"*.so RatsSearch-Linux-x64/plugins/xcbglintegrations/ 2>/dev/null || true | |
| echo " Copied xcbglintegrations plugins" | |
| fi | |
| # Copy imageformats plugins | |
| if [ -d "$QT_ROOT/plugins/imageformats" ]; then | |
| cp "$QT_ROOT/plugins/imageformats/"*.so RatsSearch-Linux-x64/plugins/imageformats/ 2>/dev/null || true | |
| echo " Copied imageformats plugins" | |
| fi | |
| # Copy iconengines plugins | |
| if [ -d "$QT_ROOT/plugins/iconengines" ]; then | |
| cp "$QT_ROOT/plugins/iconengines/"*.so RatsSearch-Linux-x64/plugins/iconengines/ 2>/dev/null || true | |
| echo " Copied iconengines plugins" | |
| fi | |
| # Copy TLS plugins | |
| if [ -d "$QT_ROOT/plugins/tls" ]; then | |
| cp "$QT_ROOT/plugins/tls/"*.so RatsSearch-Linux-x64/plugins/tls/ 2>/dev/null || true | |
| echo " Copied tls plugins" | |
| fi | |
| # Create qt.conf to tell Qt where to find plugins | |
| printf '%s\n' \ | |
| '[Paths]' \ | |
| 'Prefix = .' \ | |
| 'Plugins = plugins' \ | |
| 'Libraries = lib' \ | |
| > RatsSearch-Linux-x64/qt.conf | |
| # Create launcher script | |
| printf '%s\n' \ | |
| '#!/bin/bash' \ | |
| 'SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"' \ | |
| 'export LD_LIBRARY_PATH="$SCRIPT_DIR/lib:$LD_LIBRARY_PATH"' \ | |
| 'export QT_PLUGIN_PATH="$SCRIPT_DIR/plugins"' \ | |
| 'export QT_QPA_PLATFORM_PLUGIN_PATH="$SCRIPT_DIR/plugins/platforms"' \ | |
| 'exec "$SCRIPT_DIR/RatsSearch" "$@"' \ | |
| > RatsSearch-Linux-x64/run.sh | |
| chmod +x RatsSearch-Linux-x64/run.sh | |
| echo "Package contents:" | |
| find RatsSearch-Linux-x64 -type f | head -50 | |
| tar -czvf "RatsSearch-Linux-x64-${VERSION}.tar.gz" RatsSearch-Linux-x64 | |
| fi | |
| - name: Upload artifact (AppImage) | |
| uses: actions/upload-artifact@v5 | |
| if: hashFiles('RatsSearch-Linux-x64-*.AppImage') != '' | |
| with: | |
| name: RatsSearch-Linux-x64-AppImage | |
| path: RatsSearch-Linux-x64-*.AppImage | |
| retention-days: 30 | |
| - name: Upload artifact (tar.gz) | |
| uses: actions/upload-artifact@v5 | |
| if: hashFiles('RatsSearch-Linux-x64-*.tar.gz') != '' | |
| with: | |
| name: RatsSearch-Linux-x64 | |
| path: RatsSearch-Linux-x64-*.tar.gz | |
| retention-days: 30 | |
| release: | |
| needs: [build-windows, build-linux, build-macos-arm] | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Generate changelog for release | |
| id: changelog | |
| uses: orhun/git-cliff-action@v4 | |
| with: | |
| config: cliff.toml | |
| args: --latest --strip header --github-repo ${{ github.repository }} | |
| env: | |
| OUTPUT: CHANGES.md | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v5 | |
| with: | |
| path: artifacts | |
| - name: Display structure of downloaded files | |
| run: ls -R artifacts | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| artifacts/**/*.zip | |
| artifacts/**/*.exe | |
| artifacts/**/*.dmg | |
| artifacts/**/*.AppImage | |
| artifacts/**/*.tar.gz | |
| draft: false | |
| prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc') }} | |
| body: ${{ steps.changelog.outputs.content }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |