#!/usr/bin/env bash # After `publish`: every module's maven-metadata.xml, fetched anonymously, lists the new version. # Anonymous on purpose: consumers (the backend template, its image build) read without a token, so a # package only the owner can read is not published. # # scripts/release/verify-published.sh ... set -euo pipefail url=${1:?}; group=${2:?}; version=${3:?}; shift 3 [ $# -gt 0 ] || { echo "verify-published: no artifacts named" >&2; exit 2; } path=${group//.//} missing=0 for artifact in "$@"; do metadata=$(curl --fail --show-error --silent --location --retry 3 "$url/$path/$artifact/maven-metadata.xml" || true) if grep -q "$version" <<<"$metadata"; then echo "published: $group:$artifact:$version" else echo "verify-published: $group:$artifact:$version is not in $url/$path/$artifact/maven-metadata.xml" >&2 missing=1 fi done exit "$missing"