qcobjects-cli 2.5.144-beta → 2.5.146-beta

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.
@@ -36,11 +36,8 @@ jobs:
36
36
  - uses: actions/setup-node@v4
37
37
  with:
38
38
  node-version: 22
39
- registry-url: https://registry.npmjs.org/
40
39
  - name: Upgrade npm for OIDC support (requires >=11.5.1)
41
40
  run: npm install -g npm@latest
42
- - name: Clear auth token so npm falls back to OIDC
43
- run: npm config delete "//registry.npmjs.org/:_authToken"
44
41
  - run: npm i --legacy-peer-deps
45
42
  - run: npm test
46
43
  - run: npm publish --tag beta
@@ -36,10 +36,7 @@ jobs:
36
36
  - uses: actions/setup-node@v4
37
37
  with:
38
38
  node-version: 22
39
- registry-url: https://registry.npmjs.org/
40
39
  - name: Upgrade npm for OIDC support (requires >=11.5.1)
41
40
  run: npm install -g npm@latest
42
- - name: Clear auth token so npm falls back to OIDC
43
- run: npm config delete "//registry.npmjs.org/:_authToken"
44
41
  - run: npm i --legacy-peer-deps
45
42
  - run: npm publish --tag lts
@@ -36,10 +36,7 @@ jobs:
36
36
  - uses: actions/setup-node@v4
37
37
  with:
38
38
  node-version: 22
39
- registry-url: https://registry.npmjs.org/
40
39
  - name: Upgrade npm for OIDC support (requires >=11.5.1)
41
40
  run: npm install -g npm@latest
42
- - name: Clear auth token so npm falls back to OIDC
43
- run: npm config delete "//registry.npmjs.org/:_authToken"
44
41
  - run: npm i --legacy-peer-deps
45
42
  - run: npm publish
package/README.md CHANGED
@@ -108,6 +108,37 @@ qcobjects v-patch --git --npm -m "your message"
108
108
  qcobjects v-changelog > CHANGELOG.md
109
109
  ```
110
110
 
111
+ ### CI Pipeline Considerations
112
+
113
+ When using `v-patch --git --npm`, the command calls `npm version` internally. This triggers the `preversion` and `postversion` scripts in your `package.json`:
114
+
115
+ - **`preversion`** — runs before the version bump (e.g., tests)
116
+ - **`postversion`** — runs after the bump (e.g., `git push && git push --tags`)
117
+
118
+ After `npm version` finishes, `syncGit` creates a second commit for the `VERSION` file and calls `git push && git push --tags` again. This means the version tag is pushed **twice**, which can trigger duplicate CI pipeline runs.
119
+
120
+ #### Recommendations by setup
121
+
122
+ | Setup | Recommendation |
123
+ |-------|---------------|
124
+ | **GitHub Actions** (tag-triggered publish) | Set `postversion` to only push the branch: `"postversion": "git push"` |
125
+ | **GitLab CI / other CI** | Keep `"postversion": "git push && git push --tags"` — duplicate triggers are harmless |
126
+ | **Manual publish only** | Use `--git` without `--npm` to skip `npm version` entirely (no lifecycle scripts run) |
127
+
128
+ #### Avoid duplicates with `v-patch --git` (no `--npm`)
129
+
130
+ Without `--npm`, `npm version` is never called. Only the `VERSION` file is committed, a single tag is created, and a single `git push && git push --tags` runs. No duplicate tag push, no duplicate CI.
131
+
132
+ #### Example: qcobjects-cli
133
+
134
+ This repo uses GitHub Actions and configures `postversion` to push the branch only:
135
+
136
+ ```json
137
+ "postversion": "git push"
138
+ ```
139
+
140
+ The tag is still pushed once by `syncGit` after the `VERSION` file is committed.
141
+
111
142
  ---
112
143
 
113
144
  ```shell
package/VERSION CHANGED
@@ -1 +1 @@
1
- 2.5.144-beta
1
+ 2.5.146-beta
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qcobjects-cli",
3
- "version": "2.5.144-beta",
3
+ "version": "2.5.146-beta",
4
4
  "description": "qcobjects cli command line tool",
5
5
  "main": "public/cjs/index.js",
6
6
  "module": "public/esm/index.mjs",
@@ -89,7 +89,7 @@
89
89
  "lint": "(npx -y eslint src/**/*.ts --fix )",
90
90
  "preversion": "npm cache verify && npm test",
91
91
  "sync": "git add . && git commit -am ",
92
- "postversion": "git push && git push --tags",
92
+ "postversion": "git push",
93
93
  "v-patch": "qcobjects v-patch",
94
94
  "v-minor": "qcobjects v-minor",
95
95
  "v-major": "qcobjects v-major",
package/.gitlab-ci.yml DELETED
@@ -1,16 +0,0 @@
1
- image: node:latest
2
-
3
- stages:
4
- - deploy
5
-
6
- deploy:
7
- stage: deploy
8
- rules:
9
- - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_REF_NAME =~ /^v\d+\.\d+\.\d+.*$/
10
- changes:
11
- - package.json
12
- script:
13
- - npm config set @scope:registry https://registry.npmjs.org/
14
- - npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
15
- - npm ci
16
- # - npm publish --verbose