@thisismanta/semantic-version 2.0.0-9 → 2.0.0

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 +28 -5
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,6 +1,4 @@
1
- Once installed, this package verifies your upcoming **Git commit messages** against the convention and automatically runs `npm version` after a commit if needed.
2
-
3
- ## Git commit message convention
1
+ Once installed, this package verifies your upcoming **Git commit messages** against the convention below.
4
2
 
5
3
  ```
6
4
  <type>[!]: <subject>
@@ -10,11 +8,36 @@ Where
10
8
  - `!` indicates that the commit contains breaking changes.
11
9
  - `<subject>` is the actual commit message where the first word must be written in lower cases.
12
10
 
13
- ## Versioning
11
+ ---
12
+
13
+ Additionally, you can run `npx auto-npm-version` on **GitHub Actions** to trigger `npm version` based on your commit messages and create a GitHub release (optional).
14
14
 
15
15
  |Commit message type|Post-commit command|
16
16
  |---|---|
17
17
  |`!`|`npm version major`|
18
18
  |`feat`|`npm version minor`|
19
19
  |`fix`|`npm version patch`|
20
- |Others|Does not run `npm version`|
20
+ |Others|Does not run `npm version`|
21
+
22
+ Here's an example of **GitHub Actions** workflow file:
23
+
24
+ ```yml
25
+ on:
26
+ push:
27
+ branches: [master]
28
+ jobs:
29
+ release:
30
+ runs-on: ubuntu-latest
31
+ steps:
32
+ - uses: actions/checkout@v3
33
+ with:
34
+ fetch-depth: 0 # Ensure Git tags are fetched
35
+ - uses: actions/setup-node@v3
36
+ with:
37
+ node-version-file: 'package.json'
38
+ cache: npm
39
+ - run: npm ci # Install semantic-version as part of the dependencies
40
+ - run: npx auto-npm-version
41
+ env:
42
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Make it possible to create a new release using GitHub API
43
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thisismanta/semantic-version",
3
- "version": "2.0.0-9",
3
+ "version": "2.0.0",
4
4
  "author": "Anantachai Saothong <thisismanta@gmail.com>",
5
5
  "license": "ISC",
6
6
  "engines": {