Skip to content

fix(ci): switch R2 upload from wrangler to AWS S3 CLI#730

Merged
lefarcen merged 1 commit intomainfrom
fix/r2-upload-size-limit
Apr 1, 2026
Merged

fix(ci): switch R2 upload from wrangler to AWS S3 CLI#730
lefarcen merged 1 commit intomainfrom
fix/r2-upload-size-limit

Conversation

@lefarcen
Copy link
Copy Markdown
Collaborator

@lefarcen lefarcen commented Apr 1, 2026

What

Replace npx wrangler r2 object put with aws s3 cp for uploading desktop build artifacts to Cloudflare R2.

Why

The Intel x64 DMG has grown to 303 MiB, exceeding wrangler's hard 300 MiB single-object upload limit. This broke the nightly Intel build (run #23826267155). ARM64 DMG is at 281 MiB and will hit the same wall soon.

How

  • Switch from npx wrangler r2 object put to aws s3 cp in both desktop-build.yml and desktop-release.yml
  • R2 natively supports the S3 API; aws s3 cp automatically uses multipart upload for large files β€” no size limit
  • aws CLI is pre-installed on GitHub macOS runners, no extra setup needed
  • Also eliminates the ~30s npx wrangler@4.79.0 download overhead per upload call

Requires new GitHub Secrets:

  • R2_ACCESS_KEY_ID β€” from Cloudflare R2 API Token (S3 Auth)
  • R2_SECRET_ACCESS_KEY β€” from Cloudflare R2 API Token (S3 Auth)

CLOUDFLARE_ACCOUNT_ID is reused for the endpoint URL. The existing CLOUDFLARE_API_TOKEN is still used by the CDN cache purge step (unchanged).

Affected areas

  • Build / CI / Tooling

Checklist

  • No credentials or tokens in code or logs
  • No any types introduced

Notes for reviewers

Before merging, add R2_ACCESS_KEY_ID and R2_SECRET_ACCESS_KEY to GitHub repo secrets. Create them in Cloudflare Dashboard β†’ R2 β†’ Manage R2 API Tokens β†’ Create API Token (Object Read & Write, bucket: nexu-desktop-releases).

wrangler r2 object put has a 300 MiB hard limit. The Intel x64 DMG
(303 MiB) now exceeds this, breaking nightly and release builds.
Switch to aws s3 cp which uses S3-compatible multipart upload with
no size limit. Also eliminates the per-upload npx wrangler download
overhead.

Requires R2_ACCESS_KEY_ID and R2_SECRET_ACCESS_KEY secrets.
@lefarcen lefarcen merged commit ce87fa4 into main Apr 1, 2026
7 checks passed
@mrcfps mrcfps deleted the fix/r2-upload-size-limit branch April 1, 2026 02:56
@lefarcen lefarcen mentioned this pull request Apr 1, 2026
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