-
Detect current version from pubspec.yaml:
- Read the
version: field (e.g., 2.0.2).
-
Get the latest Git tag:
git tag --sort=-v:refname | head -1
-
Analyze unreleased changes:
git log <latest-tag>..HEAD --oneline
-
Categorize commits by conventional commit type:
| Category | Keywords |
|---|
| Major | breaking, BREAKING CHANGE |
| Minor | feat, feature |
| Patch | fix, docs, chore, refactor, test, changelog |
-
Determine next semantic version based on the highest category found.
-
Update version in pubspec.yaml:
- Replace the
version: field with the new version.
-
Create or update CHANGELOG.md:
- Add a new section at the top:
## X.Y.Z
### Features
- Added ...
### Fixes
- Fixed ...
### Documentation
- Updated ...
-
Generate a release summary with:
- New version number
- Number of commits by category
- Key changes
-
Prompt the user to:
git commit -m "Bump version to X.Y.Z"
git tag vX.Y.Z
git push && git push --tags
-
Verify publishing metadata:
- Confirm
pubspec.yaml has homepage, description, and valid version.
- No sensitive or private packages (check for
publish_to: none).