convert-csv-to-json 2.7.0 → 2.9.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.
@@ -30,10 +30,11 @@ jobs:
30
30
  name: release
31
31
  runs-on: ubuntu-latest
32
32
  steps:
33
- - uses: actions/checkout@v4
33
+ - uses: actions/checkout@v4
34
34
  with:
35
35
  token: ${{ secrets.ACTION_TOKEN }}
36
36
  - uses: fregante/setup-git-user@v2
37
+ - run: git config --global user.name "dependabot"
37
38
  - name: Use Node.js 21.x
38
39
  uses: actions/setup-node@v4
39
40
  with:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "convert-csv-to-json",
3
- "version": "2.7.0",
3
+ "version": "2.9.0",
4
4
  "description": "Convert CSV to JSON",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,6 +1,8 @@
1
1
  #!/bin/bash
2
+
2
3
  set -e
3
- echo "Start Semantic Versioning release...";
4
+
5
+ validate_is_master_branch(){
4
6
  echo "Checking branch...";
5
7
  RELEASE_BRANCH="master";
6
8
  CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD);
@@ -9,6 +11,9 @@ if [ $RELEASE_BRANCH != $CURRENT_BRANCH ]; then
9
11
  echo "Exiting...";
10
12
  exit 0;
11
13
  fi
14
+ }
15
+
16
+ npm_release(){
12
17
  PATCH_MSG="[PATCH]";
13
18
  MAJOR_MSG="[MAJOR]";
14
19
  echo "Parsing git message...";
@@ -16,12 +21,34 @@ COMMIT_MSG=$(git log -1 --pretty=format:"%s");
16
21
  echo "Last commit message: ${COMMIT_MSG}";
17
22
  if [[ $COMMIT_MSG == *"$PATCH_MSG"* ]]; then
18
23
  echo "Executing new PATCH release..."
19
- npm run version-patch;
24
+ npm version patch --force;
20
25
  elif [[ $COMMIT_MSG == *"$MAJOR_MSG"* ]]; then
21
26
  echo "Executing new MAJOR release..."
22
- npm run version-major;
27
+ npm version major --force;
23
28
  else
24
29
  echo "Executing new MINOR release...";
25
- npm run version-minor;
30
+ npm version minor --force;
26
31
  fi
27
- echo "End Semantic Versioning release.";
32
+ echo "Publish new version..."
33
+ npm publish;
34
+ echo "New version successfully published."
35
+ }
36
+
37
+ push_git_info(){
38
+ echo "Publish git info...";
39
+ TAG=$(git describe --tags --abbrev=0)
40
+ git commit --amend -m "new release $TAG [skip ci]"
41
+ echo "new commit message: $(git log -1 --pretty=format:"%s")"
42
+ git push --follow-tags
43
+ git push origin $TAG
44
+ }
45
+
46
+ execute-new-release(){
47
+ echo "Start Semantic Versioning release...";
48
+ validate_is_master_branch;
49
+ npm_release;
50
+ push_git_info;
51
+ echo "End Semantic Versioning release.";
52
+ }
53
+
54
+ execute-new-release;