@alteriom/painlessmesh 1.9.20 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/BRIDGE_TO_INTERNET.md +167 -29
  2. package/CHANGELOG.md +604 -0
  3. package/CONTRIBUTING.md +56 -53
  4. package/README.md +100 -75
  5. package/RELEASE_GUIDE.md +81 -641
  6. package/examples/alteriom/README.md +8 -10
  7. package/examples/alteriom/alteriom.ino +2 -2
  8. package/examples/alteriom/alteriom_custom_package_template.hpp +11 -11
  9. package/examples/alteriom/alteriom_sensor_package.hpp +17 -11
  10. package/examples/alteriom/mppt_example/alteriom_custom_package_template.hpp +320 -0
  11. package/examples/alteriom/mppt_example/alteriom_sensor_package.hpp +1389 -0
  12. package/examples/alteriom/mppt_example/{alteriom_mppt_example.ino → mppt_example.ino} +5 -1
  13. package/examples/basic/test/simulator/README.md +3 -3
  14. package/examples/bridge_failover/README.md +51 -14
  15. package/examples/bridge_failover/bridge_failover.ino +2 -2
  16. package/examples/commandControl/commandControl.ino +86 -0
  17. package/examples/commandControl/platformio.ini +26 -0
  18. package/examples/mqttBridge/mqttBridge.ino +4 -0
  19. package/examples/mqttBridge/platformio.ini +1 -1
  20. package/examples/otaSender/otaSender.ino +5 -1
  21. package/examples/priority/README.md +1 -1
  22. package/examples/priority/{priority_basic_example.ino → priority_basic_example/priority_basic_example.ino} +4 -4
  23. package/examples/priority/{priority_with_queue.ino → priority_with_queue/priority_with_queue.ino} +20 -2
  24. package/examples/reliableSensorLogging/platformio.ini +26 -0
  25. package/examples/reliableSensorLogging/reliableSensorLogging.ino +151 -0
  26. package/examples/sendToInternet/README.md +12 -5
  27. package/examples/sendToInternet/{CMakeLists.txt → pc_node/CMakeLists.txt} +7 -7
  28. package/examples/sendToInternet/{PC_NODE_README.md → pc_node/PC_NODE_README.md} +15 -15
  29. package/examples/sendToInternet/{build.sh → pc_node/build.sh} +5 -5
  30. package/examples/sendToInternet/{pc_mesh_node.cpp → pc_node/pc_mesh_node.cpp} +12 -1
  31. package/examples/sharedGateway/README.md +1 -2
  32. package/examples/tcpRetryConfig/README.md +110 -0
  33. package/examples/tcpRetryConfig/platformio.ini +26 -0
  34. package/examples/tcpRetryConfig/tcpRetryConfig.ino +154 -0
  35. package/keywords.txt +53 -1
  36. package/library.json +8 -6
  37. package/library.properties +2 -2
  38. package/package.json +3 -3
  39. package/src/AlteriomPainlessMesh.h +4 -4
  40. package/src/arduino/wifi.hpp +605 -143
  41. package/src/painlessMesh.h +2 -2
  42. package/src/painlessMeshSTA.cpp +607 -87
  43. package/src/painlessMeshSTA.h +135 -3
  44. package/src/painlessTaskOptions.h +9 -0
  45. package/src/painlessmesh/ack.hpp +283 -0
  46. package/src/painlessmesh/buffer.hpp +74 -9
  47. package/src/painlessmesh/callback.hpp +38 -5
  48. package/src/painlessmesh/configuration.hpp +82 -3
  49. package/src/painlessmesh/connection.hpp +43 -16
  50. package/src/painlessmesh/gateway.hpp +270 -5
  51. package/src/painlessmesh/layout.hpp +70 -2
  52. package/src/painlessmesh/logger.hpp +15 -0
  53. package/src/painlessmesh/mesh.hpp +625 -70
  54. package/src/painlessmesh/message_queue.hpp +24 -13
  55. package/src/painlessmesh/ntp.hpp +2 -4
  56. package/src/painlessmesh/plugin.hpp +52 -6
  57. package/src/painlessmesh/protocol.hpp +55 -2
  58. package/src/painlessmesh/router.hpp +192 -77
  59. package/src/painlessmesh/tcp.hpp +168 -29
  60. package/src/painlessmesh/message_tracker.hpp +0 -311
  61. /package/examples/sendToInternet/{mock_server_test.ino → mock_server_test/mock_server_test.ino} +0 -0
package/RELEASE_GUIDE.md CHANGED
@@ -1,680 +1,120 @@
1
- # painlessMesh Release Guide
1
+ # AlteriomPainlessMesh Release Guide
2
2
 
3
- This document provides comprehensive instructions for releasing new versions of the Alteriom painlessMesh library across all distribution channels.
3
+ This repository publishes one version to the Arduino Library Manager,
4
+ PlatformIO, npm, GitHub Packages, and GitHub Releases. A release starts only
5
+ after the release pull request is reviewed, all required CI checks pass, and
6
+ the version commit reaches `main`.
4
7
 
5
- ## ⚠️ Important: Agent Requirements for Releases
8
+ ## Release checklist
6
9
 
7
- **Releases MUST be performed by Alteriom AI Agent (`@alteriom-ai-agent`) with full tool access.**
10
+ 1. Start from a clean branch based on the current release branch.
11
+ 2. Confirm the intended changes are documented under `Unreleased` in
12
+ [CHANGELOG.md](CHANGELOG.md).
13
+ 3. Run the complete desktop, Arduino, PlatformIO, simulator, and hardware test
14
+ suites required by the pull request.
15
+ 4. Obtain approval and resolve every review conversation.
16
+ 5. After approval, select the next semantic version and update the version
17
+ metadata.
18
+ 6. Move the `Unreleased` changes to a dated version section.
19
+ 7. Run the release validation scripts.
20
+ 8. Merge the release pull request. Do not create a tag by hand; the release
21
+ workflow owns tags and publication.
8
22
 
9
- ### Why This Matters
23
+ The workflow tags only when the push to `main` carries a version-file
24
+ change or a head commit whose message starts with `release:`. When the
25
+ version metadata was bumped earlier in the cycle (as for 2.0.0), merge the
26
+ release pull request with a commit titled `release: vX.Y.Z` — a squash or
27
+ merge commit with that title — or the push is ignored.
10
28
 
11
- A release requires updating 7 files consistently:
12
- 1. library.properties
13
- 2. library.json
14
- 3. package.json
15
- 4. src/painlessMesh.h
16
- 5. src/AlteriomPainlessMesh.h
17
- 6. README.md
18
- 7. CHANGELOG.md
29
+ ## Version metadata
19
30
 
20
- **✅ Correct Agent:** `@alteriom-ai-agent`
21
- - Has file editing tools (`replace_string_in_file`, `multi_replace_string_in_file`)
22
- - Can run terminal commands (`run_in_terminal`)
23
- - Can execute git operations
24
- - **Use this for release preparation**
31
+ These files must always contain the same semantic version:
25
32
 
26
- **❌ Wrong Agent:** `@painlessmesh-coordinator` or specialized agents without tools
27
- - Lack file editing capabilities
28
- - Can only provide documentation/checklists
29
- - Cannot actually perform releases
30
- - Will result in manual work
33
+ - `library.properties`
34
+ - `library.json`
35
+ - `package.json`
31
36
 
32
- ### Agent-Assisted Release (Recommended)
37
+ Use the repository script to change them together:
33
38
 
34
39
  ```bash
35
- # Ask Alteriom AI Agent to prepare release
36
- @alteriom-ai-agent Prepare release v1.9.9 with these changes:
37
- - Fixed ESP8266 WiFiClientSecure scope issue
38
- - Fixed TCP retry crash with AsyncClient cleanup
39
-
40
- # Agent will:
41
- # ✅ Update all 7 version files
42
- # ✅ Restructure CHANGELOG.md
43
- # ✅ Run validation: ./scripts/release-agent.sh
44
- # ✅ Commit: "release: v1.9.9 - Description"
45
- # ✅ Push to trigger automation
46
- ```
47
-
48
- ## 🚀 Quick Release Process
49
-
50
- ### Standard Release (Manual)
51
-
52
- ```bash
53
- # 1. Update version using the bump script
54
- ./scripts/bump-version.sh patch # or minor, major
55
-
56
- # 2. Update CHANGELOG.md with your changes
57
- # Add your changes under the new version section
58
-
59
- # 3. Update header file version comments (recommended)
60
- # Edit src/painlessMesh.h and src/AlteriomPainlessMesh.h
61
- # Update @version comments to match the new library version
62
-
63
- # 4. Run the Release Agent to validate readiness
64
- ./scripts/release-agent.sh
65
-
66
- # 5. If all checks pass, commit and trigger release
67
- git add library.properties library.json package.json CHANGELOG.md src/*.h README.md
68
- git commit -m "release: v1.7.9 - Brief description"
69
- git push origin main
70
- ```
71
-
72
- **That's it!** GitHub Actions will automatically handle:
73
- - ✅ Comprehensive testing across platforms
74
- - ✅ Git tag creation and GitHub release
75
- - ✅ NPM publishing (public + GitHub Packages)
76
- - ✅ **PlatformIO Library Registry publishing**
77
- - ✅ GitHub Wiki synchronization
78
- - ✅ Arduino Library Manager package preparation
79
- - ✅ Release notes generation from changelog
80
-
81
- ## 📋 Distribution Channels
82
-
83
- ### Automatic (Zero Manual Work Required)
84
-
85
- 1. **GitHub Releases** - Created with changelog and downloadable packages
86
- 2. **NPM Public Registry** - Published to <https://www.npmjs.com/package/@alteriom/painlessmesh>
87
- 3. **GitHub Packages** - Published to GitHub's NPM registry (@alteriom/painlessmesh)
88
- 4. **PlatformIO Registry** - Automatically published via GitHub Actions workflow
89
- 5. **GitHub Wiki** - Documentation synchronized from repository
90
-
91
- ### Semi-Automatic (One-Time Manual Submission)
92
-
93
- 1. **Arduino Library Manager** - Submit once, then automatically indexed
94
-
95
- ## 🎯 Detailed Process
96
-
97
- ### Version Management
98
-
99
- > **📖 For detailed information about version management, see [VERSION_MANAGEMENT.md](docs/VERSION_MANAGEMENT.md)**
100
-
101
- **File Consistency**: All three files must have matching versions:
102
-
103
- ```properties
104
- # library.properties
105
- version=1.6.1
106
- ```
107
-
108
- ```json
109
- // library.json
110
- {
111
- "version": "1.6.1"
112
- }
113
- ```
114
-
115
- ```json
116
- // package.json
117
- {
118
- "version": "1.6.1"
119
- }
120
- ```
121
-
122
- **Semantic Versioning**: Follow [semver.org](https://semver.org/):
123
- - **MAJOR**: Breaking changes (e.g., 1.6.0 → 2.0.0)
124
- - **MINOR**: New features, backward compatible (e.g., 1.6.0 → 1.7.0)
125
- - **PATCH**: Bug fixes, backward compatible (e.g., 1.6.0 → 1.6.1)
126
-
127
- ### Automation Triggers
128
-
129
- The release workflow triggers on commits to `main` that:
130
- 1. Modify `library.properties`, `library.json`, `package.json`, or `CHANGELOG.md`
131
- 2. Have version files modified OR commit message starting with `release:`
132
-
133
- ### What Gets Automated
134
-
135
- #### Testing Pipeline
136
- - **Desktop builds**: gcc & clang with strict warnings
137
- - **Arduino CLI**: ESP32 & ESP8266 compilation
138
- - **PlatformIO**: Cross-platform build validation
139
- - **Code quality**: Formatting and lint checks
140
-
141
- #### Release Artifacts
142
- - **Git tag**: `v1.6.1` format
143
- - **GitHub Release**: With changelog excerpt
144
- - **Library package**: `painlessMesh-v1.6.1.zip`
145
- - **Documentation**: Auto-deployed to GitHub Pages
146
-
147
- #### NPM Publishing
148
- - **Public NPM**: Available to anyone via `npm install @alteriom/painlessmesh`
149
- - **GitHub Packages**: Scoped package for authenticated users
150
- - **Version consistency**: Verified across all package files
151
-
152
- #### Wiki Updates
153
- - **Home Page**: Generated from README.md
154
- - **API Reference**: Auto-generated documentation
155
- - **Examples**: Links to repository examples
156
- - **Installation Guide**: Multi-platform instructions
157
-
158
- ## 📦 NPM Publishing Details
159
-
160
- ### Dual Publishing Strategy
161
-
162
- Each release publishes to **two NPM registries**:
163
-
164
- 1. **Public NPM** (npmjs.com)
165
- - Package: `@alteriom/painlessmesh`
166
- - Installation: `npm install @alteriom/painlessmesh`
167
- - No authentication required
168
-
169
- 2. **GitHub Packages** (npm.pkg.github.com)
170
- - Package: `@alteriom/painlessmesh`
171
- - Installation: Requires `.npmrc` configuration
172
- - Authentication required for installation
173
-
174
- ### NPM Package Contents
175
-
176
- The NPM package includes:
177
- - `src/` - Complete library source code
178
- - `examples/` - All Arduino examples
179
- - `docs/` - Documentation files
180
- - `library.properties` - Arduino metadata
181
- - `library.json` - PlatformIO metadata
182
- - Core documentation files (README, LICENSE, CHANGELOG)
183
-
184
- Excluded from NPM package:
185
-
186
- - Development files (`.github/`, `test/`, `scripts/`)
187
- - Build artifacts (`bin/`, `build/`)
188
- - IDE files and OS-specific files
189
-
190
- ## 🔧 PlatformIO Library Registry
191
-
192
- ### Automatic Publishing
193
-
194
- Each release triggers the **PlatformIO Library Publishing** workflow:
195
-
196
- 1. **Validation**: Comprehensive library.json validation
197
- 2. **Dependencies**: Verification that all dependencies exist in PlatformIO Registry
198
- 3. **Authentication**: Uses `PLATFORMIO_AUTH_TOKEN` secret
199
- 4. **Publication**: Direct publishing via PlatformIO CLI
200
- 5. **Verification**: Post-publication registry verification
201
-
202
- ### Setup Requirements
203
-
204
- #### One-Time Setup: PlatformIO Account & Token
205
-
206
- 1. **Create Account**: <https://platformio.org/account/register>
207
- 2. **Generate Token**: <https://platformio.org/account/token>
208
- 3. **Add Secret**: Repository Settings → Secrets → `PLATFORMIO_AUTH_TOKEN`
209
-
210
- #### Automatic Workflow Trigger
211
-
212
- The PlatformIO workflow automatically triggers on:
213
-
214
- - New GitHub releases (tags)
215
- - Manual workflow dispatch for testing
216
-
217
- ### PlatformIO Package Contents
218
-
219
- Published package includes:
220
-
221
- - Complete source code (`src/`)
222
- - All examples (`examples/`)
223
- - PlatformIO metadata (`library.json`)
224
- - Arduino compatibility (`library.properties`)
225
- - Documentation files
226
-
227
- ### Installation
228
-
229
- Users can install via PlatformIO:
230
-
231
- ```ini
232
- # platformio.ini
233
- [env:esp32dev]
234
- platform = espressif32
235
- board = esp32dev
236
- framework = arduino
237
- lib_deps = alteriom/AlteriomPainlessMesh@^1.6.1
238
- ```
239
-
240
- Or via CLI:
241
-
242
- ```bash
243
- pio pkg install --library "alteriom/AlteriomPainlessMesh@^1.6.1"
244
- ```
245
-
246
- ### Manual Publication (Fallback)
247
-
248
- If automatic publishing fails:
249
-
250
- ```bash
251
- # Install PlatformIO CLI
252
- pip install platformio
253
-
254
- # Authenticate
255
- pio account token --set YOUR_TOKEN
256
-
257
- # Publish from repository root
258
- pio pkg publish .
40
+ ./scripts/bump-version.sh patch
259
41
  ```
260
42
 
261
- ### Monitoring
262
-
263
- - **Registry**: <https://registry.platformio.org/libraries>
264
- - **Search**: <https://registry.platformio.org/search?q=AlteriomPainlessMesh>
265
- - **Workflow**: GitHub Actions → PlatformIO Library Publishing
266
-
267
- ## 🛠️ Arduino Library Manager
43
+ You may use `minor`, `major`, or an explicit version when the release plan
44
+ requires it. Version 2.0 patch releases must remain wire-compatible with the
45
+ 2.0 protocol.
268
46
 
269
- ### ✅ IMPORTANT: Library Name Fixed
47
+ ## Changelog
270
48
 
271
- **Current Status**: **REGISTERED AND FIXED**
272
-
273
- The library IS registered in the Arduino Library Manager. The issue was a library name change that prevented new versions from being indexed.
274
-
275
- **Issue Resolved**: Library name in `library.properties` has been restored to match the original registration.
276
-
277
- **Result**: New releases will now be automatically indexed by Arduino Library Manager within 24-48 hours.
278
-
279
- ### One-Time Submission Process
280
-
281
- **This must be done once** to enable Arduino IDE installation:
282
-
283
- 1. **Go to**: https://github.com/arduino/library-registry
284
- 2. **Click**: "Issues" → "New Issue"
285
- 3. **Create issue** with this template:
49
+ During development, add user-visible changes to `## [Unreleased]`. At release
50
+ time, create a dated section:
286
51
 
287
52
  ```markdown
288
- Title: Add AlteriomPainlessMesh library
289
-
290
- Repository URL: https://github.com/Alteriom/painlessMesh
291
- Library Name: AlteriomPainlessMesh
292
- Current Version: 1.8.2
293
- Release Tag: v1.8.2
294
-
295
- Description:
296
- AlteriomPainlessMesh is a user-friendly library for creating mesh networks
297
- with ESP8266 and ESP32 devices. Enhanced fork of painlessMesh with:
298
-
299
- - SensorPackage (Type 200): Environmental data collection
300
- - StatusPackage (Type 202): Device health monitoring
301
- - CommandPackage (Type 400): Remote device control
302
- - MetricsPackage (Type 204): Performance metrics
303
- - HealthCheckPackage (Type 605): Proactive monitoring
304
- - Bridge Coordination: Multi-bridge high availability
305
- - Message Queue: Offline message queueing
306
-
307
- Category: Communication
308
- Architectures: esp8266, esp32
309
- Dependencies: ArduinoJson (^7.4.2), TaskScheduler (^4.0.0)
310
- License: LGPL-3.0
311
- Documentation: https://alteriom.github.io/painlessMesh/
312
-
313
- All Arduino requirements met. Ready for indexing.
314
- ```
315
-
316
- 4. **Monitor** the issue for Arduino team approval (1-2 weeks typical)
317
- 5. **Verify** registration via Arduino IDE Library Manager search
318
- 6. **Future releases** automatically indexed (24-48 hour delay)
319
-
320
- ### Detailed Submission Guide
321
-
322
- For complete instructions, see: [docs/ARDUINO_LIBRARY_MANAGER_SUBMISSION.md](docs/ARDUINO_LIBRARY_MANAGER_SUBMISSION.md)
323
-
324
- The guide includes:
325
- - Pre-submission checklist
326
- - Detailed submission template
327
- - Testing procedures
328
- - Troubleshooting common issues
329
- - Post-registration maintenance
330
-
331
- ### Arduino Library Compliance
53
+ ## [X.Y.Z] - YYYY-MM-DD
332
54
 
333
- The library meets all Arduino Library Manager requirements:
334
- - ✅ Correct directory structure
335
- - ✅ Valid `library.properties` file (version=1.8.2)
336
- - ✅ Source files in `src/` directory
337
- - ✅ Examples compile successfully (19+ examples)
338
- - ✅ Consistent version numbering across files
339
- - ✅ Open source license (LGPL-3.0)
340
- - ✅ Git tags match library versions
341
- - ✅ Comprehensive documentation
55
+ ### Fixed
342
56
 
343
- ## 📚 GitHub Wiki Management
344
-
345
- ### Automatic Synchronization
346
-
347
- Wiki pages are automatically updated on each release:
348
-
349
- - **Home** - From README.md
350
- - **Release-Guide** - From RELEASE_GUIDE.md
351
- - **Changelog** - From CHANGELOG.md
352
- - **API-Reference** - Generated documentation
353
- - **Examples** - Auto-generated from examples directory
354
- - **Installation** - Multi-platform installation guide
355
- - **Contributing** - From CONTRIBUTING.md
356
-
357
- ### Manual Wiki Updates
358
-
359
- If you need to update the wiki manually:
360
-
361
- ```bash
362
- # Clone wiki repository
363
- git clone https://github.com/Alteriom/painlessMesh.wiki.git
364
-
365
- # Edit markdown files directly
366
- # Commit and push changes
57
+ - Describe the observed defect, its impact, and the verified correction.
367
58
  ```
368
59
 
369
- Note: Manual changes may be overwritten by automatic synchronization.
370
-
371
- ## 🔧 Scripts Reference
60
+ Keep operational evidence in the pull request and concise user-facing impact
61
+ in the changelog. Historical release entries remain immutable.
372
62
 
373
- ### `./scripts/release-agent.sh` ⭐ NEW
63
+ ## Validation
374
64
 
375
- **Comprehensive release validation and quality assurance.**
65
+ Run both validation scripts from the repository root:
376
66
 
377
- The Release Agent performs 21+ automated checks to ensure release readiness:
378
-
379
- - ✅ Version consistency across all package files
380
- - ✅ CHANGELOG completeness and format validation
381
- - ✅ Build system configuration
382
- - ✅ Dependency validation
383
- - ✅ Git tag existence check
384
- - ✅ Release workflow configuration
385
- - ✅ Documentation link validation
386
- - ✅ Test suite status (when available)
387
-
388
- **Usage:**
389
67
  ```bash
390
- ./scripts/release-agent.sh # Full validation
391
- ./scripts/release-agent.sh --help # Show help
392
- ./scripts/release-agent.sh --version # Show version
393
- ```
394
-
395
- **Benefits:**
396
- - 🎯 Catches issues before they reach CI/CD
397
- - 📊 Clear, color-coded output for easy scanning
398
- - 🔧 Specific solutions for each type of issue
399
- - 🚀 Comprehensive validation in under 5 seconds
400
- - ✨ Professional release summary with next steps
401
-
402
- **When to Use:**
403
- - Before every release commit
404
- - After making version changes
405
- - When troubleshooting release issues
406
- - As part of your local release workflow
407
-
408
- **See Also:** `.github/agents/release-agent.md` for complete documentation
409
-
410
- ### `./scripts/bump-version.sh`
411
- Updates version in all library files with consistency checks.
412
-
413
- **Usage:**
414
- ```bash
415
- ./scripts/bump-version.sh patch # Increment patch version
416
- ./scripts/bump-version.sh minor # Increment minor version
417
- ./scripts/bump-version.sh major # Increment major version
418
- ./scripts/bump-version.sh patch 1.6.2 # Set specific version
419
- ```
420
-
421
- ### `./scripts/validate-release.sh`
422
- Comprehensive pre-release validation.
423
-
424
- **Checks:**
425
- - Version consistency between all files
426
- - Changelog entries for current version
427
- - Git working tree status
428
- - Tag existence validation
429
- - Dependency declarations
430
- - Build file presence
431
- - Quick compilation test
432
-
433
- ## 🚨 Troubleshooting
434
-
435
- ### Common Issues
436
-
437
- **Version Mismatch Error**
438
- ```bash
439
- # Fix version inconsistencies
440
- ./scripts/bump-version.sh patch 1.6.2 # Force set version
441
- ```
442
-
443
- **Missing Changelog Entry**
444
- ```bash
445
- # Add changelog entry for current version
446
- vim CHANGELOG.md
447
- # Add section: ## [1.6.2] - YYYY-MM-DD
448
- ```
449
-
450
- **Build Failures**
451
- ```bash
452
- # Test locally before release
453
- npm run build
454
- npm run test
455
- ```
456
-
457
- **NPM Token Invalid**
458
- ```bash
459
- # Verify NPM authentication
460
- npm whoami
461
- # If not logged in: npm login
462
- ```
463
-
464
- **GitHub Packages Authentication**
465
- ```bash
466
- # Check if GITHUB_TOKEN has packages:write permission
467
- # Repository Settings → Actions → General → Permissions
468
- ```
469
-
470
- **Wiki Update Failure**
471
- ```bash
472
- # Wiki may need manual initialization
473
- # Go to: https://github.com/Alteriom/painlessMesh/wiki
474
- # Create any page to initialize, then re-run release
475
- ```
476
-
477
- **NPM/GitHub Packages Not Published Automatically**
478
-
479
- The automated workflow triggers a release in two ways:
480
-
481
- 1. **Automatic (Recommended)**: When version files are updated in a commit
482
- - The workflow detects changes to `library.properties`, `library.json`, or `package.json`
483
- - Automatically creates tag, release, and publishes packages when these files are modified
484
- - Works seamlessly with PR merges and direct commits
485
-
486
- 2. **Manual trigger**: Commit message starts with `release:` (lowercase with colon):
487
-
488
- ```bash
489
- # ✅ Correct - Will trigger full release
490
- git commit -m "release: v1.7.7 - Complete mqtt-schema implementation"
491
-
492
- # ✅ Also works - Version file changes detected automatically
493
- # (No special commit message needed when library.properties/json/package.json are modified)
494
- git commit -m "Bump version to 1.7.8"
495
- ```
496
-
497
- **Note**: If version files weren't modified and commit message doesn't start with "release:", the workflow will skip publishing.
498
-
499
- **Solution: Use Manual Publishing Workflow**
500
-
501
- If this happens, you can manually publish packages:
502
-
503
- 1. Go to **Actions** → **Manual Package Publishing**
504
- 2. Click **Run workflow**
505
- 3. Select options:
506
- - ✅ Publish to NPM Registry
507
- - ✅ Publish to GitHub Packages
508
- 4. Click **Run workflow**
509
-
510
- The manual workflow will:
511
- - Read the current version from `library.properties`
512
- - Publish to NPM (if selected)
513
- - Publish to GitHub Packages (if selected)
514
- - Show success/failure status for each
515
-
516
- Alternatively, from command line:
517
- ```bash
518
- # Trigger via GitHub CLI
519
- gh workflow run manual-publish.yml
520
- ```
521
-
522
- ### Manual Override
523
-
524
- If automation fails, you can manually perform any step:
525
-
526
- ```bash
527
- # Manual NPM publish
528
- npm publish --access public
529
-
530
- # Manual GitHub release
531
- gh release create v1.6.2 --title "painlessMesh v1.6.2" --notes-file CHANGELOG.md
532
-
533
- # Manual tag creation
534
- git tag v1.6.2
535
- git push origin v1.6.2
536
- ```
537
-
538
- ## 🔍 Validation Commands
539
-
540
- ### Pre-Release Checks
541
- ```bash
542
- # Comprehensive validation
543
68
  ./scripts/validate-release.sh
544
-
545
- # Version consistency check
546
- ./scripts/bump-version.sh --verify || echo "Use proper arguments"
547
-
548
- # NPM package validation
549
- npm run validate-library
550
-
551
- # Build test
552
- npm run build && npm run test
553
- ```
554
-
555
- ### Post-Release Verification
556
- ```bash
557
- # Check NPM publication
558
- npm view @alteriom/painlessmesh
559
-
560
- # Check GitHub Packages
561
- npm view @alteriom/painlessmesh --registry=https://npm.pkg.github.com
562
-
563
- # Check PlatformIO Registry
564
- pio pkg search "AlteriomPainlessMesh"
565
-
566
- # Verify GitHub release
567
- gh release view
568
-
569
- # Check wiki update
570
- curl -s https://github.com/Alteriom/painlessMesh/wiki | grep -q "v1.6.2"
571
- ```
572
-
573
- ## 🎉 Success Indicators
574
-
575
- ### Successful Release Shows:
576
- - ✅ GitHub release created with changelog
577
- - ✅ Git tag pushed to repository
578
- - ✅ NPM package published (check npmjs.com)
579
- - ✅ GitHub Packages updated
580
- - ✅ Wiki pages synchronized
581
- - ✅ All GitHub Actions workflows completed successfully
582
-
583
- ### Distribution Verification:
584
- ```bash
585
- # Public NPM
586
- npm view @alteriom/painlessmesh
587
-
588
- # GitHub Packages
589
- npm view @alteriom/painlessmesh --registry=https://npm.pkg.github.com
590
-
591
- # PlatformIO (updated within minutes via GitHub Actions)
592
- # Check: https://registry.platformio.org/libraries/alteriom/AlteriomPainlessMesh
593
-
594
- # Arduino Library Manager (after manual submission)
595
- # Search in Arduino IDE Library Manager
596
- ```
597
-
598
- ## 🌟 Advanced Topics
599
-
600
- ### Custom Release Notes
601
-
602
- To customize release notes beyond the changelog:
603
-
604
- 1. Edit the generated `release_notes.txt` in the workflow
605
- 2. Or create a custom release notes file in `.github/release-template.md`
606
-
607
- ### Environment-Specific Releases
608
-
609
- For testing releases:
610
-
611
- ```bash
612
- # Use pre-release tags
613
- git tag v1.6.2-beta
614
- git push origin v1.6.2-beta
615
-
616
- # This creates a pre-release without full publication
69
+ ./scripts/release-agent.sh
617
70
  ```
618
71
 
619
- ### Rollback Procedure
620
-
621
- If a release has issues:
72
+ The pull request must also pass all required GitHub checks, including:
622
73
 
623
- ```bash
624
- # Delete remote tag
625
- git push origin :refs/tags/v1.6.2
626
-
627
- # Delete local tag
628
- git tag -d v1.6.2
629
-
630
- # Delete GitHub release
631
- gh release delete v1.6.2
632
-
633
- # Unpublish NPM package (contact npm support)
634
- # GitHub Packages: Delete from package settings
635
- ```
636
-
637
- ## 📊 Release Metrics
74
+ - gcc, clang, and AddressSanitizer desktop builds
75
+ - Arduino ESP32 and ESP8266 compilation
76
+ - PlatformIO builds and build-flag validation
77
+ - formatting and documentation checks
78
+ - CodeQL
79
+ - simulator scenarios
80
+ - ESP32, ESP32-C3, and ESP32-S3 hardware-in-the-loop coverage when the change
81
+ touches radio, routing, gateway, OTA, or platform-specific behavior
638
82
 
639
- Monitor your releases:
640
- - **GitHub**: https://github.com/Alteriom/painlessMesh/releases
641
- - **NPM**: https://www.npmjs.com/package/@alteriom/painlessmesh
642
- - **PlatformIO**: https://registry.platformio.org/libraries/alteriom/painlessMesh
643
- - **Wiki**: https://github.com/Alteriom/painlessMesh/wiki
83
+ For a hardware defect, attach the HIL run identifier and report link to the
84
+ pull request. A unit test alone is not sufficient evidence for a radio or
85
+ multi-device timing fix.
644
86
 
645
- ## 🤝 Security & Permissions
87
+ ## Review gate
646
88
 
647
- ### Required GitHub Secrets
89
+ A release pull request is ready only when:
648
90
 
649
- - `GITHUB_TOKEN`: Automatically provided by GitHub Actions
650
- - `NPM_TOKEN`: Required for NPM publishing (add in repository secrets)
651
- - `PLATFORMIO_AUTH_TOKEN`: Required for PlatformIO Library Registry publishing
91
+ - it has an approving review;
92
+ - all review comments are resolved;
93
+ - required checks are green on the final commit;
94
+ - the branch is current with its target branch;
95
+ - version metadata and changelog validation pass;
96
+ - there are no unexplained skipped hardware scenarios.
652
97
 
653
- ### Repository Settings
654
- - **Actions**: Enabled with write permissions
655
- - **Packages**: Enabled for GitHub Packages publication
656
- - **Wiki**: Enabled for documentation deployment
657
- - **Releases**: Public releases enabled
98
+ Any code change after approval invalidates the approval and requires another
99
+ review of the final commit.
658
100
 
659
- ---
101
+ ## Automated publication
660
102
 
661
- ## Quick Reference
103
+ When a qualifying version commit reaches `main`, `.github/workflows/release.yml`
104
+ validates the metadata, creates the `vX.Y.Z` tag and GitHub release, uploads the
105
+ Arduino archive, publishes npm and GitHub Packages, and dispatches the
106
+ PlatformIO publication workflow.
662
107
 
663
- **Release a patch version:**
664
- ```bash
665
- ./scripts/bump-version.sh patch
666
- # Edit CHANGELOG.md
667
- git add . && git commit -m "release: v1.6.2" && git push
668
- ```
108
+ Monitor every publication job to completion. Verify the version is visible in
109
+ each registry before announcing the release. Arduino Library Manager indexing
110
+ can lag behind the GitHub release.
669
111
 
670
- **Check release status:**
671
- ```bash
672
- ./scripts/validate-release.sh
673
- ```
112
+ ## Recovery
674
113
 
675
- **Monitor release:**
676
- - GitHub Actions: https://github.com/Alteriom/painlessMesh/actions
677
- - Releases: https://github.com/Alteriom/painlessMesh/releases
678
- - Documentation: https://github.com/Alteriom/painlessMesh/wiki
114
+ Never reuse a published semantic version. If publication succeeds in one
115
+ registry and fails in another, fix the credential or workflow problem and
116
+ rerun only the failed publication path for the same tag. If shipped code is
117
+ defective, prepare a new patch release rather than replacing the existing tag.
679
118
 
680
- For questions or issues with the release process, create an issue with the `ci/cd` label.
119
+ Security-sensitive release failures or suspected credential exposure must be
120
+ handled according to [SECURITY.md](SECURITY.md).