Repository navigation
VERSION_MANAGEMENT
This document explains how versioning works in the AlteriomPainlessMesh library and clarifies common questions about version numbers in different files.
The library version is maintained in multiple files across the repository:
These files define the official library version:
-
library.properties- Arduino Library Manager version -
library.json- PlatformIO Library Registry version -
package.json- NPM package version
All three files must always have the same version number.
These are documentation comments that indicate when the header file documentation was last updated:
-
src/painlessMesh.h-@versionin header comment -
src/AlteriomPainlessMesh.h-ALTERIOM_PAINLESS_MESH_VERSIONdefines
Important: Version numbers in header file comments reflect the overall library version at the time the header was documented, not file-specific versioning.
A: No. The version comment in header files indicates the library version when the header documentation was last reviewed/updated, not the last time the file was modified.
Example:
/**
* @file painlessMesh.h
* @version 1.8.7
* @date 2025-11-12
*/This means:
- β The library version is 1.8.7
- β The header documentation is current as of version 1.8.7
- β It does NOT mean the file hasn't been modified since 1.8.7
A: During rapid development, header file documentation may not be updated every release. The comments are updated when:
- Significant API changes are made
- Documentation requires updating
- Major version milestones are reached
- Version consistency review is performed
A: Always refer to the official version files:
-
library.properties- Official Arduino version -
library.json- Official PlatformIO version -
package.json- Official NPM version - GitHub releases - Tagged release versions
Header file comments are for documentation reference only.
-
Update Official Version Files (required)
./scripts/bump-version.sh patch # or minor, majorThis updates:
library.properties,library.json,package.json -
Update CHANGELOG.md (required)
- Move items from
[Unreleased]to new version section - Add release date
- Move items from
-
Update Header File Comments (recommended)
- Update
@versioninsrc/painlessMesh.h - Update version defines in
src/AlteriomPainlessMesh.h
- Update
-
Commit and Tag (required)
git commit -m "release: vX.Y.Z - Brief description" git push origin mainGitHub Actions will automatically create the tag.
Good Practice:
/**
* @file painlessMesh.h
* @brief Main header file for Alteriom painlessMesh library
*
* @version 1.8.7
* @date 2025-11-12
*
* painlessMesh is a user-friendly library for creating mesh networks...
*/What This Means:
- The library is at version 1.8.7
- Header documentation was reviewed/updated on 2025-11-12
- Always synchronized with library version during releases
Implementation files (.cpp, .hpp) typically do not need version comments. Version information in these files can be misleading and is unnecessary since:
- Git history tracks all changes with timestamps
- Version is centrally managed in the official version files
- Per-file versioning creates maintenance overhead
-
Check Current Version
grep "version=" library.properties -
Make Changes
- Implement features/fixes
- Update documentation as needed
- Add entries to CHANGELOG.md under
[Unreleased]
-
Prepare Release
./scripts/release-agent.sh # Validate release readiness ./scripts/bump-version.sh patch # Update version
-
Update Documentation
- Review and update header file version comments
- Ensure CHANGELOG.md has the new version section
- Verify all documentation references are current
-
Release
git add library.properties library.json package.json CHANGELOG.md src/*.h git commit -m "release: v1.8.7 - Brief description" git push origin main
GitHub Actions automatically handles:
- β Git tag creation
- β GitHub release with notes
- β NPM publishing
- β PlatformIO registry update
- β Documentation deployment
Use Git to see actual file modification history:
# See all commits that modified a file
git log --oneline -- src/painlessMesh.h
# See detailed changes to a file
git log -p -- src/painlessMesh.h
# See when a file was last modified
git log -1 --format="%ai %an" -- src/painlessMesh.h# List all version tags
git tag -l "v*"
# See changes in a specific version
git show v1.8.7
# Compare two versions
git diff v1.8.6..v1.8.7- CHANGELOG.md - Complete version history with changes
- RELEASE_GUIDE.md - Detailed release process
- GitHub Releases - Official release notes
Key Takeaways:
-
Official version =
library.properties/library.json/package.json - Header comments = Documentation reference, not file-specific versions
- Git history = Actual source of truth for file modifications
- CHANGELOG.md = Human-readable version history
- GitHub releases = Tagged versions with release notes
When in doubt: Check library.properties for the official library version, and use git log to see actual file modification history.
Version Management Process Owner: @Alteriom
Last Updated: 2025-11-12
Document Version: 1.0