ci(release): split cpp SDK BJ/HK uploads into independent retrying jobs - #593
Merged
Merged
Conversation
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.
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.
Problem
publish-cpp-sdkuploaded the packaged C++ SDK tarball to two regional S3buckets (Beijing, Hong Kong) as two sequential steps in one job with no
retry. Because they were sequential and had no
continue-on-error:HK was even attempted, and
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-sdknow just packages the tarball and uploads it as a workflowartifact (
cpp-sdk-tarball).upload-cpp-sdk-bjandupload-cpp-sdk-hk— eachdownload that artifact and push to their region.
the other, and only the region that genuinely fails after 5 attempts turns red.
No secret names, buckets, regions, destinations, or
--cache-controlvalueschanged — only the job/step structure and retry wrapper.
Notes
matrix(thesecretscontext isn't available there), so this uses two explicit jobs rather than a
region matrix — same effect: independent, non-blocking, per-region retry.