Skip to content

ci(release): reuse the signed jar for JVM images; skip re-test at tag - #247

Merged
ifsantana merged 1 commit into
mainfrom
ci/release-pipeline-reuse-jar
Jul 16, 2026
Merged

ci(release): reuse the signed jar for JVM images; skip re-test at tag#247
ifsantana merged 1 commit into
mainfrom
ci/release-pipeline-reuse-jar

Conversation

@ifsantana

Copy link
Copy Markdown
Collaborator

Closes #243. Phase C of the pipeline cost/speed plan. Stacked on #244 (Phase A) — base will retarget to main once #244 merges. Review #244 first.

Why

Each release ran ~45–60 billed job-minutes: sign-artifacts re-ran the full test suite even though the tagged commit already passed CI on main, and the two JVM image jobs (GHCR + Docker Hub) each rebuilt all Maven modules from source inside Docker — ignoring the signed jars sign-artifacts had already uploaded.

Changes

Reuse the signed jar (new Dockerfile.release)

  • publish-and-sign-image and publish-dockerhub-jvm now download-artifact the signed-jars bundle, cp the repackaged boot jar to ./app.jar, and build a runtime-only Dockerfile.release (FROM eclipse-temurin:21-jre + COPY app.jar). No JDK setup, no versions:set, no in-Docker Maven build in these jobs.
  • The published image therefore contains the byte-identical GPG-signed boot jar (a provenance win for the public launch).
  • The from-source Dockerfile is untouched for local/from-source users.
  • New smoke step: runs the pushed image and asserts it reaches Starting IdemApplication before exiting — validated locally end-to-end (image built from the prebuilt jar boots to Starting IdemApplicationKt v0.1.0-SNAPSHOT).

Skip re-test at tag, guarded (#243)

  • sign-artifacts: -P release clean verify-P release verify -DskipTests.
  • New guard step fails the release unless the tagged SHA has a successful CI run (gh run list --commit "$GITHUB_SHA" --workflow CI). ktlint/detekt and GPG signing (bound to verify) still run; JaCoCo auto-skips on missing exec data.

Impact

Release drops from ~45–60 to ~20–30 billed job-minutes (removes 2× full Maven build + 2× JDK setup, and ~10–15 min of redundant testing on the critical path).

Test plan

  • Verified locally: Dockerfile.release builds from a prebuilt app/target/app-*.jar; timeout 90 docker run reaches the Spring Boot startup banner (smoke assertion passes).
  • Full release path runs on the next v*.*.* tag. The guard step blocks a tag placed on an untested commit.
  • YAML parsed clean via gh workflow view.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@ifsantana
ifsantana changed the base branch from ci/pipeline-phase-a-quick-wins to main July 16, 2026 13:16
…#243)

The two JVM image jobs (GHCR + Docker Hub) each rebuilt every Maven module
from source inside Docker, ignoring the GPG-signed jars sign-artifacts had
already produced. They now download the signed-jars artifact and COPY the
boot jar into a runtime-only Dockerfile.release, so the published image
carries the byte-identical signed artifact. A smoke step runs the image and
asserts it reaches Spring Boot startup.

sign-artifacts drops the redundant full test run (-P release verify
-DskipTests): the tag is cut from a main commit that already passed CI, now
enforced by a guard step that fails unless the tagged SHA has a successful
CI run. ktlint/detekt and GPG signing at the verify phase are unchanged.

Stacked on the Phase A branch (#241) since both touch release.yml.
Locally validated: Dockerfile.release builds from the prebuilt jar and the
smoke command reaches 'Starting IdemApplicationKt'.

Signed-off-by: ifsantana <flaubert165@gmail.com>
@ifsantana
ifsantana force-pushed the ci/release-pipeline-reuse-jar branch from 5a360bf to a7c1d9f Compare July 16, 2026 13:16
@ifsantana
ifsantana merged commit ba17625 into main Jul 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci(release): build jar once and reuse in image jobs; skip re-test at tag with CI-green guard (Phase C)

1 participant