@amsterdamdatalabs/enact-extensions 0.1.24 → 0.1.25
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.
- package/package.json +1 -1
- package/scripts/version-bump.sh +22 -1
package/package.json
CHANGED
package/scripts/version-bump.sh
CHANGED
|
@@ -52,6 +52,7 @@ CURRENT_BRANCH=""
|
|
|
52
52
|
INTEGRATION_BRANCH="integration"
|
|
53
53
|
DRY_RUN=false
|
|
54
54
|
DO_PUSH=false
|
|
55
|
+
INTEGRATION_MODE=false
|
|
55
56
|
|
|
56
57
|
# ─────────────────────────────────────────────────────────────────────────────
|
|
57
58
|
usage() {
|
|
@@ -121,6 +122,7 @@ parse_args() {
|
|
|
121
122
|
-f|--file) VERSION_FILE="${2:?'--file requires a path'}"; file_given=true; shift 2 ;;
|
|
122
123
|
-b|--branch) INTEGRATION_BRANCH="${2:?'--branch requires a name'}"; shift 2 ;;
|
|
123
124
|
--push) DO_PUSH=true; shift ;;
|
|
125
|
+
--integration) INTEGRATION_MODE=true; shift ;;
|
|
124
126
|
-n|--dry-run) DRY_RUN=true; shift ;;
|
|
125
127
|
-h|--help) usage ;;
|
|
126
128
|
*) die "Unknown option: '$1'. Run with --help." ;;
|
|
@@ -354,6 +356,19 @@ validate_branch() {
|
|
|
354
356
|
info "Detached HEAD — branch from env: ${branch}"
|
|
355
357
|
fi
|
|
356
358
|
|
|
359
|
+
# Integration mode: the bump runs on the integration build AFTER a PR merges
|
|
360
|
+
# and pushes the bump commit directly back to integration (the build service
|
|
361
|
+
# has "bypass policies when pushing"). The ***NO_CI*** commit message stops it
|
|
362
|
+
# from re-triggering. This avoids the pre-merge feature-branch bump that
|
|
363
|
+
# re-validated the PR (double pipeline run).
|
|
364
|
+
if $INTEGRATION_MODE; then
|
|
365
|
+
[[ "$branch" == "$INTEGRATION_BRANCH" ]] || \
|
|
366
|
+
die "Integration mode expects branch '${INTEGRATION_BRANCH}', currently on '${branch}'."
|
|
367
|
+
ok "On integration branch '${branch}' (integration mode — bump pushes directly)."
|
|
368
|
+
CURRENT_BRANCH="$branch"
|
|
369
|
+
return
|
|
370
|
+
fi
|
|
371
|
+
|
|
357
372
|
[[ "$branch" =~ ^(feat|fix)/ ]] || \
|
|
358
373
|
die "Expected a feat/* or fix/* branch, currently on '${branch}'. Version bump runs on feature branches before PR merge."
|
|
359
374
|
|
|
@@ -432,7 +447,13 @@ main() {
|
|
|
432
447
|
parse_args "$@"
|
|
433
448
|
resolve_manifest
|
|
434
449
|
validate_branch
|
|
435
|
-
|
|
450
|
+
if $INTEGRATION_MODE; then
|
|
451
|
+
# On integration we bump once per merge; the manual-bump guard (compare vs
|
|
452
|
+
# origin/integration) does not apply on integration itself.
|
|
453
|
+
CURRENT_VERSION="$(get_version)" || die "Cannot read current version from manifest."
|
|
454
|
+
else
|
|
455
|
+
validate_version_unchanged # exits 0 silently if version was manually bumped
|
|
456
|
+
fi
|
|
436
457
|
|
|
437
458
|
local new_version
|
|
438
459
|
new_version="$(bump_patch "$CURRENT_VERSION")"
|