Fix simulation actions not updating during server runtime #2
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 ModbusTools | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ['v*'] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| VERSION: '0.4.9' | |
| jobs: | |
| # --------------------------------------------------------------------------- | |
| # Linux: Build AppImages | |
| # --------------------------------------------------------------------------- | |
| linux: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| cmake g++ \ | |
| qt6-base-dev qt6-tools-dev qt6-tools-dev-tools \ | |
| libqt6core5compat6-dev libqt6help6 \ | |
| libgl1-mesa-dev \ | |
| doxygen \ | |
| librsvg2-bin \ | |
| wget fuse libfuse2 | |
| - name: Configure | |
| run: | | |
| cmake -B build \ | |
| -DCMAKE_INSTALL_PREFIX=/usr \ | |
| -DCMAKE_BUILD_TYPE=Release | |
| - name: Build | |
| run: cmake --build build -j$(nproc) | |
| - name: Download linuxdeploy tools | |
| run: | | |
| mkdir -p build/tools | |
| wget -q -O build/tools/linuxdeploy-x86_64.AppImage \ | |
| https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage | |
| wget -q -O build/tools/linuxdeploy-plugin-qt-x86_64.AppImage \ | |
| https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage | |
| chmod +x build/tools/*.AppImage | |
| - name: Build Client AppImage | |
| run: | | |
| APPDIR=build/AppDir-client | |
| rm -rf "$APPDIR" | |
| mkdir -p "$APPDIR/usr/bin" "$APPDIR/usr/lib" | |
| mkdir -p "$APPDIR/usr/share/applications" | |
| mkdir -p "$APPDIR/usr/share/icons/hicolor/scalable/apps" | |
| cp build/client "$APPDIR/usr/bin/" | |
| cp -a build/libmodbus.so* "$APPDIR/usr/lib/" | |
| cp -a build/libcore.so* "$APPDIR/usr/lib/" | |
| sed 's|Exec=/opt/modbustools/client|Exec=client|' \ | |
| packaging/modbustools-client.desktop \ | |
| > "$APPDIR/usr/share/applications/modbustools-client.desktop" | |
| cp src/client/gui/icons/client.svg \ | |
| "$APPDIR/usr/share/icons/hicolor/scalable/apps/modbustools-client.svg" | |
| for size in 48 128 256; do | |
| mkdir -p "$APPDIR/usr/share/icons/hicolor/${size}x${size}/apps" | |
| rsvg-convert -w $size -h $size src/client/gui/icons/client.svg \ | |
| -o "$APPDIR/usr/share/icons/hicolor/${size}x${size}/apps/modbustools-client.png" | |
| done | |
| export QMAKE=$(which qmake6 2>/dev/null || which qmake) | |
| OUTPUT="ModbusTools_Client-${{ env.VERSION }}-x86_64.AppImage" \ | |
| build/tools/linuxdeploy-x86_64.AppImage \ | |
| --appdir "$APPDIR" \ | |
| --desktop-file "$APPDIR/usr/share/applications/modbustools-client.desktop" \ | |
| --icon-file "$APPDIR/usr/share/icons/hicolor/scalable/apps/modbustools-client.svg" \ | |
| --plugin qt \ | |
| --output appimage | |
| - name: Build Server AppImage | |
| run: | | |
| APPDIR=build/AppDir-server | |
| rm -rf "$APPDIR" | |
| mkdir -p "$APPDIR/usr/bin" "$APPDIR/usr/lib" | |
| mkdir -p "$APPDIR/usr/share/applications" | |
| mkdir -p "$APPDIR/usr/share/icons/hicolor/scalable/apps" | |
| mkdir -p "$APPDIR/usr/script/server" | |
| cp build/server "$APPDIR/usr/bin/" | |
| cp -a build/libmodbus.so* "$APPDIR/usr/lib/" | |
| cp -a build/libcore.so* "$APPDIR/usr/lib/" | |
| cp -f src/server/python/*.py "$APPDIR/usr/script/server/" 2>/dev/null || true | |
| sed 's|Exec=/opt/modbustools/server|Exec=server|' \ | |
| packaging/modbustools-server.desktop \ | |
| > "$APPDIR/usr/share/applications/modbustools-server.desktop" | |
| cp src/server/gui/icons/server.svg \ | |
| "$APPDIR/usr/share/icons/hicolor/scalable/apps/modbustools-server.svg" | |
| for size in 48 128 256; do | |
| mkdir -p "$APPDIR/usr/share/icons/hicolor/${size}x${size}/apps" | |
| rsvg-convert -w $size -h $size src/server/gui/icons/server.svg \ | |
| -o "$APPDIR/usr/share/icons/hicolor/${size}x${size}/apps/modbustools-server.png" | |
| done | |
| export QMAKE=$(which qmake6 2>/dev/null || which qmake) | |
| OUTPUT="ModbusTools_Server-${{ env.VERSION }}-x86_64.AppImage" \ | |
| build/tools/linuxdeploy-x86_64.AppImage \ | |
| --appdir "$APPDIR" \ | |
| --desktop-file "$APPDIR/usr/share/applications/modbustools-server.desktop" \ | |
| --icon-file "$APPDIR/usr/share/icons/hicolor/scalable/apps/modbustools-server.svg" \ | |
| --plugin qt \ | |
| --output appimage | |
| - name: Upload AppImages | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-appimages | |
| path: | | |
| ModbusTools_Client-*.AppImage | |
| ModbusTools_Server-*.AppImage | |
| # --------------------------------------------------------------------------- | |
| # Windows: Build ZIP with Qt DLLs | |
| # --------------------------------------------------------------------------- | |
| windows: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Qt6 | |
| uses: jurplel/install-qt-action@v4 | |
| with: | |
| version: '6.7.*' | |
| host: windows | |
| target: desktop | |
| arch: win64_msvc2019_64 | |
| modules: 'qt5compat' | |
| - name: Configure | |
| shell: cmd | |
| run: | | |
| cmake -B build ^ | |
| -DCMAKE_BUILD_TYPE=Release ^ | |
| -DCMAKE_PREFIX_PATH="%Qt6_DIR%" | |
| - name: Build | |
| shell: cmd | |
| run: cmake --build build --config Release | |
| - name: Package with windeployqt | |
| shell: cmd | |
| run: | | |
| mkdir dist | |
| copy build\Release\client.exe dist\ | |
| copy build\Release\server.exe dist\ | |
| copy build\Release\modbus.dll dist\ | |
| copy build\Release\core.dll dist\ | |
| REM Copy scripts | |
| mkdir dist\script\server | |
| copy src\server\python\*.py dist\script\server\ | |
| REM Copy help files if they exist | |
| if exist build\doc\output mkdir dist\help | |
| if exist build\doc\output\*.qch copy build\doc\output\*.qch dist\help\ | |
| if exist build\doc\output\*.qhc copy build\doc\output\*.qhc dist\help\ | |
| REM Run windeployqt on both executables | |
| windeployqt --release --no-translations dist\client.exe | |
| windeployqt --release --no-translations dist\server.exe | |
| - name: Create ZIP archive | |
| shell: powershell | |
| run: | | |
| Compress-Archive -Path dist\* -DestinationPath "ModbusTools-${{ env.VERSION }}-windows-x64.zip" | |
| - name: Upload Windows build | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-build | |
| path: ModbusTools-${{ env.VERSION }}-windows-x64.zip | |
| # --------------------------------------------------------------------------- | |
| # Release: Publish artifacts on tag push | |
| # --------------------------------------------------------------------------- | |
| release: | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| needs: [linux, windows] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| draft: false | |
| generate_release_notes: true | |
| files: | | |
| linux-appimages/ModbusTools_Client-*.AppImage | |
| linux-appimages/ModbusTools_Server-*.AppImage | |
| windows-build/ModbusTools-*-windows-x64.zip |