@@ -167,9 +167,9 @@ jobs:
167167
168168 # Cross-module gate: serialization has no tests in its own build, so the
169169 # `mvn verify` above exercises nothing. Its behavioral coverage lives in
170- # aws-lambda-java-tests, which depends on serialization via a version
171- # property. Install the just-built serialization and run that suite
172- # against it, so we never publish serialization the suite hasn't exercised.
170+ # aws-lambda-java-tests, which depends on it via the parent version map.
171+ # Install the just-built serialization and run that suite against it, so
172+ # we never publish serialization the suite hasn't exercised.
173173 - name : Run cross-module test gate
174174 run : |
175175 case "$MODULE" in
@@ -179,8 +179,10 @@ jobs:
179179 echo "::group::Installing $MODULE $MOD_VER for the gate"
180180 mvn install -DskipTests --file "$MODULE/pom.xml"
181181 echo "::endgroup::"
182- echo "::notice::Gating $MODULE on aws-lambda-java-tests (aws-lambda-java-serialization.version=$MOD_VER)"
183- mvn verify -Daws-lambda-java-serialization.version="$MOD_VER" --file aws-lambda-java-tests/pom.xml
182+ echo "::notice::Gating $MODULE on aws-lambda-java-tests (lambda.serialization.version=$MOD_VER)"
183+ # Override the map property so the suite runs against the
184+ # just-built serialization, not the version pinned in the map.
185+ mvn verify -Dlambda.serialization.version="$MOD_VER" --file aws-lambda-java-tests/pom.xml
184186 ;;
185187 *)
186188 echo "::notice::No cross-module test gate for $MODULE"
@@ -257,16 +259,44 @@ jobs:
257259 -Darguments="-gs $MAVEN_SETTINGS -Prelease -Dgpg.keyname=$GPG_KEYNAME -Dgpg.passphrase=$GPG_PASSPHRASE" \
258260 --file "$MODULE/pom.xml"
259261
260- # Bump the lastPublished comment under <version>; rides in the bump PR.
261- - name : Record last published version in POM
262+ # Record the published version in the two places that track it, from the
263+ # same EFFECTIVE_RELEASE_VERSION in one commit so they can't drift:
264+ # (1) the module's lastPublished comment (informational, every module) and
265+ # (2) the parent version map (functional, only for modules others depend
266+ # on). Rides in the version-bump PR below (main is protected).
267+ - name : Record released version (POM lastPublished + parent version map)
262268 if : ${{ github.event.inputs.skip_publish != 'true' }}
263269 run : |
264- if ! grep -q "<!-- lastPublished:" "$MODULE/pom.xml"; then
265- echo "::notice::$MODULE has no lastPublished comment; skipping"
266- exit 0
270+ # (1) Module's lastPublished annotation.
271+ if grep -q "<!-- lastPublished:" "$MODULE/pom.xml"; then
272+ sed -i "s|<!-- lastPublished:.*-->|<!-- lastPublished: ${EFFECTIVE_RELEASE_VERSION} (auto-updated by release.yml) -->|" "$MODULE/pom.xml"
273+ git add "$MODULE/pom.xml"
274+ else
275+ echo "::notice::$MODULE has no lastPublished comment; skipping annotation"
276+ fi
277+
278+ # (2) Parent version map — keyed only for modules other modules depend on.
279+ case "$MODULE" in
280+ aws-lambda-java-core) PROP=lambda.core.version ;;
281+ aws-lambda-java-events) PROP=lambda.events.version ;;
282+ aws-lambda-java-serialization) PROP=lambda.serialization.version ;;
283+ *) PROP="" ;;
284+ esac
285+ if [ -n "$PROP" ]; then
286+ PROP_RE="${PROP//./\\.}"
287+ sed -i.bak -E "s|(<${PROP_RE}>)[^<]*(</${PROP_RE}>)|\1${EFFECTIVE_RELEASE_VERSION}\2|" pom.xml
288+ rm -f pom.xml.bak
289+ git add pom.xml
290+ else
291+ echo "::notice::$MODULE has no internal consumers; version map unchanged"
292+ fi
293+
294+ # One commit for both records, or nothing if neither changed.
295+ if git diff --cached --quiet; then
296+ echo "::notice::$MODULE already recorded at ${EFFECTIVE_RELEASE_VERSION}; nothing to commit"
297+ else
298+ git commit -m "chore(release): record ${MODULE} ${EFFECTIVE_RELEASE_VERSION} (lastPublished + version map)"
267299 fi
268- sed -i "s|<!-- lastPublished:.*-->|<!-- lastPublished: ${EFFECTIVE_RELEASE_VERSION} (auto-updated by release.yml) -->|" "$MODULE/pom.xml"
269- git commit -am "chore(release): record ${MODULE} lastPublished=${EFFECTIVE_RELEASE_VERSION}"
270300
271301 # Prepend the changelog entry so it ships in the version-bump PR. Passed
272302 # via env, never interpolated into the script, so it can't inject shell.
0 commit comments