feat!: modularize stemmer models and release infrastructure
Move bundled stemmer dictionaries from the core artifact into independently versioned model modules. Add model discovery and explicit model-loading APIs, a standard model aggregate, a model BOM, and dedicated model and catalog release workflows. Add full PoliMorf integration, model provenance and licensing validation, streaming model-input verification, strict dependency verification, consumer resolution tests, Configuration Cache compatibility, and expanded JMH, quality, documentation, and release checks. Upgrade the CycloneDX and JMH Gradle plugins and remove Gradle 10 and Java compiler deprecations. BREAKING CHANGE: The core Radixor artifact no longer contains bundled stemmer dictionaries. Applications must add the required model artifacts, the standard model aggregate, or model dependencies managed through the Radixor model BOM.
This commit is contained in:
35
tools/parse-model-release-tag.sh
Executable file
35
tools/parse-model-release-tag.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
tag="${1:-}"
|
||||
repository_root="${2:-.}"
|
||||
|
||||
if [[ "${tag}" =~ ^model/([a-z]{2}(-[a-z]{2})?-[a-z0-9]+(-[a-z0-9]+)*)@([0-9]+\.[0-9]+\.[0-9]+([+-][0-9A-Za-z.-]+)?)$ ]]; then
|
||||
model_id="${BASH_REMATCH[1]}"
|
||||
model_version="${BASH_REMATCH[4]}"
|
||||
module="${repository_root}/models/${model_id}"
|
||||
[[ -d "${module}" ]] || { echo "Unknown model module: models/${model_id}" >&2; exit 2; }
|
||||
[[ -f "${module}/model-version.txt" ]] || { echo "Missing model version: models/${model_id}/model-version.txt" >&2; exit 2; }
|
||||
recorded_version="$(tr -d '[:space:]' < "${module}/model-version.txt")"
|
||||
[[ "${recorded_version}" == "${model_version}" ]] || {
|
||||
echo "Tag version ${model_version} does not match models/${model_id}/model-version.txt: ${recorded_version}" >&2
|
||||
exit 2
|
||||
}
|
||||
grep -Eq "^[[:space:]]*modelId[[:space:]]*=[[:space:]]*'${model_id}'" "${module}/build.gradle" || {
|
||||
echo "Descriptor model ID does not match module ${model_id}." >&2
|
||||
exit 2
|
||||
}
|
||||
printf 'MODEL_ID=%s\nMODEL_VERSION=%s\nGRADLE_PROJECT=:models:%s\n' "${model_id}" "${model_version}" "${model_id}"
|
||||
elif [[ "${tag}" =~ ^release@([0-9]+\.[0-9]+\.[0-9]+([+-][0-9A-Za-z.-]+)?)$ ]]; then
|
||||
printf 'CORE_VERSION=%s\n' "${BASH_REMATCH[1]}"
|
||||
elif [[ "${tag}" =~ ^models-catalog@([0-9]{4}\.[0-9]+)$ ]]; then
|
||||
catalog_version="$(tr -d '[:space:]' < "${repository_root}/models/catalog-version.txt")"
|
||||
[[ "${catalog_version}" == "${BASH_REMATCH[1]}" ]] || {
|
||||
echo "Tag version ${BASH_REMATCH[1]} does not match models/catalog-version.txt: ${catalog_version}" >&2
|
||||
exit 2
|
||||
}
|
||||
printf 'CATALOG_VERSION=%s\n' "${BASH_REMATCH[1]}"
|
||||
else
|
||||
echo "Invalid release tag: ${tag}" >&2
|
||||
exit 2
|
||||
fi
|
||||
16
tools/publish-central-bundle.sh
Executable file
16
tools/publish-central-bundle.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
bundle="${1:?Usage: publish-central-bundle.sh BUNDLE COORDINATES}"
|
||||
coordinates="${2:?Usage: publish-central-bundle.sh BUNDLE COORDINATES}"
|
||||
|
||||
[[ "${GITHUB_REF_TYPE:-}" == "tag" ]] || { echo "Maven Central publication requires a release tag." >&2; exit 2; }
|
||||
[[ -f "${bundle}" ]] || { echo "Central bundle does not exist: ${bundle}" >&2; exit 2; }
|
||||
[[ -n "${CENTRAL_BEARER_TOKEN:-}" ]] || { echo "CENTRAL_BEARER_TOKEN is required." >&2; exit 2; }
|
||||
|
||||
header_file="$(mktemp)"
|
||||
trap 'rm -f "${header_file}"' EXIT
|
||||
printf 'Authorization: Bearer %s\n' "${CENTRAL_BEARER_TOKEN}" > "${header_file}"
|
||||
curl --fail --silent --show-error --request POST --header @"${header_file}" \
|
||||
--form "bundle=@${bundle}" --form "name=${coordinates}" \
|
||||
"https://central.sonatype.com/api/v1/publisher/upload?publishingType=AUTOMATIC"
|
||||
Reference in New Issue
Block a user