Skip to content

Commit 0b293a8

Browse files
chore: automate releases with release-please action (#396)
* feat: add release-please workflow Adds a GitHub Actions workflow to automate releases using release-please. The workflow runs on pushes to main and can be triggered manually. * feat: configure release-please settings Adds release-please configuration with changelog sections and pull request settings. Initializes manifest with version 1.18.0. * remove the scripts from /tool * chore: format changelog * feat: exclude paths that do not warrant a release * chore: update contributing doc * feat: automate major version tagging --------- Co-authored-by: Matias Leyba <[email protected]>
1 parent 8492cf6 commit 0b293a8

File tree

7 files changed

+111
-166
lines changed

7 files changed

+111
-166
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
release-please:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: googleapis/release-please-action@v4
18+
id: release-please
19+
with:
20+
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
21+
manifest-file: ".release-please-manifest.json"
22+
config-file: ".release-please-config.json"
23+
24+
- name: Checkout code
25+
if: ${{ steps.release-please.outputs.release_created }}
26+
uses: actions/checkout@v4
27+
28+
- name: Update major version tag
29+
if: ${{ steps.release-please.outputs.release_created }}
30+
run: |
31+
VERSION=${{ steps.release-please.outputs.major }}
32+
git config user.name "github-actions[bot]"
33+
git config user.email "github-actions[bot]@users.noreply.github.com"
34+
git tag -fa "v${VERSION}" -m "Update v${VERSION} to ${{ steps.release-please.outputs.tag_name }}"
35+
git push origin "v${VERSION}" --force

.release-please-config.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
"packages": {
12+
".": {
13+
"release-type": "simple",
14+
"pull-request-title-pattern": "chore: release ${version}"
15+
}
16+
},
17+
"exclude-paths": [
18+
".github",
19+
"site",
20+
".release-please-manifest.json",
21+
".release-please-config.json",
22+
"CONTRIBUTING.md",
23+
"CODE_OF_CONDUCT.md",
24+
"examples"
25+
]
26+
}

.release-please-manifest.json

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

CHANGELOG.md

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# 1.18.0
1+
# Changelog
2+
3+
## 1.18.0
24

35
- fix: update mason creds example ([#263](https://github.com/VeryGoodOpenSource/very_good_workflows/pull/263))
46
- feat: update publish workflows to use Setup Dart action ([#272](https://github.com/VeryGoodOpenSource/very_good_workflows/pull/272))
@@ -17,7 +19,7 @@
1719
- chore: add label sync action ([#176](https://github.com/VeryGoodOpenSource/very_good_workflows/pull/176))
1820
- chore: update issue templates ([#247](https://github.com/VeryGoodOpenSource/very_good_workflows/pull/247))
1921

20-
# 1.17.0
22+
## 1.17.0
2123

2224
- **dart_package:**
2325
- chore(deps): bump webfactory/ssh-agent from 0.8.0 to 0.9.0 ([#175](https://github.com/VeryGoodOpenSource/very_good_workflows/pull/175))
@@ -43,16 +45,16 @@
4345
- **semantic_pull_request:**
4446
- docs: updating semantic pull request docs ([#174](https://github.com/VeryGoodOpenSource/very_good_workflows/pull/174))
4547

46-
# 1.16.1
48+
## 1.16.1
4749

4850
- fix(dart_package): runnable skipped tests in Dart packages ([#168](https://github.com/VeryGoodOpenSource/very_good_workflows/pull/168))
4951

50-
# 1.16.0
52+
## 1.16.0
5153

5254
- docs: add example usage to license_check ([#164](https://github.com/VeryGoodOpenSource/very_good_workflows/pull/164))
5355
- feat: add timeout input to the publish workflows ([#166](https://github.com/VeryGoodOpenSource/very_good_workflows/pull/166))
5456

55-
# 1.15.0
57+
## 1.15.0
5658

5759
- chore(deps): bump actions/setup-node from 3 to 4 ([#155](https://github.com/VeryGoodOpenSource/very_good_workflows/pull/155))
5860
- chore(deps): bump streetsidesoftware/cspell-action from 2 to 4 ([#153](https://github.com/VeryGoodOpenSource/very_good_workflows/pull/153))
@@ -63,7 +65,7 @@
6365
- feat: introduce license_check workflow ([#154](https://github.com/VeryGoodOpenSource/very_good_workflows/pull/154))
6466
- chore(deps): bump streetsidesoftware/cspell-action from 4 to 5 ([#162](https://github.com/VeryGoodOpenSource/very_good_workflows/pull/162))
6567

66-
# 1.14.0
68+
## 1.14.0
6769

6870
- feat: Add `format_directories` option ([#113](https://github.com/VeryGoodOpenSource/very_good_workflows/pull/113))
6971
- feat: add `format_line_length` input ([#114](https://github.com/VeryGoodOpenSource/very_good_workflows/pull/114))
@@ -73,7 +75,7 @@
7375
- docs: link to pana versions page ([#141](https://github.com/VeryGoodOpenSource/very_good_workflows/pull/141))
7476
- fix: remove analytics due to cli update ([#143](https://github.com/VeryGoodOpenSource/very_good_workflows/pull/143))
7577

76-
# [1.13.0](https://github.com/VeryGoodOpenSource/very_good_workflows/compare/v1.12.0...v1.13.0) (2023-05-12)
78+
## [1.13.0](https://github.com/VeryGoodOpenSource/very_good_workflows/compare/v1.12.0...v1.13.0) (2023-05-12)
7779

7880
### Features
7981

@@ -82,45 +84,45 @@
8284
- add publish scripts ([#111](https://github.com/VeryGoodOpenSource/very_good_workflows/issues/111)) ([9fce5d3](https://github.com/VeryGoodOpenSource/very_good_workflows/commit/9fce5d35e66685847e8e3df2c92eda6e0cafe540))
8385
- support excluding directories ([#110](https://github.com/VeryGoodOpenSource/very_good_workflows/issues/110)) ([462b9d2](https://github.com/VeryGoodOpenSource/very_good_workflows/commit/462b9d2f52da70f6adaf85a9275b340c79ff8002))
8486

85-
# [1.12.0](https://github.com/VeryGoodOpenSource/very_good_workflows/compare/v1.11.0...v1.12.0) (2023-01-26)
87+
## [1.12.0](https://github.com/VeryGoodOpenSource/very_good_workflows/compare/v1.11.0...v1.12.0) (2023-01-26)
8688

8789
### Features
8890

8991
- replace flutter format with dart format ([#95](https://github.com/VeryGoodOpenSource/very_good_workflows/issues/95)) ([d23279e](https://github.com/VeryGoodOpenSource/very_good_workflows/commit/d23279ec9c5271ed441565df73240526b1eb5e98))
9092

91-
# [1.11.0](https://github.com/VeryGoodOpenSource/very_good_workflows/compare/v1.10.0...v1.11.0) (2022-10-27)
93+
## [1.11.0](https://github.com/VeryGoodOpenSource/very_good_workflows/compare/v1.10.0...v1.11.0) (2022-10-27)
9294

9395
### Features
9496

9597
- add cache key options ([#87](https://github.com/VeryGoodOpenSource/very_good_workflows/issues/87)) ([9aae3cb](https://github.com/VeryGoodOpenSource/very_good_workflows/commit/9aae3cb573a24e16374a0686e52ee08037bf9330))
9698

97-
# [1.10.0](https://github.com/VeryGoodOpenSource/very_good_workflows/compare/v1.9.0...v1.10.0) (2022-10-19)
99+
## [1.10.0](https://github.com/VeryGoodOpenSource/very_good_workflows/compare/v1.9.0...v1.10.0) (2022-10-19)
98100

99101
### Features
100102

101103
- add dependabot ([#79](https://github.com/VeryGoodOpenSource/very_good_workflows/issues/79)) ([bff6468](https://github.com/VeryGoodOpenSource/very_good_workflows/commit/bff6468cc09c495bfd7a8a0d87cb775c502eb0fb))
102104
- add optional setup step to flutter and dart package workflows ([#85](https://github.com/VeryGoodOpenSource/very_good_workflows/issues/85)) ([d6c97a4](https://github.com/VeryGoodOpenSource/very_good_workflows/commit/d6c97a412579a7fdda75de1f0f84634fcb6e0633))
103105

104-
# [1.9.0](https://github.com/VeryGoodOpenSource/very_good_workflows/compare/v1.8.0...v1.9.0) (2022-10-11)
106+
## [1.9.0](https://github.com/VeryGoodOpenSource/very_good_workflows/compare/v1.8.0...v1.9.0) (2022-10-11)
105107

106108
### Features
107109

108110
- **semantic_pull_request:** add types and scopes inputs ([#65](https://github.com/VeryGoodOpenSource/very_good_workflows/issues/65)) ([e54fbb1](https://github.com/VeryGoodOpenSource/very_good_workflows/commit/e54fbb1e853e28a883941d9cdbf649ec9def4faf))
109111
- spell check workflow ([#76](https://github.com/VeryGoodOpenSource/very_good_workflows/issues/76)) ([9c12bb5](https://github.com/VeryGoodOpenSource/very_good_workflows/commit/9c12bb5e67b3ce4949750c99e2e27ee137741473))
110112

111-
# [1.8.0](https://github.com/VeryGoodOpenSource/very_good_workflows/compare/v1.7.0...v1.8.0) (2022-10-04)
113+
## [1.8.0](https://github.com/VeryGoodOpenSource/very_good_workflows/compare/v1.7.0...v1.8.0) (2022-10-04)
112114

113115
### Features
114116

115117
- upgrade dart and flutter package to very_good_coverage@v2 ([#73](https://github.com/VeryGoodOpenSource/very_good_workflows/issues/73)) ([3571d72](https://github.com/VeryGoodOpenSource/very_good_workflows/commit/3571d72c0ed2b8b8bc3fb1ad7699c8dc8975984e))
116118

117-
# [1.7.0](https://github.com/VeryGoodOpenSource/very_good_workflows/compare/v1.6.0...v1.7.0) (2022-09-09)
119+
## [1.7.0](https://github.com/VeryGoodOpenSource/very_good_workflows/compare/v1.6.0...v1.7.0) (2022-09-09)
118120

119121
### Features
120122

121123
- **dart_package:** add platform input ([#70](https://github.com/VeryGoodOpenSource/very_good_workflows/issues/70)) ([575c4f8](https://github.com/VeryGoodOpenSource/very_good_workflows/commit/575c4f8928f91d46de82b132a8aa13664f811175))
122124

123-
# [1.6.0](https://github.com/VeryGoodOpenSource/very_good_workflows/compare/v1.5.4...v1.6.0) (2022-09-01)
125+
## [1.6.0](https://github.com/VeryGoodOpenSource/very_good_workflows/compare/v1.5.4...v1.6.0) (2022-09-01)
124126

125127
### Bug Fixes
126128

@@ -154,13 +156,13 @@
154156

155157
- **semantic_pull_request:** remove wip (write access) ([#54](https://github.com/VeryGoodOpenSource/very_good_workflows/issues/54)) ([6eb0847](https://github.com/VeryGoodOpenSource/very_good_workflows/commit/6eb084735c27a2b8b7a710ee5c151a1a9246f1bd))
156158

157-
# [1.5.0](https://github.com/VeryGoodOpenSource/very_good_workflows/compare/v1.4.0...v1.5.0) (2022-07-05)
159+
## [1.5.0](https://github.com/VeryGoodOpenSource/very_good_workflows/compare/v1.4.0...v1.5.0) (2022-07-05)
158160

159161
### Features
160162

161163
- **dart_package:** `report_on` and `analyze_directories` inputs ([#52](https://github.com/VeryGoodOpenSource/very_good_workflows/issues/52)) ([ab40b19](https://github.com/VeryGoodOpenSource/very_good_workflows/commit/ab40b190bc9e310a2994342498abfdb9384eeaa4))
162164

163-
# [1.4.0](https://github.com/VeryGoodOpenSource/very_good_workflows/compare/v1.3.0...v1.4.0) (2022-06-28)
165+
## [1.4.0](https://github.com/VeryGoodOpenSource/very_good_workflows/compare/v1.3.0...v1.4.0) (2022-06-28)
164166

165167
### Bug Fixes
166168

@@ -172,7 +174,7 @@
172174
- **semantic_pull_request:** add semantic pull request workflow ([#48](https://github.com/VeryGoodOpenSource/very_good_workflows/issues/48)) ([43beb8a](https://github.com/VeryGoodOpenSource/very_good_workflows/commit/43beb8a0a20617ccf02a1a5e603ba2d90e45f00d))
173175
- add semantic commit check to workflows ([#45](https://github.com/VeryGoodOpenSource/very_good_workflows/issues/45)) ([3afb04f](https://github.com/VeryGoodOpenSource/very_good_workflows/commit/3afb04feba5abf760b105c908d31b5033aaf6839))
174176

175-
# [1.3.0](https://github.com/VeryGoodOpenSource/very_good_workflows/compare/v1.2.2...v1.3.0) (2022-05-31)
177+
## [1.3.0](https://github.com/VeryGoodOpenSource/very_good_workflows/compare/v1.2.2...v1.3.0) (2022-05-31)
176178

177179
### Features
178180

@@ -191,7 +193,7 @@
191193

192194
- **dart_package:** use dart test instead of test_coverage ([#28](https://github.com/VeryGoodOpenSource/very_good_workflows/issues/28)) ([b62ee03](https://github.com/VeryGoodOpenSource/very_good_workflows/commit/b62ee0393c6da47f8fe8d452406b80aa8d217a05))
193195

194-
# [1.2.0](https://github.com/VeryGoodOpenSource/very_good_workflows/compare/v1.1.1...v1.2.0) (2022-04-07)
196+
## [1.2.0](https://github.com/VeryGoodOpenSource/very_good_workflows/compare/v1.1.1...v1.2.0) (2022-04-07)
195197

196198
### Features
197199

@@ -204,7 +206,7 @@
204206

205207
- **flutter_package:** use very_good test runner ([#17](https://github.com/VeryGoodOpenSource/very_good_workflows/issues/17)) ([37174b1](https://github.com/VeryGoodOpenSource/very_good_workflows/commit/37174b1cd607d13ad9f9f398d15a1725bccc95aa))
206208

207-
# [1.1.0](https://github.com/VeryGoodOpenSource/very_good_workflows/compare/v1.0.2...v1.1.0) (2022-02-28)
209+
## [1.1.0](https://github.com/VeryGoodOpenSource/very_good_workflows/compare/v1.0.2...v1.1.0) (2022-02-28)
208210

209211
### Features
210212

@@ -222,7 +224,7 @@
222224

223225
- enhance workflow step names ([#9](https://github.com/VeryGoodOpenSource/very_good_workflows/issues/9)) ([6429f08](https://github.com/VeryGoodOpenSource/very_good_workflows/commit/6429f0849fa0d6b9dc845d6f00d62e4a3d875ff1))
224226

225-
# [1.0.0](https://github.com/VeryGoodOpenSource/very_good_workflows/compare/07e989fcadd9f5a2250ad14b0fdb82e6c8bc6704...v1.0.0) (2022-01-12)
227+
## [1.0.0](https://github.com/VeryGoodOpenSource/very_good_workflows/compare/07e989fcadd9f5a2250ad14b0fdb82e6c8bc6704...v1.0.0) (2022-01-12)
226228

227229
### Bug Fixes
228230

CONTRIBUTING.md

Lines changed: 25 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -27,77 +27,41 @@ pull request reviewed, the reviewer(s) may ask you to complete additional
2727
work, tests, or other changes before your pull request can be ultimately
2828
accepted.
2929

30-
## 🦦 Releasing
30+
## Release Process 🚀
3131

32-
1. Go to the **main** branch and ensure it is up to date with the remote:
32+
This project uses [release-please-action](https://github.com/googleapis/release-please-action) to automate releases. Versioning
33+
and changelog generation are handled automatically based on [Conventional Commits](https://www.conventionalcommits.org/).
3334

34-
```bash
35-
git checkout main
36-
git pull
37-
```
35+
### How It Works
3836

39-
1. Run the script that will generate the CHANGELOG for you:
37+
- 📌 **On every commit to `main`:**
38+
- Commits are analyzed using Conventional Commits standards
39+
- A release PR is automatically created or updated if a version bump is needed
40+
- The **release PR** includes:
41+
- An updated `CHANGELOG.md`
42+
- A version bump in `.release-please-manifest.json`
4043

41-
```bash
42-
sh tool/release_ready.sh <new-version>
43-
```
44+
##### 💡 Notes
4445

45-
**Note 💡** : You should follow semantic versioning and bump according to the changes the new version makes.
46+
- The GitHub Action workflow that automates the release process is configured in `.github/workflows/release_please.yml`
47+
- release-please settings are defined in `.release-please-config.json` and `.release-please-manifest.json`
48+
- The release PR can be manually edited before merging
49+
- The release PR should be merged **ONLY** when a new release is needed.
4650

47-
`<new-version>`: The version of this new extension release, for example: 0.2.1
51+
<br />
4852

49-
The release_ready script will:
53+
-**When the release PR is merged:**
54+
- A new Git tag is created
55+
- A GitHub Release is published with the changelog
56+
- The new version is immediately available using: `VeryGoodOpenSource/very_good_workflows/.github/workflows/<workflow_name>@v<version>`
5057

51-
- Create a new branch just for this release and checkout to it.
52-
- Automatically update the CHANGELOG file with the associated changes.
58+
##### 💡 Notes
5359

54-
1. Manually remove the *(deps-dev)* scope or other entries of the conventional commits entries in the CHANGELOG
55-
1. Add the changes and commit with the commit message that the *release_ready* script outputted.
56-
1. Raise a Pull Request, the title should be the same as the commit message outputted by the *release_ready* script.
57-
1. When the Pull Request is merged, tag a new release to the commit. When adding the tag ensure:
58-
- The tag is pointing to the commit that you recently merged.
59-
- The title of the tag should be v<new-version>
60-
- The title of the release should be v<new-version>
61-
- The description should be a raw copy of the CHANGELOG’s file version’s body you recently crafted (without the version header). If in doubt, see the other released tags as an example.
62-
1. After the release is tagged the new changes will be available by the the following syntax:
60+
- Changes to excluded paths (.github/, site/, examples/, docs) will not trigger releases
61+
- Only workflow file changes will result in version bumps
62+
- Major version tags (e.g., `v1`) are automatically updated to point to the latest release within that major version
6363

64-
```yaml
65-
VeryGoodOpenSource/..@v<new-version>
66-
```
67-
68-
Where:
69-
70-
- `<new-version>`: The version of this new workflow or action, for example: 0.2.1
71-
72-
1. Go to the **main** branch and ensure it is up to date with the remote:
73-
74-
```yaml
75-
git checkout main
76-
git pull
77-
```
78-
79-
1. Retag the major release.
80-
81-
For the Workflow or Action to be updated for those users using the `@<major-version` syntax we will require to retag the major release.
82-
83-
```yaml
84-
sh tool/retag_v<major-version>.sh <new-version>
85-
```
86-
87-
Where:
88-
89-
- `<major-version>`: Is the major version of the release, for example in 2.16.3 the major version is 2. For more information see the [semantic versioning documentation](https://semver.org/).
90-
- `<new-version>`: The version of this new workflow or action, for example: 0.2.1.
91-
92-
If your change is a breaking change and requires a new major release you should update the name of the retag script and its `v<major-version>` instances.
93-
94-
1. After the retag the new changes will be available by the the following syntax:
95-
96-
```yaml
97-
VeryGoodOpenSource/..@v<major-version>
98-
```
99-
100-
Where: `<major-version>`: Is the major version of the release, for example in 2.16.3 the major version is 2. For more information see the [semantic versioning documentation](https://semver.org/).
64+
<br />
10165

10266
[conventional_commits_link]: https://www.conventionalcommits.org/en/v1.0.0
10367
[bug_report_link]: https://github.com/VeryGoodOpenSource/very_good_workflows/issues/new?assignees=&labels=bug&template=bug_report.md&title=fix%3A+

tool/release_ready.sh

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)