Skip to content

feat: modernize CI/CD, add packaging workflows, man page and contributing guidelines#104

Merged
epsilonrt merged 11 commits intomasterfrom
dev
Feb 8, 2026
Merged

feat: modernize CI/CD, add packaging workflows, man page and contributing guidelines#104
epsilonrt merged 11 commits intomasterfrom
dev

Conversation

@epsilonrt
Copy link
Copy Markdown
Owner

  • 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

- 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
Copilot AI review requested due to automatic review settings February 8, 2026 21:05
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
run: git clone https://github.com/stephane/libmodbus.git
run: git clone --branch v3.1.10 --depth 1 https://github.com/stephane/libmodbus.git

Copilot uses AI. Check for mistakes.
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.
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
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.

Copilot uses AI. Check for mistakes.
Comment on lines +63 to +66
| Branch | Purpose |
|-----------|----------------------------------|
| `master` | Stable releases only |
| `dev` | Active development, PR target |
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
Comment on lines +48 to +55
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
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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"

Copilot uses AI. Check for mistakes.
@epsilonrt epsilonrt changed the title Dev feat: modernize CI/CD, add packaging workflows, man page and contributing guidelines Feb 8, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +61 to +65
- name: Check binary
run: |
.\build\bin\Release\mbpoll.exe -V
.\build\bin\Release\mbpoll.exe -h
continue-on-error: true
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
Comment on lines +35 to +39
- name: Check binary
run: |
.\build\bin\Release\mbpoll.exe -V
.\build\bin\Release\mbpoll.exe -h
continue-on-error: true
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
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
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
Comment on lines +3 to +12
; 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"
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
; 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.

Copilot uses AI. Check for mistakes.
@epsilonrt epsilonrt merged commit d541211 into master Feb 8, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants