Skip to content

build: attach Maven artifact ZIP bundles to releases - #871

Merged
zhongkechen merged 4 commits into
aws:mainfrom
zhongkechen:build/maven-release-bundles
Nov 5, 2026
Merged

zhongkechen merged 4 commits into
aws:mainfrom
zhongkechen:build/maven-release-bundles

Conversation

@zhongkechen

@zhongkechen zhongkechen commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Add one ZIP bundle per Maven artifact to GitHub releases. Each bundle contains every file that module publishes to Sonatype — the POM, the runtime JAR, the source JAR, the Javadoc JAR, and the detached GPG signature for each of them — plus a SHA-256 manifest. The existing standalone JAR assets remain available.

The release job packages the exact files submitted to Sonatype, so archive consumers use the same artifacts as Maven consumers, and can verify them against the release signing key.

Design

Release consumers that require an archive currently have to assemble separate Maven files themselves. Reusing the existing publication outputs is simpler than polling Maven Central after its separate manual publication step, and preserves the published binaries better than rebuilding source downstream. No existing release output or SDK API is removed.

Every file is read from the module's target directory. maven-gpg-plugin copies the flattened POM there as the file it signs, so one uniform naming scheme covers all eight files and the bundled POM is the byte-identical copy the signature belongs to.

The standalone JARs upload before packaging. A bundling failure then cannot withhold release assets that already uploaded successfully; bundles go up in a step of their own.

Decisions this task did not cover:

  • One bundle per module, so modules can be consumed independently.
  • Fixed ZIP timestamps and a pinned create_system, so repeated packaging is byte-reproducible on any platform.
  • Missing files or mismatched Maven coordinates fail the packaging step rather than producing a partial bundle.
  • Prerelease versions such as 3.0.1-rc1 are accepted, because RELEASE.md documents prerelease releases; -SNAPSHOT is rejected.
  • Stale *-bundle.zip files are cleared before packaging, so the upload glob cannot attach another version's bundles.
  • Python standard library only; no new dependency and no new workflow action.

Validation

  • Ten unit tests cover all four modules, exact artifact and signature bytes and hashes, the exact entry name set and order, entry metadata, reproducibility across different clocks, mismatched coordinates, each of the eight files missing in turn, stale-output clearing, and version validation.
  • Mutation-checked per CONTRIBUTING rule 4: removing any single line of the packaging logic fails at least one test.
  • A new test cross-checks MODULES against the modules maven_publish.sh deploys and against each module POM, so the hardcoded list cannot drift.
  • Verified against a real Maven run with this repository's publishing profile that maven-gpg-plugin 3.2.8 creates target/<artifact>-<version>.pom and that it is byte-identical to .flattened-pom.xml.
  • Generated all four 3.0.1 bundles from Maven Central artifacts and verified the 16 input files against Maven Central SHA-256 checksums.
  • The bundle tests run in their own job in the release-build test workflow, with no JDK setup.

Unverified assumption: that signing writes <file>.asc beside each published file in target. This is read from maven-gpg-plugin 3.2.8's source (AbstractGpgSigner.SIGNATURE_EXTENSION, new File(file + SIGNATURE_EXTENSION)), not from a signed run, because signing needs the release key. The step fails closed if a signature is absent, and it now runs after the JAR upload, so a wrong assumption costs the bundles and not the release.

@zhongkechen
zhongkechen marked this pull request as ready for review November 4, 2026 19:50
@zhongkechen
zhongkechen requested a review from a team November 4, 2026 19:50
@zhongkechen
zhongkechen temporarily deployed to ai-pr-review-runtime November 4, 2026 19:50 — with GitHub Actions Inactive
…first

Address review findings on the release bundles.

Bundle contents now match what Sonatype receives. Every file is read from the
module's target directory, including the detached GPG signature that the
publishing profile writes for the POM and each JAR, so a bundle can be verified
against the release signing key rather than only against its own manifest.
Reading all eight files from one directory also removes the POM special case:
maven-gpg-plugin copies the flattened POM to target as the file it signs, and
that copy is byte-identical to .flattened-pom.xml.

Release safety. The JAR upload runs before packaging, so a bundling failure can
no longer withhold the standalone JARs that the release already published.
Bundles upload in a step of their own.

Other fixes. The repository root comes from __file__ instead of the working
directory, matching test_release_timestamp.py. The version guard now rejects
-SNAPSHOT, which its own error message already promised. Stale bundles are
cleared before packaging so the upload glob cannot pick up another version.
ZIP entries pin create_system so bundles are reproducible across platforms, and
the dead ZipFile compression argument is gone.

Tests. Every line of the packaging logic now has a test that fails without it:
entry metadata, entry order, signature inclusion, the manifest checksum set,
stale-output clearing, and snapshot rejection. The coordinate and missing-file
cases restore their fixtures in finally blocks and cover all eight published
files. A new test cross-checks MODULES against the modules maven_publish.sh
deploys and against each module POM, so the list cannot drift silently. The
bundle tests moved to their own job, which needs no JDK and no longer waits on
the Javadoc reproducibility test.

RELEASE.md documents the new assets and how to verify one.
@zhongkechen
zhongkechen merged commit bc62b91 into aws:main Nov 5, 2026
13 of 14 checks passed
@zhongkechen
zhongkechen deleted the build/maven-release-bundles branch November 5, 2026 00:25
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.

2 participants