This is an automated email from the ASF dual-hosted git repository.
Kusuma04-dev pushed a commit to branch test1
in repository https://gitbox.apache.org/repos/asf/incubator-kie-tools.git
The following commit(s) were added to refs/heads/test1 by this push:
new 454a1904082 test
454a1904082 is described below
commit 454a19040827082575049f881e759e29abef4677
Author: Kusuma04-dev <[email protected]>
AuthorDate: Tue Nov 17 07:23:45 2026 +0530
test
---
.ci/jenkins/Jenkinsfile.103xplus.release-candidate | 27 ++-
.ci/jenkins/shared-scripts/buildUtils.groovy | 18 +-
scripts/release/README.md | 31 +++-
scripts/release/add-staging-repositories.js | 117 +++++++++++++
scripts/release/create-source-tarball.sh | 186 ++++++++++++++++++---
scripts/release/release-all.sh | 34 +---
6 files changed, 356 insertions(+), 57 deletions(-)
diff --git a/.ci/jenkins/Jenkinsfile.103xplus.release-candidate
b/.ci/jenkins/Jenkinsfile.103xplus.release-candidate
index 1bb443e8247..1b3831f573e 100644
--- a/.ci/jenkins/Jenkinsfile.103xplus.release-candidate
+++ b/.ci/jenkins/Jenkinsfile.103xplus.release-candidate
@@ -51,11 +51,21 @@ pipeline {
description: 'MANDATORY. RC tag name, e.g. 10.3.0-rc1 (must start
with RELEASE_VERSION and be a new tag)',
defaultValue: '0.0.0-rc1'
)
+ string(
+ name: 'BASE_BRANCH',
+ description: 'Branch the stream branch X.Y.x is created from when
CREATE_STREAM_BRANCH is set (e.g. main, or a release-prep branch). Ignored
otherwise: rc2 / patch releases always build from the existing X.Y.x',
+ defaultValue: 'main'
+ )
booleanParam(
name: 'CREATE_STREAM_BRANCH',
- description: 'Branch cut, part 1: create branch X.Y.x (derived
from RELEASE_VERSION) from main and push it. Only for the first RC of a new
minor (e.g. 10.3.0-rc1). Fails if X.Y.x already exists',
+ description: 'Branch cut, part 1: create branch X.Y.x (derived
from RELEASE_VERSION) from BASE_BRANCH and push it. Only for the first RC of a
new minor (e.g. 10.3.0-rc1). Fails if X.Y.x already exists',
defaultValue: false
)
+ string(
+ name: 'STAGING_REPOSITORIES',
+ description: 'Maven repositories (comma, space or new line
separated) added to the build settings so upstream 10.3+ artifacts that are
only in Apache Nexus staging (e.g. kogito-apps-bom) resolve. Use the closed
orgapachekie-NNNN repositories, or keep the default staging group. Empty = rely
only on the Jenkins settings file',
+ defaultValue:
'https://repository.apache.org/content/groups/staging/'
+ )
booleanParam(
name: 'UPDATE_STREAM_VERSION',
description: 'Branch cut, part 2: set the development version in
all files on X.Y.x (project version X.Y.999, kogito maven X.Y.999-SNAPSHOT,
stream name X.Y.x), commit and push. Use together with CREATE_STREAM_BRANCH for
a normal branch cut, or alone if X.Y.x was already created',
@@ -103,7 +113,7 @@ pipeline {
}
}
- // The stream branch X.Y.x is derived from RELEASE_VERSION. A branch
cut starts from main;
+ // The stream branch X.Y.x is derived from RELEASE_VERSION. A branch
cut starts from BASE_BRANCH;
// every other run (rc2, patch releases) builds from the existing
X.Y.x.
stage('Resolve release ref') {
steps {
@@ -119,7 +129,14 @@ pipeline {
if (!params.TAG_NAME.startsWith(params.RELEASE_VERSION)) {
error("TAG_NAME '${params.TAG_NAME}' must start with
RELEASE_VERSION '${params.RELEASE_VERSION}'")
}
- baseRef = params.CREATE_STREAM_BRANCH ? 'main' :
streamBranch
+ def baseBranch = params.BASE_BRANCH?.trim()
+ if (params.CREATE_STREAM_BRANCH) {
+ // baseRef is interpolated into shell commands below,
so only plain branch names are allowed
+ if (!baseBranch || !(baseBranch ==~
/^[A-Za-z0-9._\/-]+$/) || baseBranch.startsWith('-')) {
+ error("Invalid BASE_BRANCH
'${params.BASE_BRANCH}'. Use a plain branch name, e.g. main")
+ }
+ }
+ baseRef = params.CREATE_STREAM_BRANCH ? baseBranch :
streamBranch
echo "Building from ${baseRef}"
}
}
@@ -157,7 +174,7 @@ pipeline {
steps {
dir('kie-tools') {
script {
-
buildUtils.setupPnpm("${pipelineVars.mavenSettingsReleaseConfigFileId}")
+
buildUtils.setupPnpm("${pipelineVars.mavenSettingsReleaseConfigFileId}",
"${params.STAGING_REPOSITORIES}")
}
}
}
@@ -194,7 +211,7 @@ pipeline {
steps {
dir('kie-tools') {
script {
- // Part 1: create the branch from main (the checkout
above is already on the
+ // Part 1: create the branch from BASE_BRANCH (the
checkout above is already on the
// existing X.Y.x when only UPDATE_STREAM_VERSION is
set)
if (params.CREATE_STREAM_BRANCH) {
def exists = sh(
diff --git a/.ci/jenkins/shared-scripts/buildUtils.groovy
b/.ci/jenkins/shared-scripts/buildUtils.groovy
index 1445d178073..ba64b3a1ac7 100644
--- a/.ci/jenkins/shared-scripts/buildUtils.groovy
+++ b/.ci/jenkins/shared-scripts/buildUtils.groovy
@@ -48,8 +48,12 @@ def startFluxbox() {
/**
* Setup PNPM parameters for building KIE-Tools
+*
+* stagingRepositories (optional): comma/space/newline separated list of Maven
repository URLs (e.g. Apache
+* Nexus staging) that are written to a separate Maven global settings file as
an always-active profile, so
+* release candidates can resolve upstream artifacts that are not on Maven
Central yet.
*/
-def setupPnpm(String mavenSettingsFileId = '') {
+def setupPnpm(String mavenSettingsFileId = '', String stagingRepositories =
'') {
sh """
#!/bin/bash -el
pnpm config set network-timeout 1000000
@@ -67,6 +71,18 @@ def setupPnpm(String mavenSettingsFileId = '') {
""".trim()
}
}
+
+ if (stagingRepositories?.trim()) {
+ // Written to its own file and wired via --global-settings: `pnpm
bootstrap` prepends its own `--settings`
+ // to .mvn/maven.config and Maven only honors the first one, so a
profile added to kie-settings.xml would be
+ // ignored. Global settings are merged with the user settings instead.
+ withEnv(["STAGING_REPOSITORIES=${stagingRepositories.trim()}"]) {
+ sh '''#!/bin/bash -el
+ node scripts/release/add-staging-repositories.js
"${WORKSPACE}/kie-staging-settings.xml" "${STAGING_REPOSITORIES}"
+ pnpm -r exec 'bash' '-c' 'echo
--global-settings=${WORKSPACE}/kie-staging-settings.xml >> .mvn/maven.config'
+ '''.trim()
+ }
+ }
}
/**
diff --git a/scripts/release/README.md b/scripts/release/README.md
index 1dde35181fc..84127279488 100644
--- a/scripts/release/README.md
+++ b/scripts/release/README.md
@@ -24,7 +24,7 @@ Local-first scripts for releasing Apache KIE Tools. All
components are released
| Script | What it does
|
| -------------------------- |
---------------------------------------------------------------------------- |
| `release-all.sh` | **The** release script — builds all components
and optionally publishes them |
-| `create-source-tarball.sh` | Utility: creates an Apache-compliant source zip
from the current `HEAD` |
+| `create-source-tarball.sh` | Creates the source release zip of
`incubator-kie` + `incubator-kie-tools` |
## Usage
@@ -117,7 +117,7 @@
apache-kie-<version>-incubating-sandbox-dev-deployment-upload-service-macOS-arm6
apache-kie-<version>-incubating-sandbox-dev-deployment-upload-service-macOS-x86.tar.gz
apache-kie-<version>-incubating-sandbox-dev-deployment-upload-service-linux-x86.tar.gz
apache-kie-<version>-incubating-sandbox-dev-deployment-upload-service-windows-x86.tar.gz
-apache-kie-<version>-incubating-sources.zip (source zip — always created)
+apache-kie-<version>-incubating-sources.zip (source zip — always created, see
"Source zip")
```
Container image names (`<image-name>`):
@@ -125,6 +125,33 @@ Container image names (`<image-name>`):
`sandbox-dev-deployment-base`, `sandbox-dev-deployment-dmn-form-webapp`,
`sandbox-dev-deployment-quarkus-blank-app`, `kogito-management-console`
+## Source zip
+
+`apache-kie-<version>-incubating-sources.zip` is the Apache source release. It
covers both repositories, so its
+content is:
+
+```
+apache-kie-<version>-incubating/
+ BUILD how to build everything from source (tool versions
read from repo/build-dependencies-versions.json)
+ DISCLAIMER-WIP
+ LICENSE incubator-kie LICENSE + third-party sections of
incubator-kie-tools (paths prefixed with the repo directory)
+ NOTICE incubator-kie NOTICE + paragraphs of
incubator-kie-tools not already in it
+ incubator-kie/ git archive of apache/incubator-kie
+ incubator-kie-tools/ git archive of this repository
+```
+
+`release-all.sh --git-ref <ref>` archives `<ref>` of this repository **and**
the same ref of `incubator-kie`, so the
+RC tag must exist in both repositories. To use different sources:
+
+```bash
+./scripts/release/create-source-tarball.sh 10.3.0-rc1 \
+ --git-ref 10.3.0-rc1 --kie-git-ref 10.3.0-rc1 \
+ --kie-repo https://github.com/apache/incubator-kie.git # or a local path
+```
+
+`KIE_REPO` and `KIE_GIT_REF` environment variables are honored when the
options are not given. The script fails if
+the zip root does not contain exactly the entries above.
+
## Credentials (for `--publish`)
| Component | Required environment variables
|
diff --git a/scripts/release/add-staging-repositories.js
b/scripts/release/add-staging-repositories.js
new file mode 100755
index 00000000000..93b7fd8f769
--- /dev/null
+++ b/scripts/release/add-staging-repositories.js
@@ -0,0 +1,117 @@
+#!/usr/bin/env node
+/*
+ * 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.
+ */
+
+// Adds one or more Maven repositories (e.g. Apache Nexus staging
repositories) to a Maven
+// settings.xml as an always-active profile, for both artifacts and plugins.
If the settings file
+// does not exist yet, it is created.
+//
+// This is what makes a release candidate able to resolve upstream artifacts
that are only
+// published to staging (e.g. kogito-apps-bom:10.3.0) before they reach Maven
Central, without
+// having to hand-edit the credentials-bearing settings file managed in
Jenkins.
+//
+// In CI, pass a NEW file here and wire it through `--global-settings=<file>`
in `.mvn/maven.config`.
+// Do not add it to the file passed as `--settings`: `pnpm bootstrap` prepends
its own `--settings`
+// and Maven honors only the first one, so a profile added there would be
silently ignored.
+//
+// Usage: node add-staging-repositories.js <settings.xml> "<url>[,<url>...]"
+// URLs can be separated by commas, spaces or new lines. Running it twice is a
no-op.
+
+const fs = require("fs");
+
+const PROFILE_ID = "kie-release-staging";
+
+function fail(message) {
+ console.error(`ERROR: ${message}`);
+ process.exit(1);
+}
+
+const [settingsFile, urlsArg] = process.argv.slice(2);
+if (!settingsFile || urlsArg === undefined) {
+ fail('Usage: add-staging-repositories.js <settings.xml> "<url>[,<url>...]"');
+}
+
+const urls = urlsArg
+ .split(/[\s,]+/)
+ .map((url) => url.trim())
+ .filter(Boolean);
+
+if (urls.length === 0) {
+ console.log("No staging repositories requested. Nothing to do.");
+ process.exit(0);
+}
+
+for (const url of urls) {
+ if (!/^https:\/\/[A-Za-z0-9._~:\/-]+$/.test(url)) {
+ fail(`Invalid staging repository URL (https and plain URL characters
only): '${url}'`);
+ }
+}
+
+let settings = fs.existsSync(settingsFile) ? fs.readFileSync(settingsFile,
"utf8") : "<settings>\n</settings>\n";
+
+if (settings.includes(`<id>${PROFILE_ID}</id>`)) {
+ console.log(`Profile '${PROFILE_ID}' already present in ${settingsFile}.
Nothing to do.`);
+ process.exit(0);
+}
+
+if (!settings.includes("</settings>")) {
+ fail(`${settingsFile} does not look like a Maven settings file (no
</settings>)`);
+}
+
+const repositoryXml = (tag, url, index) => `
+ <${tag}>
+ <id>${PROFILE_ID}-${index}</id>
+ <name>KIE release staging ${index}</name>
+ <url>${url}</url>
+ <releases><enabled>true</enabled></releases>
+ <snapshots><enabled>false</enabled></snapshots>
+ </${tag}>`;
+
+const profileXml = `
+ <profile>
+ <id>${PROFILE_ID}</id>
+ <repositories>${urls.map((url, i) => repositoryXml("repository", url, i
+ 1)).join("")}
+ </repositories>
+ <pluginRepositories>${urls.map((url, i) =>
repositoryXml("pluginRepository", url, i + 1)).join("")}
+ </pluginRepositories>
+ </profile>
+`;
+
+const activeProfileXml = ` <activeProfile>${PROFILE_ID}</activeProfile>\n`;
+
+function insertBefore(source, closingTag, content) {
+ const index = source.lastIndexOf(closingTag);
+ return source.slice(0, index) + content + source.slice(index);
+}
+
+if (settings.includes("</profiles>")) {
+ settings = insertBefore(settings, "</profiles>", profileXml + " ");
+} else {
+ settings = insertBefore(settings, "</settings>", ` <profiles>${profileXml}
</profiles>\n`);
+}
+
+if (settings.includes("</activeProfiles>")) {
+ settings = insertBefore(settings, "</activeProfiles>", activeProfileXml + "
");
+} else {
+ settings = insertBefore(settings, "</settings>", `
<activeProfiles>\n${activeProfileXml} </activeProfiles>\n`);
+}
+
+fs.writeFileSync(settingsFile, settings);
+console.log(`Added ${urls.length} staging repositories to ${settingsFile}:`);
+urls.forEach((url) => console.log(` - ${url}`));
diff --git a/scripts/release/create-source-tarball.sh
b/scripts/release/create-source-tarball.sh
index 0206c7a36a9..b860ce090da 100755
--- a/scripts/release/create-source-tarball.sh
+++ b/scripts/release/create-source-tarball.sh
@@ -21,28 +21,48 @@ set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
+# Creates apache-kie-<version>-incubating-sources.zip. The source release
covers BOTH Apache KIE repositories, so
+# the zip contains (under apache-kie-<version>-incubating/):
+#
+# BUILD how to build everything from source
+# DISCLAIMER-WIP incubator disclaimer
+# LICENSE merged LICENSE of incubator-kie and incubator-kie-tools
+# NOTICE merged NOTICE of incubator-kie and incubator-kie-tools
+# incubator-kie/ git archive of apache/incubator-kie at --kie-git-ref
+# incubator-kie-tools/ git archive of this repository at --git-ref
+
usage() {
- echo "Usage: $0 <version> [--git-ref <ref>] [--output-dir <dir>]"
+ echo "Usage: $0 <version> [--git-ref <ref>] [--kie-git-ref <ref>]
[--kie-repo <url|path>] [--output-dir <dir>]"
echo ""
echo "Arguments:"
- echo " version Release or RC version (e.g., 10.2.0 or
10.2.0-rc1)"
+ echo " version Release or RC version (e.g., 10.2.0 or
10.2.0-rc1)"
echo ""
echo "Options:"
- echo " --git-ref <ref> Git reference to archive (default: HEAD)"
- echo " --output-dir <d> Output directory (default:
./release-artifacts)"
+ echo " --git-ref <ref> incubator-kie-tools git reference to
archive (default: HEAD)"
+ echo " --kie-git-ref <ref> incubator-kie branch or tag to archive
(default: same as --git-ref;"
+ echo " when that is HEAD, the default branch of
the incubator-kie repository)"
+ echo " --kie-repo <u|p> incubator-kie repository URL or local path"
+ echo " (default:
https://github.com/apache/incubator-kie.git)"
+ echo " --output-dir <d> Output directory (default:
./release-artifacts)"
echo " --help"
+ echo ""
+ echo "Environment: KIE_REPO and KIE_GIT_REF are used when the matching
options are not given."
exit 1
}
VERSION=""
GIT_REF="HEAD"
+KIE_GIT_REF="${KIE_GIT_REF:-}"
+KIE_REPO="${KIE_REPO:-https://github.com/apache/incubator-kie.git}"
OUTPUT_DIR="$REPO_ROOT/release-artifacts"
while [[ $# -gt 0 ]]; do
case $1 in
- --git-ref) GIT_REF="$2"; shift 2 ;;
- --output-dir) OUTPUT_DIR="$2"; shift 2 ;;
- --help) usage ;;
+ --git-ref) GIT_REF="$2"; shift 2 ;;
+ --kie-git-ref) KIE_GIT_REF="$2"; shift 2 ;;
+ --kie-repo) KIE_REPO="$2"; shift 2 ;;
+ --output-dir) OUTPUT_DIR="$2"; shift 2 ;;
+ --help) usage ;;
*)
if [[ -z "$VERSION" ]]; then VERSION="$1"; else echo "Unknown
argument: $1"; usage; fi
shift ;;
@@ -50,18 +70,33 @@ while [[ $# -gt 0 ]]; do
done
[[ -z "$VERSION" ]] && { echo "ERROR: version is required"; usage; }
+[[ -z "$KIE_GIT_REF" ]] && KIE_GIT_REF="$GIT_REF"
+
+# A local path is cloned through file:// so that --depth is honored.
+if [[ -d "$KIE_REPO" ]]; then
+ KIE_REPO="file://$(cd "$KIE_REPO" && pwd)"
+fi
echo "=========================================="
echo "Source Tarball"
-echo "Version: $VERSION"
-echo "Git ref: $GIT_REF"
-echo "Output: $OUTPUT_DIR"
+echo "Version: $VERSION"
+echo "kie-tools ref: $GIT_REF"
+echo "kie repo: $KIE_REPO"
+echo "kie ref: $KIE_GIT_REF"
+echo "Output: $OUTPUT_DIR"
echo "=========================================="
mkdir -p "$OUTPUT_DIR"
OUTPUT_DIR="$(cd "$OUTPUT_DIR" && pwd)"
-ZIPFILE="$OUTPUT_DIR/apache-kie-$VERSION-incubating-sources.zip"
+ROOT_DIR_NAME="apache-kie-$VERSION-incubating"
+ZIPFILE="$OUTPUT_DIR/$ROOT_DIR_NAME-sources.zip"
+WORK_DIR="$(mktemp -d)"
+trap 'rm -rf "$WORK_DIR"' EXIT
+STAGE="$WORK_DIR/$ROOT_DIR_NAME"
+mkdir -p "$STAGE/incubator-kie" "$STAGE/incubator-kie-tools"
+
+# --- incubator-kie-tools
----------------------------------------------------------------------------------------
cd "$REPO_ROOT"
local_archive_ref="$GIT_REF"
if [[ "$local_archive_ref" == "HEAD" ]] && ! git diff --quiet HEAD
2>/dev/null; then
@@ -70,9 +105,117 @@ if [[ "$local_archive_ref" == "HEAD" ]] && ! git diff
--quiet HEAD 2>/dev/null;
local_archive_ref="$stash_sha"
fi
fi
+echo "Archiving incubator-kie-tools from ref $local_archive_ref..."
+git archive --format=tar "$local_archive_ref" | tar -x -C
"$STAGE/incubator-kie-tools"
+
+# --- incubator-kie
----------------------------------------------------------------------------------------------
+echo "Archiving incubator-kie from $KIE_REPO ($KIE_GIT_REF)..."
+KIE_CLONE="$WORK_DIR/incubator-kie-clone"
+clone_args=(--quiet --depth 1)
+if [[ "$KIE_GIT_REF" == "HEAD" ]]; then
+ echo "WARN: no incubator-kie ref given, using the default branch. Pass
--kie-git-ref <tag> for a real release."
+else
+ clone_args+=(--branch "$KIE_GIT_REF")
+fi
+git -c advice.detachedHead=false clone "${clone_args[@]}" "$KIE_REPO"
"$KIE_CLONE"
+git -C "$KIE_CLONE" archive --format=tar HEAD | tar -x -C
"$STAGE/incubator-kie"
+
+# --- Top-level files
--------------------------------------------------------------------------------------------
+KIE_DIR="$STAGE/incubator-kie"
+TOOLS_DIR="$STAGE/incubator-kie-tools"
+for f in LICENSE NOTICE DISCLAIMER-WIP; do
+ for d in "$KIE_DIR" "$TOOLS_DIR"; do
+ [[ -f "$d/$f" ]] || { echo "ERROR: $f not found in $d"; exit 1; }
+ done
+done
+
+# LICENSE: incubator-kie's file (Apache License 2.0 + its third-party
sections), followed by the third-party sections
+# of incubator-kie-tools, which start at the separator line right before the
first "for <path>" line after the
+# Apache License text. The paths listed in those sections are relative to each
repository, so they are prefixed with
+# the directory of the repository they now live in.
+prefix_license_paths() {
+ awk -v prefix="$1/" '
+ /^for [A-Za-z0-9_.-]+\/.*\.[A-Za-z0-9]+$/ { sub(/^for /, "for "
prefix); print; next }
+ /^ [A-Za-z0-9_.-]+\/.*\.[A-Za-z0-9]+$/ { sub(/^ /, " "
prefix); print; next }
+ { print }'
+}
+first_tools_section=$(awk '/END OF TERMS AND CONDITIONS/ {e=1} e && /^for /
{print NR; exit}' "$TOOLS_DIR/LICENSE")
+[[ -n "$first_tools_section" ]] || { echo "ERROR: could not find third-party
sections in incubator-kie-tools/LICENSE"; exit 1; }
+first_kie_section=$(awk '/END OF TERMS AND CONDITIONS/ {e=1} e && /^for /
{print NR; exit}' "$KIE_DIR/LICENSE")
+[[ -n "$first_kie_section" ]] || { echo "ERROR: could not find third-party
sections in incubator-kie/LICENSE"; exit 1; }
+{
+ head -n "$((first_kie_section - 2))" "$KIE_DIR/LICENSE"
+ tail -n +"$((first_kie_section - 1))" "$KIE_DIR/LICENSE" |
prefix_license_paths incubator-kie
+ printf '\n\n'
+ tail -n +"$((first_tools_section - 1))" "$TOOLS_DIR/LICENSE" |
prefix_license_paths incubator-kie-tools
+} > "$STAGE/LICENSE"
+
+# NOTICE: incubator-kie's file plus the paragraphs of incubator-kie-tools'
that it does not already contain.
+awk 'BEGIN { RS = ""; ORS = "\n\n" }
+ FNR == 1 { f++ }
+ { p = $0; gsub(/[ \t]+\n/, "\n", p); gsub(/[ \t]+$/, "", p) }
+ f == 1 { seen[p] = 1; print p; next }
+ !(p in seen) { print p }' "$KIE_DIR/NOTICE" "$TOOLS_DIR/NOTICE" >
"$STAGE/NOTICE"
+
+cp "$TOOLS_DIR/DISCLAIMER-WIP" "$STAGE/DISCLAIMER-WIP"
+
+# BUILD: tool versions come from the tools repository so they cannot drift.
+tool_version() {
+ node -p "require('$TOOLS_DIR/repo/build-dependencies-versions.json')['$1']"
+}
+NODE_VERSION="$(tool_version node)"
+PNPM_VERSION="$(tool_version pnpm)"
+MAVEN_VERSION="$(tool_version maven)"
+JAVA_VERSION="$(tool_version java)"
+
+cat > "$STAGE/BUILD" <<EOF
+Building Apache KIE (incubating) $VERSION from source
+=====================================================
+
+This source release contains two repositories, each in its own directory:
-echo "Creating git archive from ref $local_archive_ref..."
-git archive --format=zip --prefix="apache-kie-$VERSION-incubating/"
"$local_archive_ref" > "$ZIPFILE"
+ incubator-kie/ Java modules (Drools, OptaPlanner, jBPM, Kogito)
+ incubator-kie-tools/ Tooling: editors, VS Code and Chrome extensions, web
apps, container images, Helm charts
+
+Build incubator-kie first: incubator-kie-tools resolves the Java artifacts
from the local Maven repository.
+
+Requirements
+------------
+
+ - Java $JAVA_VERSION (incubator-kie also builds with Java 21)
+ - Maven $MAVEN_VERSION
+ - Node.js $NODE_VERSION (24 or newer)
+ - pnpm $PNPM_VERSION
+ - Docker or Podman, only to build the container images of incubator-kie-tools
+
+1. incubator-kie
+----------------
+
+ cd incubator-kie
+ mvn clean install -DskipTests
+
+See incubator-kie/docs/BUILDING.md for build flags and test profiles.
+
+2. incubator-kie-tools
+----------------------
+
+ cd incubator-kie-tools
+ pnpm bootstrap
+ pnpm -r build:prod
+
+See incubator-kie-tools/README.md and incubator-kie-tools/repo/MANUAL.md for
details, including how to build a
+single package (pnpm -F <package>... build:prod).
+
+Verifying this release
+----------------------
+
+Check the signature (.asc) and the SHA-512 checksum (.sha512) of the sources
zip against
+https://downloads.apache.org/incubator/kie/KEYS, as described in
https://www.apache.org/info/verification.html
+EOF
+
+# --- Zip and verify
--------------------------------------------------------------------------------------------
+rm -f "$ZIPFILE"
+(cd "$WORK_DIR" && zip -qr "$ZIPFILE" "$ROOT_DIR_NAME")
if ! unzip -t "$ZIPFILE" > /dev/null 2>&1; then
echo "ERROR: zip verification failed"
@@ -82,13 +225,16 @@ fi
SIZE=$(du -h "$ZIPFILE" | cut -f1)
echo "Created: $ZIPFILE ($SIZE)"
-zip_contents=$(unzip -l "$ZIPFILE")
-for required in LICENSE NOTICE DISCLAIMER-WIP; do
- if ! echo "$zip_contents" | grep -q
"apache-kie-$VERSION-incubating/$required"; then
- echo "WARN: $required not found in zip"
- fi
-done
+# The root of the zip must contain exactly these entries.
+actual_entries=$(unzip -Z1 "$ZIPFILE" | awk -F/ -v root="$ROOT_DIR_NAME" '$1
== root && $2 != "" {print $2}' | sort -u | paste -sd' ' -)
+expected_entries="BUILD DISCLAIMER-WIP LICENSE NOTICE incubator-kie
incubator-kie-tools"
+if [[ "$actual_entries" != "$expected_entries" ]]; then
+ echo "ERROR: unexpected content in $ROOT_DIR_NAME/"
+ echo " expected: $expected_entries"
+ echo " actual: $actual_entries"
+ exit 1
+fi
echo "=========================================="
echo "DONE"
-echo "=========================================="
\ No newline at end of file
+echo "=========================================="
diff --git a/scripts/release/release-all.sh b/scripts/release/release-all.sh
index 2076d25dfd4..2ae6a641b72 100755
--- a/scripts/release/release-all.sh
+++ b/scripts/release/release-all.sh
@@ -750,35 +750,11 @@ release_dev_deployment_upload_service() {
release_source_tarball() {
echo ""
echo "--- Source tarball ---"
- mkdir -p "${ARTIFACTS_DIR}"
- local
zipfile="${ARTIFACTS_DIR}/apache-kie-${VERSION}-incubating-sources.zip"
- local archive_ref="${GIT_REF}"
-
- # If archiving HEAD and there are uncommitted working tree modifications
(e.g. local version bumps),
- # create a stash commit to ensure the working tree state is preserved in
the archive.
- if [[ "${archive_ref}" == "HEAD" ]] && ! git diff --quiet HEAD
2>/dev/null; then
- local stash_sha
- stash_sha=$(git stash create 2>/dev/null || true)
- if [[ -n "${stash_sha}" ]]; then
- archive_ref="${stash_sha}"
- fi
- fi
-
- echo "Creating git archive from ref ${archive_ref}..."
- git archive --format=zip --prefix="apache-kie-${VERSION}-incubating/"
"${archive_ref}" > "${zipfile}"
- if ! unzip -t "${zipfile}" > /dev/null 2>&1; then
- echo "ERROR: Source zip verification failed"
- return 1
- fi
- local size
- size=$(du -h "${zipfile}" | cut -f1)
- echo "Created: ${zipfile} (${size})"
- local zip_contents
- zip_contents=$(unzip -l "${zipfile}")
- for required in LICENSE NOTICE DISCLAIMER-WIP; do
- echo "${zip_contents}" | grep -q
"apache-kie-${VERSION}-incubating/${required}" \
- || echo "WARN: ${required} not found in source zip"
- done
+ # The source release contains both incubator-kie and incubator-kie-tools
(plus BUILD, LICENSE, NOTICE and
+ # DISCLAIMER-WIP). incubator-kie is taken from the same ref as this
repository unless KIE_GIT_REF/KIE_REPO say otherwise.
+ "${SCRIPT_DIR}/create-source-tarball.sh" "${VERSION}" \
+ --git-ref "${GIT_REF}" \
+ --output-dir "${ARTIFACTS_DIR}"
}
# ---------------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]