Add pre-built bundle publishing support for native apps#436
Merged
Conversation
Add support for building platform-specific native bundles (.exe, .app, Linux binary) at publish time and uploading them as downloadable artifacts. Enabled via `publishBundles: true` in package.json jdeploy config. New classes: - BundleArtifact/BundleManifest: models for bundle artifact metadata - PublishBundleService: builds native bundles and wraps in JARs with SHA-256 - S3BundleUploader/S3Config/S3RequestSigner: S3 upload with AWS Sig V4 - BundleUploadRouter: routes uploads to S3 or GitHub releases - BundleChecksumWriter: writes bundle URLs/hashes to package.json Modified: - GitHubPublishDriver: integrates bundle building in prepare() - NPMPublishDriver: integrates bundle building in prepare() https://claude.ai/code/session_01QwiNyMDsuXcg6pyPUCMJDt
…ished manifest Avoid conflict with the existing jdeploy.bundles array (which declares which platform bundles to build). The published manifest with download URLs and checksums is now written under jdeploy.publishedBundles. https://claude.ai/code/session_01QwiNyMDsuXcg6pyPUCMJDt
Add installer support for downloading pre-built native bundles from jdeploy.artifacts in package.json. When artifacts are available for the current platform, the installer downloads and verifies the JAR (SHA-256) instead of running Bundler.runit(), with graceful fallback to local generation on failure. Also restricts CLI bundle generation to Windows only, since macOS includes the CLI binary inside the .app bundle. https://claude.ai/code/session_01QwiNyMDsuXcg6pyPUCMJDt
Revert installer changes (PreBuiltBundleDownloader, Main.install(), NPMPackageVersion artifact methods). Bundle downloading will be implemented in a separate ticket. This PR only covers publishing. https://claude.ai/code/session_01QwiNyMDsuXcg6pyPUCMJDt
Add mock PublishBundleService, BundleUploadRouter, and BundleChecksumWriter to GitHubPublishDriver and NPMPublishDriver test constructors to match the updated signatures. https://claude.ai/code/session_01QwiNyMDsuXcg6pyPUCMJDt
Tests verify that: - CLI bundles are only built for Windows platforms (not Mac/Linux) - GUI bundles are built for all configured platforms - No CLI bundles when no commands are defined - publishBundles flag correctly enables/disables the feature - Artifact filenames follow naming convention with SHA-256 hashes - BundleManifest.toPackageJsonBundles() only includes cli sub-object for Windows entries Uses MockedStatic<Bundler> to intercept Bundler.runit() calls and verify the correct targets and CLI mode flags are passed. https://claude.ai/code/session_01QwiNyMDsuXcg6pyPUCMJDt
Replace the publishBundles boolean + downloadPage.platforms approach
with jdeploy.artifacts entries. Users seed artifact entries with
"enabled": true to declare which platforms to build:
"artifacts": {
"mac-arm64": { "enabled": true },
"win-x64": { "enabled": true }
}
At publish time, url and sha256 are merged into the existing entries,
preserving the enabled flag and any other user-defined fields.
Changes:
- PublishBundleService reads platform list from jdeploy.artifacts keys
with enabled: true (no longer depends on DownloadPageSettingsService)
- BundleChecksumWriter merges built data into existing artifact entries
instead of replacing the entire artifacts object
- Tests updated for new artifacts-based configuration
https://claude.ai/code/session_01QwiNyMDsuXcg6pyPUCMJDt
BaseMockNetworkPublishingTest and MockNetworkPublishingTest were missing the PublishBundleService, BundleUploadRouter, and BundleChecksumWriter parameters added to GitHubPublishDriver and NPMPublishDriver constructors. https://claude.ai/code/session_01QwiNyMDsuXcg6pyPUCMJDt
Verifies that the bundle publishing pipeline produces correct artifacts: - Bundle JARs are copied to GitHub release files directory - SHA-256 checksums and download URLs are written to publish package.json - Bundle metadata propagates into package-info.json version entries - Full prepare+publish flow uploads bundle assets to GitHub - No bundle artifacts when publishing is disabled - Release dir package.json gets matching checksums - Enabled flag is preserved alongside url/sha256 fields Uses real BundleUploadRouter and BundleChecksumWriter with mocked PublishBundleService to test the integration surface without requiring native bundling toolchains. https://claude.ai/code/session_01QwiNyMDsuXcg6pyPUCMJDt
shannah
pushed a commit
that referenced
this pull request
Mar 13, 2026
Add rfc/bundle-publishing-spec.md as the canonical source of truth for the package.json artifacts schema introduced in PR #436. This spec defines the exact structure that external projects should use to detect whether pre-built app bundles exist, including platform keys, field reference, detection algorithm, naming conventions, and integrity verification. https://claude.ai/code/session_015WNb4G3Wb6cxatBZCkg2b7
shannah
added a commit
that referenced
this pull request
Mar 13, 2026
* docs: add RFC spec for pre-built app bundle publishing Add rfc/bundle-publishing-spec.md as the canonical source of truth for the package.json artifacts schema introduced in PR #436. This spec defines the exact structure that external projects should use to detect whether pre-built app bundles exist, including platform keys, field reference, detection algorithm, naming conventions, and integrity verification. https://claude.ai/code/session_015WNb4G3Wb6cxatBZCkg2b7 * docs: add detailed bundle JAR contents to RFC spec Expand the Bundle JAR Contents section with full directory trees for each platform (macOS .app structure, Windows .exe, Linux ELF), describe the embedded app.xml manifest, and clarify what bundles do not include. https://claude.ai/code/session_015WNb4G3Wb6cxatBZCkg2b7 --------- Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for building and publishing pre-built native app bundles (
.exe,.app, Linux binaries) at publish time, allowing users to download ready-to-run applications directly instead of waiting for the installer to bundle them.Key Changes
PublishBundleService: New service that builds platform-specific native bundles during publish and wraps them in JAR files for distribution. Reads enabled platforms from
jdeploy.artifactsin package.json and builds both GUI and CLI variants (CLI only for Windows).Bundle Models: Added
BundleArtifactandBundleManifestclasses to represent and manage collections of built bundle artifacts with metadata (platform, arch, version, SHA-256 hash, download URL).Upload Routing:
BundleUploadRouterroutes bundle uploads to appropriate destinations (S3 or GitHub releases) based on configurationBundleChecksumWriterwrites bundle URLs and SHA-256 hashes into the published package.jsonS3 Support:
S3Configreads S3 configuration from environment variables (JDEPLOY_S3_BUCKET,JDEPLOY_S3_REGION,JDEPLOY_S3_PREFIX)S3BundleUploaderuploads bundles to S3 using AWS Signature Version 4 (no AWS SDK dependency)S3RequestSignerhandles request signing for S3 REST API callsDriver Integration: Updated
GitHubPublishDriverandNPMPublishDriverto integrate bundle publishing into their publish workflows, with fallback to GitHub releases when S3 is not configured.Comprehensive Tests:
BundlePublishMockNetworkTestverifies end-to-end bundle publishing pipeline with realBundleUploadRouterandBundleChecksumWriterbut mockedPublishBundleServicePublishBundleServiceTestvalidates bundle building logic, platform selection, and CLI-only-for-Windows behaviorImplementation Details
{fqpn}-{platform}-{arch}-{version}[-cli].jarjdeploy.bundlessection of published package.json with URLs and SHA-256 hasheshttps://claude.ai/code/session_01QwiNyMDsuXcg6pyPUCMJDt