Changelog Bubbler
Compares two git refs and gathers changelogs from all dependencies
Overview
The goal of this package is to automate the process of creating a changelog diff for flutter and dart applications. This package is meant to be used to create a master changelog for each release. This package creates one document which contains both the root package changes as well as changes found in every sub-package.
How it Works
This package generates a single CHANGELOG_BUBBLED.md file which contains the changelog diff from this application and every depended on dart application.
This builder works as follows:
-
Read passed in args (ie.. see args by running
dart pub run changelog_bubbler --help
) -
Copy source Repo into temp folder and check out at specified ref
-
Gather info of repo in states current and previous
- Run pub get
- Read pubspec lock
- Build dep list based on pubspec lock and pub_cache
- Store path to pub_cache in dependency class for later reference
-
Build list of changed dependencies
- Group by Host URL (ie.. pub.dev, git, or hosted refs)
- Only gather changed deps
- Print:
- name 1.0.0 -> 2.0.0
- Changelog diff from package
-
Create a file with the information gathered above
Usage
-
Add
changelog_bubbler
todev_dependencies
inpubspec.yaml
name: example_cli dev_dependencies: changelog_bubbler: ^1.0.0
-
Run a build
> dart pub run changelog_bubbler
-
CHANGELOG_BUBBLED.g.md
will be generated with content:
Example app
## pub.dev
my_app_core 1.0.0 - 1.1.0
# 1.1.0
- chore: something changed
## pub.dev - Transitive
analyzer 1.0.0 - 2.0.0
\# 2.0.0
- chore: something changed
\# 1.3.0
- chore: something changed
\# 1.1.0
- chore: something changed
See a full example output here: Example App Output
Note If you are using this in Github Actions, you will need to set the fetch-depth of the checkout command to "0" so that tags are fetched
steps:
- uses: actions/checkout@v3
with:
# Fetch depth 0 so that tags are fetched
fetch-depth: 0
Advanced
Previous Ref
By default the changelog will be generated based on a diff between the current git state and the previous tag.
To specify your own ref to compare with the current state, pass a flag named previous-ref
with your desired git ref.
example:
dart pub run changelog_bubbler --previous-ref 8762db
example:
dart pub run changelog_bubbler --previous-ref v2.0.0
Output File
To change the path of the generated file, pass a flag named output
.
example:
dart pub run changelog_bubbler --output MY_COOL_CHANGELOG_NAME.md
Templates
All output is built based on templates found in the Template Folder.
Any of the templates can be overriden by passing a path option.
example:
dart pub run changelog_bubbler --changelog-template-path '/Users/micaiah.skolnick/Repos/alkami/changelog_bubbler/asset_test/changelog_template.html'
Run dart pub run changelog_bubbler --help
to see a list of all possible path overrides.