Skip to content

Commit 1d08932

Browse files
authored
chore: automate releases (#1314)
1 parent 287f751 commit 1d08932

File tree

7 files changed

+108
-36
lines changed

7 files changed

+108
-36
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: release_please
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
on:
8+
workflow_dispatch:
9+
push:
10+
branches:
11+
- main
12+
13+
jobs:
14+
create_release_pr:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: googleapis/release-please-action@v4
19+
with:
20+
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
21+
manifest-file: ".release-please-manifest.json"
22+
config-file: ".release-please-config.json"

.release-please-config.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"changelog-sections": [
4+
{ "type": "feat", "section": "Features" },
5+
{ "type": "fix", "section": "Bug Fixes" },
6+
{ "type": "refactor","section": "Refactors" },
7+
{ "type": "chore", "section": "Miscellaneous Chores" },
8+
{ "type": "docs", "section": "Docs" }
9+
],
10+
"pull-request-header": ":rotating_light: There are changes ready for release :rocket:\n\nℹ Merge this PR once the team confirms the release is ready.\n",
11+
"pull-request-title-pattern": "chore: ${version}",
12+
"include-component-in-tag": false,
13+
"extra-files": [
14+
"lib/src/version.dart"
15+
],
16+
"packages": {
17+
".": {
18+
"release-type": "dart",
19+
"changelog-path": "CHANGELOG.md",
20+
"version-file": "pubspec.yaml"
21+
}
22+
}
23+
}

.release-please-manifest.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
".": "0.26.2"
3+
}
4+

CHANGELOG.md

Lines changed: 35 additions & 34 deletions
Large diffs are not rendered by default.

CONTRIBUTING.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,29 @@ dart fix --apply
125125

126126
💡 **Note**: While the prerequisites above must be satisfied prior to having your pull request reviewed, the reviewer(s) may ask you to complete additional work, tests, or other changes before your pull request can be accepted.
127127

128+
129+
### 🛠️ Release Process (Automated via `release-please-action`)
130+
131+
We use [`release-please-action`][release-please-action-link] to automate versioning and changelog generation.
132+
133+
- Every commit to `main` is analyzed using [Conventional Commits][conventional_commits_link].
134+
- When a commit indicates a version bump is needed, a **release PR** is automatically created or updated.
135+
- The release PR includes:
136+
- An updated `CHANGELOG.md`
137+
- A version bump in `pubspec.yaml`
138+
- A version bump in `lib/src/version.dart`
139+
- Once the release PR is merged:
140+
- A new Git tag is created.
141+
- A GitHub release is published with the changelog.
142+
143+
#### 💡 Notes
144+
145+
- Use `feat`, `fix`, or `BREAKING CHANGE:` in commit messages to trigger version bumps.
146+
- The release PR can be manually edited before merging.
147+
- The GitHub Action is configured in `.github/workflows/release_please.yaml`
148+
- release-please settings are defined in `.release-please-config.json` and `.release-please-manifest.json`
149+
150+
[release-please-action-link]: https://github.com/googleapis/release-please-action
128151
[conventional_commits_link]: https://www.conventionalcommits.org/en/v1.0.0
129152
[bug_report_link]: https://github.com/VeryGoodOpenSource/very_good_cli/issues/new?assignees=&labels=bug&template=bug_report.md&title=fix%3A+
130153
[very_good_core_link]: doc/very_good_core.md

lib/src/version.dart

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pubspec.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ dependencies:
3333
dev_dependencies:
3434
build_runner: ^2.4.12
3535
build_verify: ^3.1.0
36-
build_version: ^2.1.1
3736
mocktail: ^1.0.4
3837
test: ^1.25.8
3938
very_good_analysis: ^9.0.0

0 commit comments

Comments
 (0)