This is an automated email from the ASF dual-hosted git repository.
Kusuma04-dev pushed a commit to branch test_103
in repository https://gitbox.apache.org/repos/asf/incubator-kie.git
The following commit(s) were added to refs/heads/test_103 by this push:
new e9e3680442c test
e9e3680442c is described below
commit e9e3680442cacef96019be0e67bc270428078995
Author: Kusuma <[email protected]>
AuthorDate: Thu Oct 22 09:33:22 2026 +0530
test
---
.ci/jenkins/project/Jenkinsfile.103xplus.release | 34 +++++
script/release/00-create-stream-branch.sh | 172 +++++++++++++++++++++++
2 files changed, 206 insertions(+)
diff --git a/.ci/jenkins/project/Jenkinsfile.103xplus.release
b/.ci/jenkins/project/Jenkinsfile.103xplus.release
index dd32628d718..aed2930e984 100644
--- a/.ci/jenkins/project/Jenkinsfile.103xplus.release
+++ b/.ci/jenkins/project/Jenkinsfile.103xplus.release
@@ -25,6 +25,10 @@
//
// MANDATORY parameters : RELEASE_VERSION, TAG_NAME
// Real RC run : DEPLOY=true, PUSH_TAG=true, DRY_RUN=false
+// Branch cut (once per minor, before rc1 only):
+// CREATE_STREAM_BRANCH=true -> creates X.Y.x from
STREAM_BASE_BRANCH,
+// sets X.Y.999-SNAPSHOT, pushes it, then continues the
RC on X.Y.x.
+// Leave it false for rc2, final and patch releases
(branch already exists).
pipeline {
agent {
@@ -44,6 +48,8 @@ pipeline {
parameters {
string(name: 'RELEASE_VERSION', defaultValue: '', description:
'MANDATORY. Exact release version, e.g. 10.3.0', trim: true)
string(name: 'TAG_NAME', defaultValue: '', description: 'MANDATORY. RC
tag name, e.g. 10.3.0-rc1 (must start with RELEASE_VERSION and be a new tag)',
trim: true)
+ booleanParam(name: 'CREATE_STREAM_BRANCH', defaultValue: false,
description: 'Branch cut: create X.Y.x (derived from RELEASE_VERSION) from
STREAM_BASE_BRANCH, set X.Y.999-SNAPSHOT and push it BEFORE building the RC.
Only for the first RC of a new minor (e.g. 10.3.0-rc1). Fails if X.Y.x already
exists')
+ string(name: 'STREAM_BASE_BRANCH', defaultValue: 'main', description:
'Used only when CREATE_STREAM_BRANCH=true. Branch the stream branch is cut
from', trim: true)
booleanParam(name: 'SKIP_TESTS', defaultValue: true, description:
'Skip running tests during reactor build')
booleanParam(name: 'DEPLOY', defaultValue: true, description: 'Deploy
artifacts to Apache Nexus staging')
string(name: 'STAGING_URL', defaultValue: '', description: 'Custom
Nexus staging URL (optional)')
@@ -80,6 +86,34 @@ pipeline {
}
}
+ stage('Create Stream Branch') {
+ when {
+ expression { return params.CREATE_STREAM_BRANCH }
+ }
+ steps {
+ script {
+ withCredentials([usernamePassword(credentialsId:
params.GIT_PUSH_CREDS_ID, usernameVariable: 'GITHUB_USER', passwordVariable:
'GITHUB_TOKEN')]) {
+ def branchArgs = [
+ './script/release/00-create-stream-branch.sh',
+ '--version', params.RELEASE_VERSION,
+ '--base', params.STREAM_BASE_BRANCH,
+ '--push'
+ ]
+ if (params.DRY_RUN) branchArgs << '--dry-run'
+
+ sh """#!/usr/bin/env bash
+ set -euo pipefail
+ git config user.email "${params.GIT_AUTHOR_EMAIL}"
+ git config user.name "${params.GIT_AUTHOR_NAME}"
+ git config --local credential.helper '!f() { echo
username=\$GITHUB_USER; echo password=\$GITHUB_TOKEN; }; f'
+ chmod +x script/release/*.sh
+ ${branchArgs.collect { "'${it.replace("'", "'\\''")}'"
}.join(' ')}
+ """
+ }
+ }
+ }
+ }
+
stage('Execute Release Scripts') {
steps {
// The Maven settings id is a Config File Provider id (not a
secret) and is
diff --git a/script/release/00-create-stream-branch.sh
b/script/release/00-create-stream-branch.sh
new file mode 100755
index 00000000000..c9f1ca63877
--- /dev/null
+++ b/script/release/00-create-stream-branch.sh
@@ -0,0 +1,172 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+set -euo pipefail
+
+# Branch cut (Automation A): creates the X.Y.x development stream branch from
+# the base branch (default: main) and moves it to the X.Y.999-SNAPSHOT dev
+# version (the "D commit"). Run ONCE per minor version, BEFORE the first RC.
+#
+# main ──── c ──── c ──── c ───────────────────────────> 999-SNAPSHOT
+# └── [D commit] ──── c ────> X.Y.x
(X.Y.999-SNAPSHOT)
+#
+# Usage:
+# ./script/release/00-create-stream-branch.sh <version> [--base <branch>]
[--push] [--dry-run]
+# ./script/release/00-create-stream-branch.sh --version <version> [--base
<branch>] [--push] [--dry-run]
+#
+# Examples:
+# ./script/release/00-create-stream-branch.sh 10.3.0 --push
+# ./script/release/00-create-stream-branch.sh --version 10.3 --base main
--dry-run
+#
+# Options:
+# <version> | --version <ver> Release version (10.3.0) or minor (10.3).
Only major.minor is used.
+# --base <branch> Branch to cut from (default: main)
+# --remote <name> Git remote (default: origin)
+# --push Push the new branch to the remote (default:
local only)
+# --dry-run Print what would happen without making any
changes
+#
+# After this script the working tree is left checked out on X.Y.x.
+
+SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+REPO_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"
+
+VERSION=""
+BASE_BRANCH="main"
+REMOTE="origin"
+PUSH=false
+DRY_RUN=false
+
+while [[ $# -gt 0 ]]; do
+ case $1 in
+ --version) VERSION="${2:-}"; shift 2 ;;
+ --base) BASE_BRANCH="${2:-}"; shift 2 ;;
+ --remote) REMOTE="${2:-}"; shift 2 ;;
+ --push) PUSH=true; shift ;;
+ --dry-run) DRY_RUN=true; shift ;;
+ *)
+ if [[ -z "${VERSION}" && ! "$1" =~ ^- ]]; then
+ VERSION="$1"
+ shift
+ else
+ echo "Unknown option: $1"
+ echo "Usage: $0 [<version> | --version <version>] [--base
<branch>] [--push] [--dry-run]"
+ exit 1
+ fi
+ ;;
+ esac
+done
+
+if [[ -z "${VERSION}" ]]; then
+ echo "ERROR: Version is required."
+ echo "Usage: $0 10.3.0 [--base main] [--push] [--dry-run]"
+ exit 1
+fi
+
+if [[ ! "${VERSION}" =~ ^([0-9]+)\.([0-9]+)(\.[0-9A-Za-z.-]+)?$ ]]; then
+ echo "ERROR: Cannot parse version '${VERSION}'. Expected e.g. 10.3.0 or
10.3"
+ exit 1
+fi
+
+MAJOR_MINOR="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}"
+STREAM_BRANCH="${MAJOR_MINOR}.x"
+DEV_VERSION="${MAJOR_MINOR}.999-SNAPSHOT"
+
+cd "${REPO_ROOT}"
+
+echo "========================================"
+echo "Apache KIE repo — create stream branch"
+echo "Stream branch : ${STREAM_BRANCH}"
+echo "Cut from : ${REMOTE}/${BASE_BRANCH}"
+echo "Dev version : ${DEV_VERSION}"
+echo "Push : ${PUSH}"
+echo "Dry run : ${DRY_RUN}"
+echo "========================================"
+
+# ── Guards ───────────────────────────────────────────────────────────────────
+if ! git diff --quiet || ! git diff --cached --quiet; then
+ echo "ERROR: There are uncommitted changes in the working tree."
+ exit 1
+fi
+if [[ -n "$(git ls-files --others --exclude-standard)" ]]; then
+ echo "ERROR: There are untracked files in the working tree:"
+ git ls-files --others --exclude-standard | sed 's/^/ /'
+ exit 1
+fi
+
+if git ls-remote --exit-code --heads "${REMOTE}" "${STREAM_BRANCH}"
&>/dev/null; then
+ echo "ERROR: Branch '${STREAM_BRANCH}' already exists on '${REMOTE}'."
+ echo " The branch cut is done once per minor version. For rc2 /
patch"
+ echo " releases reuse the existing branch and skip this step."
+ exit 1
+fi
+
+if git rev-parse --verify "${STREAM_BRANCH}" &>/dev/null; then
+ echo "ERROR: Local branch '${STREAM_BRANCH}' already exists. Delete it
first:"
+ echo " git branch -D ${STREAM_BRANCH}"
+ exit 1
+fi
+
+if [[ "${DRY_RUN}" == "true" ]]; then
+ echo ""
+ echo "[DRY RUN] Would execute:"
+ echo " git fetch ${REMOTE}
+refs/heads/${BASE_BRANCH}:refs/remotes/${REMOTE}/${BASE_BRANCH}"
+ echo " git checkout -b ${STREAM_BRANCH} ${REMOTE}/${BASE_BRANCH}"
+ echo " ./script/release/01-update-version.sh ${DEV_VERSION}"
+ echo " git add -A"
+ echo " git commit -m \"Update version to ${DEV_VERSION}\""
+ if [[ "${PUSH}" == "true" ]]; then
+ echo " git push ${REMOTE} ${STREAM_BRANCH}"
+ fi
+ exit 0
+fi
+
+# ── Branch cut ───────────────────────────────────────────────────────────────
+echo ""
+echo "--- Creating ${STREAM_BRANCH} from ${REMOTE}/${BASE_BRANCH} ---"
+git fetch "${REMOTE}"
"+refs/heads/${BASE_BRANCH}:refs/remotes/${REMOTE}/${BASE_BRANCH}"
+git checkout -b "${STREAM_BRANCH}" "${REMOTE}/${BASE_BRANCH}"
+
+echo ""
+echo "--- Updating version to ${DEV_VERSION} ---"
+"${SCRIPT_DIR}/01-update-version.sh" "${DEV_VERSION}"
+
+echo ""
+echo "--- Committing D commit ---"
+git add -A
+git commit -m "Update version to ${DEV_VERSION}"
+
+if [[ "${PUSH}" == "true" ]]; then
+ echo ""
+ echo "--- Pushing ${STREAM_BRANCH} to ${REMOTE} ---"
+ git push "${REMOTE}" "${STREAM_BRANCH}"
+fi
+
+echo ""
+echo "========================================"
+echo "Stream branch ${STREAM_BRANCH} ready (${DEV_VERSION})."
+echo ""
+if [[ "${PUSH}" != "true" ]]; then
+ echo "Next step (not pushed yet):"
+ echo " git push ${REMOTE} ${STREAM_BRANCH}"
+ echo ""
+fi
+echo "Next: run the RC release, e.g."
+echo " ./script/release/release-all.sh --version ${MAJOR_MINOR}.0 --tag
${MAJOR_MINOR}.0-rc1 --deploy --push-tag"
+echo "========================================"
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]