automate-release 2.1.0 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +39 -216
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -1,253 +1,76 @@
1
1
  <div align="center">
2
- <img width="250" src="https://github.com/Kikobeats/automate-release/raw/master/media/logo.png" alt="Awesome">
3
- <br>
4
- <br>
2
+ <img width="150" src="https://github.com/Kikobeats/automate-release/raw/master/media/logo.png" alt="automate-release">
3
+ <br>
5
4
  <br>
6
5
  </div>
7
6
 
8
- > **TL;DR** Run `npx automate-release` 🎉.
9
-
10
- A release might seem just an irrelevant number, but here you'll find why you should be using it.
11
-
12
- Release software is part of our developer day, but we tend to run it manually just we remember it, being a source of errors.
13
-
14
- Nowadays, we have the best tools to automate this task so let's use them.
15
-
16
- Your next release will be automatically doing:
17
-
18
- - [Follow a Git Commit Convention](#follow-a-git-commit-convention)
19
- * [Commit Message Guidelines](#commit-message-guidelines)
20
- * [Examples of Git Commits](#examples-of-git-commits)
21
- - [Determinate Next Version Based on History](#determinate-next-version-based-on-history)
22
- * [GitHub Release](#github-release)
23
- - [Continous Release](#continous-release)
24
- * [Release on CI/CD](#release-on-cicd)
25
- - [Communicate Your Changes](#communicate-your-changes)
26
- * [Be Notified](#be-notified)
27
- * [Publishing the Latest Release](#publishing-the-latest-release)
28
-
29
- Let me show you how to do it.
30
-
31
- ## Follow a Git Commit Convention
32
-
33
- > **Tip**: You can use a different [convention configuration](https://github.com/marionebl/commitlint#shared-configuration).
34
-
35
- Using a `git commit` convention for our git messages help us all the messages of the contributors have a homogeneous appearance.
36
-
37
- In addition, because we are going to use the same pattern for all the git messages, we can use that for do extra things, like for example, classify commits correctly at `CHANGELOG.md` or determinate what is the next version to release based on commit history.
38
-
39
- For ensuring all git messages follow the same pattern, We are going to use [commitlint](https://github.com/marionebl/commitlint) for linting git messages.
40
-
41
- ![](https://i.imgur.com/nZOE5Vu.png)
42
-
43
- You can't do the commit until the format is valid: It'll force you to follow a strict format into your git messages.
44
-
45
- <small>(Actually, you could bypass this step using the `--no-verify` option, but avoid do that).</small>
46
-
47
- That's also a thing applicable to Pull Request title:
48
-
49
- ![](https://i.imgur.com/xfikguc.png)
50
-
51
- In that case, integrate [commitlintbot](https://github.com/paulirish/commitlintbot) with your git project to have the same effect.
52
-
53
- ### Commit Message Guidelines
54
-
55
- > **Tip**: Read more on [Angular contribution guideline](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#type).
56
-
57
- The git message must have a **type**. It could be:
58
-
59
- * **build**: Changes that affect the build system or external dependencies.
60
- * **ci**: Changes to our CI configuration files and scripts.
61
- * **docs**: Documentation only changes.
62
- * **feat**: A new feature.
63
- * **fix**: A bug fix.
64
- * **perf**: A code change that improves performance.
65
- * **refactor**: A code change that neither fixes a bug or adds a feature.
66
- * **style**: Changes that do not affect the meaning of the code.
67
- * **test**: Adding missing tests or correcting existing tests.
68
-
69
- I know. really, I know.
70
-
71
- The first time you use a convention for commits, you might think that it's **over-engineering**.
72
-
73
- But, after use it a bit, it's **very helpful**, It makes easy read all the commits quickly or just focus in a determinate type of commits.
74
-
75
- ### Examples of Git Commits
76
-
77
- All the following examples are usual and valid:
78
-
79
- ```bash
80
- build: update dependencies
81
- ci: setup travis credentials
82
- refactor: move scripts
83
- fix: use user agent provided by parameters
84
- test: update snapshots
85
- style: use space instead of tabs
86
- ```
87
-
88
- ## Determinate Next Version Based on History
89
-
90
- Now that we have a `git commit` convention, we can jump in the next thing, that will make our first release 🎉.
91
-
92
- For do that, we are going to use [standard-version](https://github.com/conventional-changelog/standard-version). After reading your git history and it will determinate what is the next release version.
93
-
94
- ![](https://i.imgur.com/nmfLfkC.png)
95
-
96
- [standard-version](https://github.com/conventional-changelog/standard-version) will determinate automagically the next version to release based on your `git history`.
97
-
98
- For do that it will consider:
99
-
100
- **patches** (`1.0.0` → `1.0.1`)
7
+ **automate-release** configures your project so that every commit pushed to the main branch triggers a new release automatically. No human factor is involved.
101
8
 
102
- ```bash
103
- git commit -a -m "fix(parsing): fixed a bug in our parser"
104
- ```
105
-
106
- **features** (`1.0.0` → `1.1.0`)
9
+ When you create a new project, the first thing you should do is:
107
10
 
108
11
  ```bash
109
- git commit -a -m "feat(parser): we now have a parser \o/"
12
+ npx automate-release
110
13
  ```
111
14
 
112
- **breaking changes** (`1.0.0` `2.0.0`)
15
+ If you use [direnv](https://direnv.net/) with a `.envrc` file, you can also sync your local tokens to GitHub Secrets automatically:
113
16
 
114
17
  ```bash
115
- git commit -a -m "feat(new-parser): introduces a new parsing library
116
- BREAKING CHANGE: new library does not support foo-construct"
117
- ```
118
-
119
- A release has some tasks associated:
120
-
121
- - 👉 Increment the version at `package.json`.
122
- - 👉 Generate a new entry in your `CHANGELOG.md`
123
- - 👉 Create a new specific git commit for the released version.
124
- - 👉 Create a new `git tag` with the version associated.
125
-
126
- In addition, GitHub usernames (`@kikobeats`) and issue references (`#133`) will be swapped out for the
127
- appropriate URLs in your `CHANGELOG.md`.
128
-
129
- A good practice is to put the command as `npm run release` script for performing the action.
130
-
131
- ```json
132
- {
133
- "scripts": {
134
- "release": "standard-version",
135
- "release:tags": "git push --follow-tags origin master",
136
- "postrelease": "npm run release:tags"
137
- }
138
- }
18
+ GH_TOKEN=xxx npx automate-release --tokens
139
19
  ```
140
20
 
141
- As you can see, we associated push things into your master remote branch.
142
-
143
- So, next time you want to do a release, just type `npm run release` (make sense, uh).
21
+ This single command bootstraps your repository with the best practices for software releasing:
144
22
 
145
- ![](https://i.imgur.com/AmOfMV9.png)
23
+ https://github.com/user-attachments/assets/be26eb77-2ffd-46d1-9414-3ed063ece8fc
146
24
 
147
- The first time you released a version, a `CHANGELOG.md` will be created. Otherwise, it will append just the new released version:
25
+ Releasing software is a fundamental part of our developer life, but we often do it manually, which is a source of errors and takes time away from what we love: coding.
148
26
 
149
- ![](https://i.imgur.com/B2CoFsG.png)
27
+ `automate-release` brings you:
150
28
 
151
- The `CHANGELOG.md` follows [Keep a Changelog](https://keepachangelog.com) specification.
29
+ - [Follow a git commit convention](#follow-a-git-commit-convention)
30
+ - [History-driven releases](#history-driven-releases)
31
+ - [Seamless GitHub integration](#seamless-github-integration)
152
32
 
33
+ ## Follow a git commit convention
153
34
 
154
- You can write into it and your words will be preserved between versions.
35
+ Using a convention for git messages ensures that all contributors produce a homogeneous history. But it's not just about aesthetics; it's about **programmable history**.
155
36
 
156
- ![](https://i.imgur.com/QOse3tZ.png)
157
-
158
- ### GitHub Release
159
-
160
- GitHub (and GitLab too) has a special place into the repository for reflecting releases:
161
-
162
- ![](https://i.imgur.com/butKsZ6.png)
163
-
164
- When you push a `git tag`, it will appear here, but nothing more. No text or changes associated.
165
-
166
- Now that we are generating a `CHANGELOG.md` it would be interesting to reflect the changes associated with each version.
167
-
168
- We can use a tool called [releaser-tools](https://github.com/conventional-changelog/releaser-tools) who will do exactly that, leaving our release section pretty 💅.
169
-
170
- > **Note**: Remember to setup [`CONVENTIONAL_GITHUB_RELEASER_TOKEN`](https://github.com/conventional-changelog/releaser-tools/tree/master/packages/conventional-github-releaser#setup-token-for-cli). You can use [direnv](https://direnv.net/) for declaring local development variables.
171
-
172
- We need to associate it as part of our `postrelease` script:
173
-
174
- ```json
175
- {
176
- "scripts": {
177
- "postrelease": "npm run release:tags && npm run release:github",
178
- "release": "standard-version",
179
- "release:github": "github-generate-release",
180
- "release:tags": "git push --follow-tags origin master"
181
- }
182
- }
183
- ```
37
+ ![](https://i.imgur.com/IxPIf84.png)
184
38
 
185
- Next time, your metadata will be associated with the GitHub/GitLab release 🎉
39
+ By following a pattern, we can automatically classify commits in a `CHANGELOG.md` and determine the next version to release (patch, feature, or breaking change).
186
40
 
187
- ![](https://i.imgur.com/4Am8xIx.png)
41
+ ![](https://i.imgur.com/oNbbWV9.png)
188
42
 
189
- ## Continous Release
43
+ `automate-release` sets up [commitlint](https://github.com/marionebl/commitlint) for that purpose:
190
44
 
191
- The human behavior in a release process should be very limited: we, as humans, just want to be the trigger for the next release.
192
-
193
- The rest of the things should be work in a boring and automated way 🤖.
194
-
195
- ![](https://github.com/googleapis/release-please/raw/master/screen.png)
196
-
197
- Every commit that land on the `master` branch will mean that a new version of your software could be released.
198
-
199
- For projects with a lot of activity, the condition could be a little bit more relaxed; In that case, check [release-please](https://github.com/googleapis/release-please), where you have more control about when the next release will be shipped.
200
-
201
- ### Release on CI/CD
202
-
203
- The right place to do this is as part of our **Continuous Integration**.
204
-
205
- ![](https://i.imgur.com/go4oZjJ.png)
206
-
207
- Every time a new Pull Request is merged in our `master` branch, our **Tests** will be executed to determinate if all is fine (nothing new here).
208
-
209
- But now, after that, The **Release** stage will be executed, that will perform our `npm run release` command to complete the action.
210
-
211
- <div align="center">
212
- <img src="https://i.imgur.com/7x6doze.jpg">
213
- <div><smal>Have you noticed that? It's the sweet sensation of automation.</small></div>
214
- <br>
215
- </div>
216
-
217
- That's specially helpful as maintainer if you are already have automated part of the process that uses services such as [Greenkeeper](https://greenkeeper.io) to keep your dependencies up to date, that create PR very often if you have many dependencies or they are updated very often (something that happens all the time at NPM ecosystem).
218
-
219
- You can see [.travis.yml](/.travis.yml) to see how it is done or just run `npx automate-release` to install it in your project folder.
220
-
221
- ## Communicate Your Changes
222
-
223
- Releases also is a way to establish a compromise with your audience in order to know what's news.
45
+ ![](https://i.imgur.com/nZOE5Vu.png)
224
46
 
225
- ![](https://i.imgur.com/5vDpWJM.jpg)
47
+ You won't be able to commit unless the format is valid. It follows the [conventional commits specification](https://conventional-commits.vercel.app/), which quickly becomes the backbone of your automation.
226
48
 
227
- From [now](https://twitter.com/github/status/1067483957573373952) GitHub brings the ability to subscribe to any repository for getting notifications related with new versions.
49
+ ## History-driven releases
228
50
 
229
- ### Be Notified
51
+ As every commit pushed to the main branch will trigger a release, the next version is automatically determined based on your git history following [semver](https://semver.org/) rules:
230
52
 
231
- Alternatively, you can get release information from different sources and connect it with third party services using different ways.
53
+ - **patch** (`1.0.0` `1.0.1`): When you commit a `fix`.
54
+ - **minor** (`1.0.0` → `1.1.0`): When you commit a `feat`.
55
+ - **major** (`1.0.0` → `2.0.0`): When you commit a `BREAKING CHANGE`.
232
56
 
233
- ![](https://i.imgur.com/uXLNGtp.png)
57
+ ![](https://i.imgur.com/nmfLfkC.png)
234
58
 
235
- Just you need to recover the latest release and publish it on other channel using an intermediate service that connects it over Twitter, Slack or where your audience is.
59
+ This automated process handles the tedious work of incrementing the version in `package.json`, generating the `CHANGELOG.md` entry, and creating the release commit and tag.
236
60
 
237
- #### GitHub
61
+ ## Seamless GitHub integration
238
62
 
239
- - [GitHub API](https://api.github.com/repos/Kikobeats/automate-release/releases/latest) For recovering information per `owner_name/repo_name`.
240
- - [GitHub RSS Feed](https://github.com/Kikobeats/automate-release/releases.atom) – For getting atom feed per `owner_name/repo_name`.
63
+ The human factor in a release should be limited to being the trigger: just push your code. Everything else should be automated.
241
64
 
242
- ### Publishing the Latest Release
65
+ `automate-release` deploys **GitHub Actions** that handle the entire workflow automatically:
243
66
 
244
- #### Services
67
+ - **Reliability**: Tests are executed on every push to ensure stability before any release.
68
+ - **Automation**: Contributors list is automatically updated and pushed back to the repository.
69
+ - **Transparency**: Your `CHANGELOG.md` is synchronized with your **GitHub Releases**.
70
+ - **Distribution**: The package is automatically published to the **NPM registry** once the release is tagged.
245
71
 
246
- - [release-notifier!](https://release-notifier.com/) - GitHub Release Notifications via E-mail or webhook (e.g. Rocket.chat channel)
247
- - [CodeRelease.io](https://coderelease.io) - GitHub Release Notifications on Your E-mail.
248
- - [IFTTT](https://ifttt.com) / [Zapier](https://zapier.com/) – For declaring using *RSS-to-Slack* recipes or similar.
249
- - [@github_releases_notify_bot](https://telegram.me/github_releases_notify_bot) – Telegram bot to receive release notifications.
72
+ ![](https://i.imgur.com/vEXF1PF.png)
250
73
 
251
- #### Self-Hosted
74
+ A release is a commitment to your audience. `automate-release` ensures your users stay informed by reflecting your changes directly into the GitHub Release section, making your project look professional and transparent.
252
75
 
253
- - [tom.js.org](http://tom.js.org/) – A tiny microservice for sending notifications using multiple channels (Slack/Twitter/Telegram/Email).
76
+ ![](https://i.imgur.com/4Oen6QX.png)
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "automate-release",
3
3
  "description": "No more manual work in your software releases.",
4
4
  "homepage": "https://github.com/kikobeats/automate-release",
5
- "version": "2.1.0",
5
+ "version": "2.1.2",
6
6
  "main": "index.js",
7
7
  "bin": {
8
8
  "automate-release": "bin/index.js"
@@ -44,7 +44,7 @@
44
44
  "json-future": "~2.2.4",
45
45
  "lodash": "~4.17.19",
46
46
  "meow": "~9.0.0",
47
- "nanospinner": "~1.1.0",
47
+ "nanospinner": "~1.2.2",
48
48
  "picocolors": "~1.1.0",
49
49
  "terminal-link": "~2.1.1",
50
50
  "tinyspawn": "~1.5.5",
@@ -76,7 +76,7 @@
76
76
  "postrelease": "npm run release:tags && npm run release:github && (ci-publish || npm publish --access=public)",
77
77
  "pretest": "npm run lint",
78
78
  "release": "pnpm run release:version && pnpm run release:changelog && pnpm run release:commit && pnpm run release:tag",
79
- "release:changelog": "conventional-changelog -i CHANGELOG.md",
79
+ "release:changelog": "conventional-changelog -p conventionalcommits -i CHANGELOG.md -s",
80
80
  "release:commit": "git add package.json CHANGELOG.md && git commit -m \"chore(release): $(node -p \"require('./package.json').version\")\"",
81
81
  "release:github": "github-generate-release",
82
82
  "release:tag": "git tag -a v$(node -p \"require('./package.json').version\") -m \"v$(node -p \"require('./package.json').version\")\"",