Skip to content

ci(release): split cpp SDK BJ/HK uploads into independent retrying jobs - #593

Merged
hogan-yuan merged 1 commit into
mainfrom
ci/split-cpp-sdk-uploads
Sep 14, 2026
Merged

hogan-yuan merged 1 commit into
mainfrom
ci/split-cpp-sdk-uploads

Conversation

@hogan-yuan

Copy link
Copy Markdown
Member

Problem

publish-cpp-sdk uploaded the packaged C++ SDK tarball to two regional S3
buckets (Beijing, Hong Kong) as two sequential steps in one job with no
retry. Because they were sequential and had no continue-on-error:

  • a transient network failure on BJ (which ran first) aborted the job before
    HK was even attempted, and
  • either upload flaking marked the entire release run red, even though the
    actual package registries (crates.io / PyPI / npm / Maven) had already
    published successfully.

Uploads to the mainland-Beijing endpoint from GitHub-hosted runners are
especially flaky, so nearly every release ended up red on this step.

Change

  • publish-cpp-sdk now just packages the tarball and uploads it as a workflow
    artifact (cpp-sdk-tarball).
  • Two independent jobs — upload-cpp-sdk-bj and upload-cpp-sdk-hk — each
    download that artifact and push to their region.
  • Each upload retries up to 5 times with linear backoff (10s, 20s, …).
  • The jobs are independent, so one region's failure neither blocks nor cancels
    the other, and only the region that genuinely fails after 5 attempts turns red.

No secret names, buckets, regions, destinations, or --cache-control values
changed — only the job/step structure and retry wrapper.

Notes

  • Region-specific secrets can't be selected from a matrix (the secrets
    context isn't available there), so this uses two explicit jobs rather than a
    region matrix — same effect: independent, non-blocking, per-region retry.

@hogan-yuan
hogan-yuan merged commit 37569c6 into main Sep 14, 2026
56 checks passed
@hogan-yuan
hogan-yuan deleted the ci/split-cpp-sdk-uploads branch September 14, 2026 07:12
hogan-yuan added a commit that referenced this pull request Sep 14, 2026
…empotent (#594)

Two related release-workflow fixes so v5.0.0's Node.js SDK can be
published and
future release re-runs are safe.

## 1. Fix npm publish — pin @napi-rs/cli to 3.8.6

`publish-nodejs-sdk` installed the napi CLI unpinned (`npm install -g
@napi-rs/cli`),
so it floated to latest. v5.0.0 picked up **3.9.1**, whose `napi
prepublish`
(run via `prepublishOnly` before `npm publish`) fails with:

```
npm error code E404
npm error 404 Not Found - PUT https://registry.npmjs.org/longbridge-win32-x64-msvc
npm error command sh -c napi prepublish -t npm
```

Not transient — reproduced identically on two re-runs, and v5.0.0 never
reached
npm (still 4.5.0). v4.5.0 (2026-08-14) published cleanly on **3.8.6**
(latest at
the time); 3.9.0 (09-02) / 3.9.1 (09-10) broke it. Pinned to
`@napi-rs/cli@3.8.6`.

## 2. Make PyPI / Maven publish idempotent

So the release can be safely re-cut (e.g. to retry one SDK's publish)
without the
already-published SDKs failing:

- **PyPI:** `pypa/gh-action-pypi-publish` now uses `skip-existing: true`
(was
  unset → errored on an already-published version).
- **Maven Central:** releases are immutable, so a re-deploy fails. Added
a step
that checks
`repo1.maven.org/.../io/github/longbridge/openapi-sdk/<version>/`
and skips `Update version` / `Import GPG` / `Deploy` when the version
already
  exists.

crates.io was already guarded (`check published version`), so all four
registries
are now re-run-safe.

## After merge — publishing npm 5.0.0

With this merged, advancing the `release` branch to a commit containing
these
fixes re-runs the Release workflow: crates.io skips, PyPI skip-existing,
Maven
skips (5.0.0 already there), and **nodejs publishes 5.0.0** with the
pinned napi.
Companion PR #593 splits the cpp BJ/HK uploads so those no longer flake
the run.
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