Skip to content

fix(updater): publish one merged S3 auto-update manifest per OS#254

Open
sproctor wants to merge 1 commit into
NucleusFramework:mainfrom
sproctor:fix/s3-manifest-clobber
Open

fix(updater): publish one merged S3 auto-update manifest per OS#254
sproctor wants to merge 1 commit into
NucleusFramework:mainfrom
sproctor:fix/s3-manifest-clobber

Conversation

@sproctor
Copy link
Copy Markdown
Contributor

🚀 Description

Claude generated description of changes:

Nucleus runs a separate electron-builder invocation per TargetFormat, and each updatable run publishes its own single-artifact <channel><osSuffix>.yml. Because the manifest name is keyed only on the OS, every format of the same OS publishes to the same S3 key, so the last writer clobbers the others — e.g. the deb run overwrites the AppImage entry, and an AppImage client then hits NoMatchingFileException (on macOS a dmg-only latest-mac.yml breaks Squirrel.Mac updates entirely).

Fix: always set publishAutoUpdate: false for S3 so electron-builder uploads the artifacts but not the manifests, then a new merge task discovers the per-format manifests for the current OS, unions their files: entries (UpdateYmlMerger), and uploads a single manifest via aws s3 cp. A lone manifest passes through verbatim to preserve electron-builder's exact metadata.

  • TargetFormat.producesUpdateManifest gates registering the merge task.
  • Upload mirrors electron-builder's publish decision (publish mode + CI tag), fails loudly if a manifest is expected but missing or the aws CLI is absent.
  • Tested: merge/discovery, publish-flag/tag logic, s3 key, and the publishAutoUpdate:false config emission.

Scope: S3 only. GitHub releases are already consolidated in CI (generate-update-yml).

📄 Motivation and Context

Fixes #253

🧪 How Has This Been Tested?

Added tests.

📦 Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

✅ Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Nucleus runs a separate electron-builder invocation per TargetFormat, and
each updatable run publishes its own single-artifact `<channel><osSuffix>.yml`.
Because the manifest name is keyed only on the OS, every format of the same OS
publishes to the same S3 key, so the last writer clobbers the others — e.g. the
deb run overwrites the AppImage entry, and an AppImage client then hits
NoMatchingFileException (on macOS a dmg-only `latest-mac.yml` breaks Squirrel.Mac
updates entirely).

Fix: always set `publishAutoUpdate: false` for S3 so electron-builder uploads
the artifacts but not the manifests, then a new merge task discovers the
per-format manifests for the current OS, unions their `files:` entries
(UpdateYmlMerger), and uploads a single manifest via `aws s3 cp`. A lone
manifest passes through verbatim to preserve electron-builder's exact metadata.

- TargetFormat.producesUpdateManifest gates registering the merge task.
- Upload mirrors electron-builder's publish decision (publish mode + CI tag),
  fails loudly if a manifest is expected but missing or the aws CLI is absent.
- Tested: merge/discovery, publish-flag/tag logic, s3 key, and the
  publishAutoUpdate:false config emission.

Scope: S3 only. GitHub releases are already consolidated in CI
(generate-update-yml). Cross-arch merging remains a CI concern.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

Multiple target formats for the same OS fails on S3

1 participant