@@ -29,50 +29,85 @@ jobs:
2929 - name : Build and Package Library
3030 run : |
3131 TAG_NAME=${{ steps.version.outputs.VERSION }}
32- zip -r "bq25756e_multiplatform-${TAG_NAME}.zip" src include examples library.json library.properties LICENSE.txt README.md
32+ zip -r "bq25756e_multiplatform-${TAG_NAME}.zip" src include examples library.json library.properties LICENSE.txt README.md CHANGELOG.md
33+
34+ # Build the release body from the top CHANGELOG.md entry (the version being
35+ # tagged) followed by the fixed install/platform boilerplate.
36+ - name : Extract release notes
37+ env :
38+ VERSION : ${{ steps.version.outputs.VERSION }}
39+ REPO : ${{ github.repository }}
40+ run : |
41+ python3 - <<'PY'
42+ import os
43+ from pathlib import Path
44+
45+ version = os.environ["VERSION"]
46+ repo = os.environ["REPO"]
47+
48+ changelog = Path("CHANGELOG.md").read_text().splitlines()
49+ notes = []
50+ capture = False
51+ for line in changelog:
52+ if line.startswith("## "):
53+ if capture:
54+ break
55+ capture = True
56+ if capture:
57+ notes.append(line)
58+
59+ if not notes:
60+ raise SystemExit("No release notes found in CHANGELOG.md")
61+
62+ body = [
63+ f"## BQ25756E Battery Charge Controller Library {version}",
64+ "",
65+ "C++ library for controlling the TI BQ25756E buck-boost battery charge controller via I2C.",
66+ "",
67+ *notes[1:],
68+ "",
69+ "### Supported Platforms",
70+ "- Arduino / ESP32 (Wire)",
71+ "- STM32 (STM32duino & HAL)",
72+ "- RP2040 (Arduino core or Pico SDK)",
73+ "",
74+ "### Usage Model",
75+ "- Pass the active bus handle directly to the constructor (`&Wire`, `&hi2c1`, `i2c0`)",
76+ "- Use 7-bit I2C device addresses on every platform",
77+ "",
78+ "### Installation",
79+ "",
80+ "#### PlatformIO",
81+ "Add to your `platformio.ini`:",
82+ "```ini",
83+ "lib_deps =",
84+ f" https://github.com/theohg/bq25756e_multiplatform.git#{version}",
85+ "```",
86+ "",
87+ "Or download the zip and place in your project's `lib/` directory.",
88+ "",
89+ "#### Arduino IDE",
90+ f"1. Download `bq25756e_multiplatform-{version}.zip`",
91+ "2. In Arduino IDE: Sketch → Include Library → Add .ZIP Library",
92+ "3. Select the downloaded zip file",
93+ "",
94+ "### Examples",
95+ "- `basic_charging` - Charger initialization and status monitoring",
96+ "- `status_monitoring` - ADC readings and fault detection",
97+ "",
98+ "See the `examples/` folder for complete code.",
99+ "",
100+ "### Documentation",
101+ f"Full documentation at https://github.com/{repo}",
102+ ]
103+ Path("release-body.md").write_text("\n".join(body) + "\n")
104+ PY
33105
34106 - name : Create GitHub Release
35107 uses : softprops/action-gh-release@v2
36108 with :
37109 name : " BQ25756E Library ${{ steps.version.outputs.VERSION }}"
38- body : |
39- ## BQ25756E Battery Charge Controller Library ${{ steps.version.outputs.VERSION }}
40-
41- C++ library for controlling the TI BQ25756E buck-boost battery charge controller via I2C.
42-
43- ### Supported Platforms
44- - Arduino / ESP32 (Wire)
45- - STM32 (STM32duino & HAL)
46- - RP2040 (Arduino core or Pico SDK)
47-
48- ### Usage Model
49- - Pass the active bus handle directly to the constructor (`&Wire`, `&hi2c1`, `i2c0`)
50- - Use 7-bit I2C device addresses on every platform
51-
52- ### Installation
53-
54- #### PlatformIO
55- Add to your `platformio.ini`:
56- ```ini
57- lib_deps =
58- https://github.com/theohg/bq25756e_multiplatform.git#${{ steps.version.outputs.VERSION }}
59- ```
60-
61- Or download the zip and place in your project's `lib/` directory.
62-
63- #### Arduino IDE
64- 1. Download `bq25756e_multiplatform-${{ steps.version.outputs.VERSION }}.zip`
65- 2. In Arduino IDE: Sketch → Include Library → Add .ZIP Library
66- 3. Select the downloaded zip file
67-
68- ### Examples
69- - `basic_charging` - Charger initialization and status monitoring
70- - `status_monitoring` - ADC readings and fault detection
71-
72- See the `examples/` folder for complete code.
73-
74- ### Documentation
75- Full documentation at https://github.com/${{ github.repository }}
110+ body_path : release-body.md
76111 files : |
77112 bq25756e_multiplatform-*.zip
78113 draft : false
0 commit comments