From 6c533e4d5d30ee0dc2baa081d0efaab9cc1d8fea Mon Sep 17 00:00:00 2001 From: Dustin Kut Moy Cheung Date: Thu, 22 Oct 2026 15:06:14 -0400 Subject: [PATCH] Fix Quarkus container image not pushed during Central release release:perform forks a separate Maven build in target/checkout that only inherits properties passed via -Darguments. The Quarkus container-image flags were appended to the outer release command, so the forked build never saw them and no image was built or pushed (snapshot builds were unaffected since they run a plain `mvn deploy` with no fork). Inject the container-image flags into -Darguments instead, falling back to creating one if the release command has none. No input defaults or contracts change, so other callers are unaffected. --- .github/workflows/maven-release.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/maven-release.yml b/.github/workflows/maven-release.yml index 43cb5ca..3a70327 100644 --- a/.github/workflows/maven-release.yml +++ b/.github/workflows/maven-release.yml @@ -104,12 +104,28 @@ jobs: gpg-passphrase: MAVEN_GPG_PASSPHRASE - name: Publish to Central - run: bash -c "${INPUTS_RELEASE_COMMAND} ${{ inputs.quarkus_jib_image && '-Dquarkus.container-image.build=true -Dquarkus.container-image.group=rh-newcastle -Dquarkus.container-image.push=true' || '' }}" + # release:perform forks a fresh Maven build in target/checkout, and that + # fork only inherits properties passed inside -Darguments. The Quarkus + # container-image flags must therefore be injected into -Darguments rather + # than appended to the outer command (where the fork never sees them, so no + # image gets built or pushed). + run: | + RELEASE_CMD="${INPUTS_RELEASE_COMMAND}" + if [ "${QUARKUS_JIB_IMAGE}" = "true" ]; then + JIB_ARGS='-Dquarkus.container-image.build=true -Dquarkus.container-image.group=rh-newcastle -Dquarkus.container-image.push=true' + if printf '%s' "${RELEASE_CMD}" | grep -q -- '-Darguments='; then + RELEASE_CMD=$(printf '%s' "${RELEASE_CMD}" | sed -E "s#(-Darguments=[^\"]*)\"#\1 ${JIB_ARGS}\"#") + else + RELEASE_CMD="${RELEASE_CMD} \"-Darguments=${JIB_ARGS}\"" + fi + fi + bash -c "${RELEASE_CMD}" env: MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }} MAVEN_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} INPUTS_RELEASE_COMMAND: ${{ inputs.release_command }} ${{ inputs.jboss_parent_override }} + QUARKUS_JIB_IMAGE: ${{ inputs.quarkus_jib_image }} - name: Push all the git commits and tags back to the repository run: |