Merge pull request #7 from Samueru-sama/patch-1 #98
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: CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| # pull_request: | |
| # branches: | |
| # - master | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-24.04,ubuntu-24.04-arm] #[ubuntu-20.04, macos-latest, windows-latest] | |
| fail-fast: false | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - name: Install dependencies (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y qt5-default || true | |
| sudo apt-get install -y qt5ct dos2unix || true | |
| sudo apt-get install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools || true # Suppress errors | |
| sudo apt-get install -y libgl1-mesa-dri xvfb libudev-dev libusb-1.0-0-dev libboost-all-dev libfuse2 fuse3 #qtwayland5 | |
| sudo apt-get install -y qttools5-dev qtdeclarative5-dev libqt5svg5-dev libqt5opengl5-dev cmake | |
| sudo apt-get install -y qml-module-qtquick2 qml-module-qtquick-extras qml-module-qtquick-window2 qml-module-qtquick-controls2 qml-module-qtquick-controls qml-module-qtgraphicaleffects qml-module-qtquick-dialogs | |
| sudo apt-get install -y qml-module-qt-labs-settings qml-module-qt-labs-folderlistmodel qml-module-qtqml-models2 | |
| - name: Install dependencies (macOS) | |
| if: runner.os == 'macOS' | |
| run: | | |
| brew update | |
| brew install libusb qt@5 boost | |
| brew upgrade qt@5 | |
| brew link libusb | |
| brew link qt | |
| echo "/usr/local/opt/qt/bin" >> $GITHUB_PATH | |
| - name: Install dependencies (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| choco install innosetup | |
| choco install 7zip | |
| choco install git | |
| choco install msys2 | |
| refreshenv | |
| C:\msys64\usr\bin\bash -lc "pacman -Syu --noconfirm" | |
| C:\msys64\usr\bin\bash -lc "pacman --noconfirm -Sy mingw-w64-i686-boost mingw-w64-i686-python3 mingw-w64-i686-libzip mingw-w64-i686-icu" | |
| C:\msys64\usr\bin\bash -lc "pacman --noconfirm -Sy mingw-w64-x86_64-boost mingw-w64-x86_64-python3 mingw-w64-x86_64-libzip mingw-w64-x86_64-icu mingw-w64-x86_64-toolchain" | |
| - name: Clone and build libsmu (Linux and macOS)(macOS disabled) | |
| if: runner.os == 'Linux' | |
| run: | | |
| git clone https://github.com/sounddrill31/libsmu.git | |
| cd libsmu | |
| mkdir build && cd build | |
| cmake -DBUILD_PYTHON=OFF -DCMAKE_INSTALL_PREFIX=/usr/ .. | |
| make | |
| sudo make install | |
| cd ../.. | |
| - name: Clone and build libsmu (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| git clone https://github.com/sounddrill31/libsmu.git C:\projects\libsmu | |
| mkdir C:\projects\libsmu\build && cd C:\projects\libsmu\build | |
| cmake -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=C:\msys64\mingw64 -DCMAKE_C_COMPILER=C:\msys64\mingw64\bin\x86_64-w64-mingw32-gcc.exe -DCMAKE_CXX_COMPILER=C:\msys64\mingw64\bin\x86_64-w64-mingw32-g++.exe -DBUILD_PYTHON=OFF .. | |
| mingw32-make | |
| mingw32-make install | |
| cd C:\projects\libsmu | |
| - name: Build Pixelpulse2 (Linux and macOS)(macOS disabled) | |
| if: runner.os == 'Linux' | |
| run: | | |
| mkdir build && cd build | |
| cmake .. | |
| make | |
| sudo make install | |
| cd .. | |
| - name: Build Pixelpulse2 (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| mkdir C:\projects\pixelpulse2\build && cd C:\projects\pixelpulse2\build | |
| cmake -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=C:\msys64\mingw64 -DCMAKE_C_COMPILER=C:\msys64\mingw64\bin\x86_64-w64-mingw32-gcc.exe -DCMAKE_CXX_COMPILER=C:\msys64\mingw64\bin\x86_64-w64-mingw32-g++.exe .. | |
| mingw32-make | |
| - name: Run macOS specific steps | |
| if: runner.os == 'macOS' | |
| run: | | |
| cd build | |
| /usr/local/opt/qt/bin/macdeployqt pixelpulse2.app -always-overwrite -verbose=2 -qmldir=../qml | |
| cd .. | |
| libsmupath="$(otool -L ./build/pixelpulse2.app/Contents/MacOS/pixelpulse2 | grep libsmu | cut -d " " -f 1)" | |
| libsmuid="$(echo ${libsmupath} | rev | cut -d "/" -f 1 | rev)" | |
| cp libsmu/build/src/${libsmuid} build/pixelpulse2.app/Contents/Frameworks/ | |
| sudo install_name_tool -id @executable_path/../Frameworks/${libsmuid} build/pixelpulse2.app/Contents/Frameworks/${libsmuid} | |
| sudo install_name_tool -change ${libsmupath} @executable_path/../Frameworks/${libsmuid} build/pixelpulse2.app/Contents/MacOS/Pixelpulse2 | |
| cd build | |
| /usr/local/opt/qt/bin/macdeployqt pixelpulse2.app -dmg -no-plugins | |
| for x in *.dmg ; do mv $x ${x%.dmg}${LDIST}.dmg ; done | |
| cd .. | |
| - name: Create Windows installer | |
| if: runner.os == 'Windows' | |
| run: | | |
| cd C:\projects\pixelpulse2\build | |
| "C:\Program Files (x86)\Inno Setup 5\ISCC.exe" pixelpulse2.iss | |
| - name: Upload Release Asset (macOS) | |
| if: runner.os == 'macOS' | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| target_commitish: ${{ github.ref_name }} | |
| files: build/*.dmg | |
| name: pixelpulse2-${{ github.ref_name }}.dmg | |
| tag_name: ${{ github.run_id }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload Release Asset (Windows) | |
| if: runner.os == 'Windows' | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| target_commitish: ${{ github.ref_name }} | |
| files: build/Pixelpulse2_win_setup.exe | |
| name: pixelpulse2-${{ github.ref_name }}.exe | |
| tag_name: ${{ github.run_id }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create AppImage with Dependencies (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| export ARCH="$(uname -m)" | |
| export VERSION="$(echo "$GITHUB_SHA" | cut -c 1-9)" | |
| export APP=Pixelpulse2 | |
| # Prepare AppDir structure | |
| mkdir -p AppDir/shared/lib | |
| mkdir -p AppDir/usr/share/icons/hicolor/scalable/apps/ | |
| mkdir -p AppDir/usr/share/applications | |
| mkdir -p AppDir/usr/share/pixelpulse2/ | |
| ln -s ./usr/share ./AppDir/share | |
| # Copy libsmu library | |
| cp /usr/lib/$ARCH-linux-gnu/libsmu.so.1.0.4 AppDir/shared/lib | |
| ln -s ./libsmu.so.1.0.4 AppDir/shared/lib/libsmu.so.1 | |
| ln -s ./libsmu.so.1.0.4 AppDir/shared/lib/libsmu.so | |
| # Copy icon | |
| cp /usr/share/icons/hicolor/apps/scalable/pp2.ico AppDir/usr/share/icons/hicolor/scalable/apps/ | |
| cp /usr/share/icons/hicolor/apps/scalable/pp2.ico AppDir | |
| ln -s ./pp2.ico ./AppDir/.DirIcon | |
| ln -s ./pp2.ico ./AppDir/pp2.png | |
| # Copy .desktop file and runner script | |
| cp debian/AppRun AppDir/AppRun | |
| chmod +x AppDir/AppRun | |
| dos2unix AppDir/AppRun # just in case | |
| cp debian/*.desktop AppDir | |
| # Copy key system libraries that might not be auto-detected | |
| # Note: Be selective and only include necessary libraries | |
| cp /usr/lib/$ARCH-linux-gnu/libudev.so.1 AppDir/shared/lib/ | |
| cp /usr/lib/$ARCH-linux-gnu/libusb-1.0.so.0 AppDir/shared/lib/ | |
| # Copy udev rules | |
| mkdir -p AppDir/etc/udev/rules.d | |
| cp /etc/udev/rules.d/53-adi-m1k-usb.rules AppDir/etc/udev/rules.d/ | |
| # Hack: Use uaccess along with plugdev | |
| sed -i 's/GROUP="plugdev"/GROUP="plugdev", TAG+="uaccess"/g' AppDir/etc/udev/rules.d/53-adi-m1k-usb.rules | |
| cp -r qml AppDir/usr/share/pixelpulse2/ | |
| ( export ARCH="$(uname -m)" # Just to be double sure | |
| cd AppDir | |
| wget "https://raw.githubusercontent.com/VHSgunzo/sharun/refs/heads/main/lib4bin" -O ./lib4bin | |
| chmod +x ./lib4bin | |
| xvfb-run -a -- ./lib4bin -p -v -e -k -w \ | |
| /usr/bin/pixelpulse2 \ | |
| /usr/lib/$ARCH-linux-gnu/libvulkan* \ | |
| /usr/lib/$ARCH-linux-gnu/libEGL* \ | |
| /usr/lib/$ARCH-linux-gnu/libgallium-* \ | |
| /usr/lib/$ARCH-linux-gnu/dri/* \ | |
| /usr/lib/$ARCH-linux-gnu/qt5/plugins/*/* | |
| # copy all of qml | |
| cp -rv /usr/lib/$ARCH-linux-gnu/qt5/qml ./shared/lib/qt5 | |
| # ln ./sharun ./AppRun | |
| ./sharun -g | |
| ) | |
| wget "https://github.com/VHSgunzo/uruntime/releases/latest/download/uruntime-appimage-dwarfs-$ARCH" -O uruntime | |
| chmod +x ./uruntime | |
| ./uruntime --appimage-mkdwarfs -f \ | |
| --set-owner 0 --set-group 0 \ | |
| --no-history --no-create-timestamp \ | |
| --compression zstd:level=22 -S26 -B32 \ | |
| --header uruntime \ | |
| -i ./AppDir -o "$APP"-anylinux-"$ARCH".AppImage | |
| # List the generated AppImage | |
| ls -l Pixelpulse2*.AppImage | |
| - name: Upload Release Asset (Linux/AppImage) | |
| if: runner.os == 'linux' | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| target_commitish: ${{ github.ref_name }} | |
| files: Pixelpulse2*.AppImage | |
| name: Pixelpulse2-${{ github.ref_name }}.AppImage | |
| tag_name: ${{ github.run_id }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |