-
Notifications
You must be signed in to change notification settings - Fork 1
ci: Sync driver versions on release via semantic-release. #339
Description
Description
When semantic-release creates a new version, automatically update the version in all driver metadata files so they stay in sync with the project version.
Context
Currently, all `manifest.py` files have `version="0.0.1"` hardcoded while the project is at v0.10.0. Once `package.json` files are added (#338), their versions must also be kept in sync.
Tasks
- Update `.releaserc.json` `prepareCmd` to update versions in:
- `lib/*/manifest.py` — MicroPython firmware freeze metadata
- `lib/*/package.json` — mip package metadata (after feat: Add mip package.json for all drivers. #338)
- Add the modified files to `@semantic-release/git` `assets` list
- Test: a release commit should update all version strings consistently
Implementation
Extend the `prepareCmd` in `.releaserc.json`:
```bash
VERSION=${nextRelease.version}
sed -i 's/^version = "."/version = "'$VERSION'"/' pyproject.toml
find lib -name manifest.py -exec sed -i 's/version="[^"]"/version="'$VERSION'"/' {} +
find lib -name package.json -exec sed -i 's/"version": "[^"]*"/"version": "'$VERSION'"/' {} +
```
Add to `assets`:
```json
"assets": ["CHANGELOG.md", "pyproject.toml", "lib//manifest.py", "lib//package.json"]
```
Depends on
- feat: Add mip package.json for all drivers. #338 (mip package.json)