polyci 0.0.4 → 0.0.5

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/dist/main.js +23 -20
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -217,31 +217,34 @@ function appendGlobalReleaseJob(lines, modules) {
217
217
  lines.push("");
218
218
  for (const module of modules) {
219
219
  lines.push(` echo "Tagging release for ${module.moduleName} (${module.modulePath})"`);
220
- lines.push(` if [ ! -f "${module.modulePath}/semalease.env" ]; then`);
221
- lines.push(` echo "Missing ${module.modulePath}/semalease.env, skipping ${module.moduleName}"`);
222
- lines.push(" continue");
223
- lines.push(" fi");
224
- lines.push(` source "${module.modulePath}/semalease.env"`);
225
- lines.push(" if [ \"$CI_COMMIT_BRANCH\" = \"main\" ]; then");
226
- lines.push(" if [ \"${NEXT_VERSION:-}\" = \"${LATEST_VERSION:-}\" ]; then");
227
- lines.push(` echo "Version did not change for ${module.moduleName} on branch $CI_COMMIT_BRANCH, skipping tag"`);
228
- lines.push(" continue");
220
+ lines.push(` if [ -f "${module.modulePath}/semalease.env" ]; then`);
221
+ lines.push(` . "${module.modulePath}/semalease.env"`);
222
+ lines.push(" TAG_NAME=\"\"");
223
+ lines.push(" if [ \"$CI_COMMIT_BRANCH\" = \"main\" ]; then");
224
+ lines.push(" if [ \"${NEXT_VERSION:-}\" != \"${LATEST_VERSION:-}\" ]; then");
225
+ lines.push(` TAG_NAME="${module.moduleName}-v\${NEXT_VERSION}"`);
226
+ lines.push(" else");
227
+ lines.push(` echo "Version did not change for ${module.moduleName} on branch $CI_COMMIT_BRANCH, skipping tag"`);
228
+ lines.push(" fi");
229
+ lines.push(" else");
230
+ lines.push(" if [ \"${NEXT_VERSION:-}\" != \"${LATEST_VERSION:-}\" ] || [ \"${NEXT_INCREMENT:-}\" != \"${LATEST_INCREMENT:-}\" ]; then");
231
+ lines.push(` TAG_NAME="${module.moduleName}-v\${NEXT_VERSION}-\${CI_COMMIT_BRANCH}-\${NEXT_INCREMENT}"`);
232
+ lines.push(" else");
233
+ lines.push(` echo "Version/increment did not change for ${module.moduleName} on branch $CI_COMMIT_BRANCH, skipping tag"`);
234
+ lines.push(" fi");
229
235
  lines.push(" fi");
230
- lines.push(` TAG_NAME="${module.moduleName}-v\${NEXT_VERSION}"`);
231
- lines.push(" else");
232
- lines.push(" if [ \"${NEXT_VERSION:-}\" = \"${LATEST_VERSION:-}\" ] && [ \"${NEXT_INCREMENT:-}\" = \"${LATEST_INCREMENT:-}\" ]; then");
233
- lines.push(` echo "Version/increment did not change for ${module.moduleName} on branch $CI_COMMIT_BRANCH, skipping tag"`);
234
- lines.push(" continue");
235
- lines.push(" fi");
236
- lines.push(` TAG_NAME="${module.moduleName}-v\${NEXT_VERSION}-\${CI_COMMIT_BRANCH}-\${NEXT_INCREMENT}"`);
237
- lines.push(" fi");
236
+ lines.push(" if [ \"$TAG_NAME\" != \"\" ]; then");
238
237
  if (module.moduleType === "node-express") {
239
- lines.push(` git add "${module.modulePath}/package.json"`);
238
+ lines.push(` git add "${module.modulePath}/package.json"`);
240
239
  }
241
240
  else if (module.moduleType === "node-vite") {
242
- lines.push(` git add "${module.modulePath}/package.json" "${module.modulePath}/public/release.json"`);
241
+ lines.push(` git add "${module.modulePath}/package.json" "${module.modulePath}/public/release.json"`);
243
242
  }
244
- lines.push(" git tag \"${TAG_NAME}\"");
243
+ lines.push(" git tag \"$TAG_NAME\"");
244
+ lines.push(" fi");
245
+ lines.push(" else");
246
+ lines.push(` echo "Missing ${module.modulePath}/semalease.env, skipping ${module.moduleName}"`);
247
+ lines.push(" fi");
245
248
  }
246
249
  lines.push("");
247
250
  lines.push(" git commit -m \"release: update affected modules\"");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "polyci",
3
3
  "description": "Monorepo CI/CD utilities.",
4
- "version": "0.0.4",
4
+ "version": "0.0.5",
5
5
  "type": "module",
6
6
  "private": false,
7
7
  "author": "Alexander Tsarev",