Conversation
- add Linux, macOS, and Windows CI definitions - update gitignore, README, and add Modbus diagram
- Add new GitHub Actions workflow for Linux packaging - Add new GitHub Actions workflow for macOS packaging - Rename ci_setup_windows.yml to ci_package_windows.yml for consistency
Update CI package workflows for Linux, macOS, and Windows. Add .gitignore file for the Windows package directory.
- fix(ci): add pull_request trigger for package workflows (master/main only) - fix(ci): correct Windows binary path to bin\Release\mbpoll.exe - fix(cmake): use GNUInstallDirs for man page installation path - fix(contributing): correct indentation style to 2-space - chore: remove CLAUDE.md from shared .gitignore
There was a problem hiding this comment.
Pull request overview
This PR modernizes packaging/build automation and documentation across platforms (Linux/macOS/Windows), and adds a Unix man page installation path via CMake to improve distribution readiness.
Changes:
- Split CI into per-platform build workflows and added package workflows (deb/pkg/Windows setup) with appropriate triggers.
- Updated Windows installer (Inno Setup) to use CMake build output pathing and x64 VC++ redistributable.
- Refreshed documentation (README + new CONTRIBUTING) and added a man page installed via
GNUInstallDirs.
Reviewed changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| package/win/mbpoll.iss | Update Inno Setup script for overridable build dir/version, x64 install defaults, and x64 VC++ redist. |
| package/win/.gitignore | Ignore Windows packaging output directories (installer/, tmp/). |
| doc/modbus.png | Add Modbus logo used by README. |
| doc/mbpoll.1 | Add man page for Unix systems. |
| README.md | Add badges, update install instructions, reference man page, and update contributing/license sections. |
| CONTRIBUTING.md | Add contributor guidelines and branch strategy documentation. |
| CMakeLists.txt | Use GNUInstallDirs and install doc/mbpoll.1 under ${CMAKE_INSTALL_MANDIR}/man1 on Unix. |
| .gitignore | Stop ignoring CLAUDE.md and ignore cmake-build-* directories. |
| .github/workflows/ci_package_windows.yml | Add Windows setup packaging workflow (Inno Setup) and release upload on tags. |
| .github/workflows/ci_package_macos.yml | Add macOS packaging workflow (pkg + tar.gz) and release upload on tags. |
| .github/workflows/ci_package_linux.yml | Add Debian package workflow (CPack) and release upload on tags. |
| .github/workflows/ci_build_windows.yml | Add Windows build-and-test workflow. |
| .github/workflows/ci_build_macos.yml | Add macOS build-and-test workflow. |
| .github/workflows/ci_build_linux.yml | Add Linux build-and-test workflow (Release/Debug matrix). |
| .github/workflows/ci.yml | Remove monolithic CI workflow in favor of split workflows. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Clone libmodbus | ||
| run: git clone https://github.com/stephane/libmodbus.git |
There was a problem hiding this comment.
This clones libmodbus from the default branch without pinning to a tag/commit, which makes CI non-reproducible and can break unexpectedly if upstream changes. Consider pinning to a specific release tag or commit SHA (and optionally verifying it).
| run: git clone https://github.com/stephane/libmodbus.git | |
| run: git clone --branch v3.1.10 --depth 1 https://github.com/stephane/libmodbus.git |
| the Free Software Foundation, either version 3 of the License, or | ||
| (at your option) any later version. | ||
| Pull requests are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) before submitting. | ||
| All contributions must target the `dev` branch — `master` is reserved for stable releases only. |
There was a problem hiding this comment.
Docs mention only master as the stable branch, but CI/workflows in this PR treat both master and main as release branches. Please align documentation with the actual branch strategy (either document main too, or remove main from workflows if it isn't used).
| All contributions must target the `dev` branch — `master` is reserved for stable releases only. | |
| All contributions must target the `dev` branch — `master` and `main` are reserved for stable releases only. |
| | Branch | Purpose | | ||
| |-----------|----------------------------------| | ||
| | `master` | Stable releases only | | ||
| | `dev` | Active development, PR target | |
There was a problem hiding this comment.
The branch strategy here only mentions master/dev, but the CI workflows in this PR are configured for both master and main. Please update this document to reflect whether main is also a stable/release branch (or adjust workflows if not).
| DEB_FILE=$(ls build/*.deb) | ||
| ARCH=$(dpkg --print-architecture) | ||
| VERSION=$(dpkg-deb -f $DEB_FILE Version) | ||
| echo "DEB_FILE=$DEB_FILE" >> $GITHUB_OUTPUT | ||
| echo "DEB_NAME=mbpoll_${VERSION}_linux_${ARCH}" >> $GITHUB_OUTPUT | ||
| dpkg-deb --info $DEB_FILE | ||
| echo "---" | ||
| dpkg-deb --contents $DEB_FILE |
There was a problem hiding this comment.
DEB_FILE=$(ls build/*.deb) will break if CPack generates more than one .deb (or none). That results in dpkg-deb -f receiving multiple paths and failing. Prefer a deterministic selection (e.g., pick the first match) and add an explicit error if no package is found.
| DEB_FILE=$(ls build/*.deb) | |
| ARCH=$(dpkg --print-architecture) | |
| VERSION=$(dpkg-deb -f $DEB_FILE Version) | |
| echo "DEB_FILE=$DEB_FILE" >> $GITHUB_OUTPUT | |
| echo "DEB_NAME=mbpoll_${VERSION}_linux_${ARCH}" >> $GITHUB_OUTPUT | |
| dpkg-deb --info $DEB_FILE | |
| echo "---" | |
| dpkg-deb --contents $DEB_FILE | |
| shopt -s nullglob | |
| deb_files=(build/*.deb) | |
| if [ ${#deb_files[@]} -eq 0 ]; then | |
| echo "Error: no .deb package found in build/ directory" >&2 | |
| exit 1 | |
| fi | |
| DEB_FILE="${deb_files[0]}" | |
| ARCH=$(dpkg --print-architecture) | |
| VERSION=$(dpkg-deb -f "$DEB_FILE" Version) | |
| echo "DEB_FILE=$DEB_FILE" >> "$GITHUB_OUTPUT" | |
| echo "DEB_NAME=mbpoll_${VERSION}_linux_${ARCH}" >> "$GITHUB_OUTPUT" | |
| dpkg-deb --info "$DEB_FILE" | |
| echo "---" | |
| dpkg-deb --contents "$DEB_FILE" |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 15 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Check binary | ||
| run: | | ||
| .\build\bin\Release\mbpoll.exe -V | ||
| .\build\bin\Release\mbpoll.exe -h | ||
| continue-on-error: true |
There was a problem hiding this comment.
continue-on-error: true on the binary check will allow the workflow to succeed even if the built executable is missing or crashes, which can result in publishing a broken installer artifact. Prefer to fail the job if mbpoll.exe -V fails (and, if needed, only tolerate -h by appending || true to that line).
| - name: Check binary | ||
| run: | | ||
| .\build\bin\Release\mbpoll.exe -V | ||
| .\build\bin\Release\mbpoll.exe -h | ||
| continue-on-error: true |
There was a problem hiding this comment.
continue-on-error: true on the binary check means CI can pass even when the executable is missing or failing to run, reducing the signal from this workflow. Consider making mbpoll.exe -V a required check (and only ignore -h if necessary).
| wget -O- http://www.piduino.org/piduino-key.asc | sudo apt-key add - | ||
| sudo add-apt-repository 'deb http://apt.piduino.org stretch piduino' | ||
| wget -O- http://www.piduino.org/piduino-key.asc | sudo gpg --dearmor --yes --output /usr/share/keyrings/piduino-archive-keyring.gpg | ||
| echo "deb [signed-by=/usr/share/keyrings/piduino-archive-keyring.gpg] http://apt.piduino.org $(lsb_release -c -s) piduino" | sudo tee /etc/apt/sources.list.d/piduino.list |
There was a problem hiding this comment.
The Quickstart APT snippet depends on lsb_release being installed ($(lsb_release -c -s)), which is not present on some minimal Debian/Ubuntu installs. Consider either documenting that prerequisite (install lsb-release) or switching to a more universally available source (e.g., /etc/os-release) for the codename to avoid copy/paste failures.
| echo "deb [signed-by=/usr/share/keyrings/piduino-archive-keyring.gpg] http://apt.piduino.org $(lsb_release -c -s) piduino" | sudo tee /etc/apt/sources.list.d/piduino.list | |
| . /etc/os-release && echo "deb [signed-by=/usr/share/keyrings/piduino-archive-keyring.gpg] http://apt.piduino.org ${VERSION_CODENAME} piduino" | sudo tee /etc/apt/sources.list.d/piduino.list |
| ; VERSION can be overridden from the command line: | ||
| ; iscc /DVERSION=1.5.3 mbpoll.iss | ||
| ; BUILDDIR can be overridden to point to the CMake build output: | ||
| ; iscc /DBUILDDIR=..\..\build\bin\Release mbpoll.iss | ||
|
|
||
| #ifndef VERSION | ||
| #define VERSION "1.5.3" | ||
| #endif | ||
| #ifndef BUILDDIR | ||
| #define BUILDDIR "..\..\build\bin\Release" |
There was a problem hiding this comment.
The installer script hard-codes fallback defaults for VERSION and BUILDDIR (e.g., 1.5.3 and ..\..\build\bin\Release). This is easy to forget to update and can silently produce installers with incorrect version metadata or missing files when building outside the CI path. Consider deriving the defaults from a single source of truth (e.g., CMake/project version) or requiring these to be passed explicitly from the build workflow.
| ; VERSION can be overridden from the command line: | |
| ; iscc /DVERSION=1.5.3 mbpoll.iss | |
| ; BUILDDIR can be overridden to point to the CMake build output: | |
| ; iscc /DBUILDDIR=..\..\build\bin\Release mbpoll.iss | |
| #ifndef VERSION | |
| #define VERSION "1.5.3" | |
| #endif | |
| #ifndef BUILDDIR | |
| #define BUILDDIR "..\..\build\bin\Release" | |
| ; VERSION must be provided from the command line or build system: | |
| ; iscc /DVERSION=1.5.3 mbpoll.iss | |
| ; BUILDDIR must be provided to point to the CMake build output: | |
| ; iscc /DBUILDDIR=..\..\build\bin\Release mbpoll.iss | |
| #ifndef VERSION | |
| #error VERSION preprocessor variable not defined. Define it via /DVERSION=... when invoking iscc. | |
| #endif | |
| #ifndef BUILDDIR | |
| #error BUILDDIR preprocessor variable not defined. Define it via /DBUILDDIR=... when invoking iscc. |
fix(ci): add pull_request trigger for package workflows (master/main only)
fix(ci): correct Windows binary path to bin\Release\mbpoll.exe
fix(cmake): use GNUInstallDirs for man page installation path
fix(contributing): correct indentation style to 2-space
chore: remove CLAUDE.md from shared .gitignore