Skip to content

fix(ci): replace deprecated R2 uploader - #2009

Open
eoinest wants to merge 1 commit into
mainfrom
e/ci/fix-r2-uploads
Open

fix(ci): replace deprecated R2 uploader#2009
eoinest wants to merge 1 commit into
mainfrom
e/ci/fix-r2-uploads

Conversation

@eoinest

@eoinest eoinest commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • replace the stale Node 20 R2 upload action with a repository-local AWS CLI uploader
  • use standard retries and automatic multipart transfers for CLI binaries while preserving provider errors in failed logs
  • share the uploader across versioned, latest, and static asset uploads

Testing

  • pnpm exec oxfmt --check .github/actions/r2-upload/action.yml .github/workflows/asset-upload.yml .github/workflows/release.yml — passed
  • YAML parsing and embedded Bash syntax checks — passed
  • mocked bucket-root and versioned-prefix upload target checks — passed
  • actionlint .github/workflows/asset-upload.yml .github/workflows/release.yml — passed with actionlint v1.7.12

Notes

  • Changeset: not required for CI-only changes.
  • A live upload was not run locally because R2 credentials are restricted to the release environment.

Greptile Summary

This PR replaces the third-party ryand56/r2-upload-action@v1.4 with a repository-local composite action that drives the AWS CLI directly, gaining standard retry logic and automatic multipart support for large binary uploads.

  • New composite action (.github/actions/r2-upload/action.yml): accepts six inputs, validates prerequisites (AWS CLI present, source directory exists), normalises the destination-dir input to handle empty, ./, and bare-path forms, then runs aws s3 cp --recursive with credentials supplied via environment variables and retry config via AWS_RETRY_MODE=standard / AWS_MAX_ATTEMPTS=5.
  • release.yml and asset-upload.yml: four upload steps and one asset-upload step are updated to uses: ./.github/actions/r2-upload with identical input mappings to the old action; no other workflow logic is changed.

Confidence Score: 4/5

Safe to merge; the local composite action is a clean, self-contained replacement with no behavioural regressions relative to the removed third-party action.

The action handles all destination-dir edge cases correctly, credentials are never interpolated directly into the shell command, and retry/checksum settings are appropriate for Cloudflare R2. The one gap is that aws s3 cp --recursive cannot delete objects, so the latest prefix will accumulate binaries from any platforms that are later dropped.

Files Needing Attention: .github/actions/r2-upload/action.yml — worth a second look on the aws s3 cp vs aws s3 sync --delete choice for the latest destination prefix.

Important Files Changed

Filename Overview
.github/actions/r2-upload/action.yml New composite action replacing ryand56/r2-upload-action; correctly handles destination-dir edge cases (empty, "./", root); credentials passed via env vars; retry config set via AWS_ env vars; minor: latest uploads won't purge removed-platform binaries since aws s3 cp lacks --delete.
.github/workflows/asset-upload.yml Swaps third-party action for local composite; passes destination-dir as "./" which the action correctly normalises to bucket root; all required inputs supplied.
.github/workflows/release.yml Four upload steps updated to use the local action; versioned and latest destination paths are unchanged; all required inputs (account-id, key, secret, bucket, source-dir, destination-dir) provided consistently.

Fix All in Claude Code Fix All in Codex

Prompt To Fix All With AI
### Issue 1
.github/actions/r2-upload/action.yml:63-66
**`latest` prefix retains removed-platform binaries**

`aws s3 cp --recursive` only adds/overwrites objects; it has no `--delete` equivalent (that flag belongs to `aws s3 sync`). If a future release drops support for a platform, the stale binary will remain in the `cli/latest` and `gtx-cli/latest` prefixes indefinitely. Using `aws s3 sync --delete` for the `latest` destination uploads (not the versioned ones) would keep that prefix clean and exactly matching the current release.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "fix(ci): replace deprecated R2 uploader" | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
generaltranslation 18.12 KB (0%)
generaltranslation/runtime 14.93 KB (0%)
generaltranslation/id 2.55 KB (0%)
generaltranslation/internal 7.39 KB (0%)
generaltranslation/types 115 B (0%)
generaltranslation/errors 81 B (0%)
@generaltranslation/format 9.5 KB (0%)
@generaltranslation/format/types 89 B (0%)
@generaltranslation/format/internal 880 B (0%)
gt-i18n 11.91 KB (0%)
gt-i18n/types 13 B (0%)
gt-i18n/internal 22.46 KB (0%)
gt-i18n/internal/types 13 B (0%)
@generaltranslation/react-core/pure 25.57 KB (0%)
@generaltranslation/react-core/hooks 20.61 KB (0%)
@generaltranslation/react-core/components 22.81 KB (0%)
@generaltranslation/react-core/components-rsc 26.16 KB (0%)
gt-react (client) 32.02 KB (0%)
gt-react (rsc) 28.64 KB (0%)
gt-react (server) 31.67 KB (0%)
gt-react/macros 8.85 KB (0%)
gt-next (client) 43.9 KB (0%)
gt-next (rsc) 47.91 KB (0%)
gt-next (server) 44.02 KB (0%)
gt-next/config 270.18 KB (0%)
gt-next/server 46.4 KB (0%)
gt-next/middleware 36.57 KB (0%)
gt-next/link 42.77 KB (0%)
gt-next/internal/_dictionary 144 B (0%)
gt-next/internal/_load-translations 144 B (0%)
gt-next/internal/_load-dictionary 144 B (0%)
gt-next/internal/_getLocale 125 B (0%)
gt-next/internal/_getRegion 122 B (0%)
gt-node 23.54 KB (0%)
gt-node/types 219 B (0%)
gt-node/internal 13.47 KB (0%)
gt-tanstack-start (client) 31.6 KB (0%)
gt-tanstack-start (server) 32.1 KB (0%)
gt-tanstack-start/server 10.27 KB (0%)
gt-react-native 30.05 KB (0%)
gt-react-native/plugin 4.59 KB (0%)
gt-react-native/internal 746 B (0%)

Comment on lines +63 to +66
aws s3 cp "$SOURCE_DIR" "$target" \
--recursive \
--endpoint-url "https://${R2_ACCOUNT_ID}.r2.cloudflarestorage.com" \
--no-progress

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 latest prefix retains removed-platform binaries

aws s3 cp --recursive only adds/overwrites objects; it has no --delete equivalent (that flag belongs to aws s3 sync). If a future release drops support for a platform, the stale binary will remain in the cli/latest and gtx-cli/latest prefixes indefinitely. Using aws s3 sync --delete for the latest destination uploads (not the versioned ones) would keep that prefix clean and exactly matching the current release.

Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/actions/r2-upload/action.yml
Line: 63-66

Comment:
**`latest` prefix retains removed-platform binaries**

`aws s3 cp --recursive` only adds/overwrites objects; it has no `--delete` equivalent (that flag belongs to `aws s3 sync`). If a future release drops support for a platform, the stale binary will remain in the `cli/latest` and `gtx-cli/latest` prefixes indefinitely. Using `aws s3 sync --delete` for the `latest` destination uploads (not the versioned ones) would keep that prefix clean and exactly matching the current release.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Claude Code Fix in Codex

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.

1 participant