Skip to content

ci: Sync driver versions on release via semantic-release. #339

@nedseb

Description

@nedseb

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:
  • 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

Metadata

Metadata

Assignees

Labels

ciCI/CD, workflows, linting

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions