Skip to content

fix: serialize release pushes and publish before tagging - #14

Merged
pannoury merged 1 commit into
mainfrom
fix/serialize-release-pushes
Aug 8, 2026
Merged

fix: serialize release pushes and publish before tagging#14
pannoury merged 1 commit into
mainfrom
fix/serialize-release-pushes

Conversation

@pannoury

@pannoury pannoury commented Aug 8, 2026

Copy link
Copy Markdown
Member

What changed

Two fixes to the reusable publish workflows for JavaScript and Python.

1. The version-bump push no longer loses a race

detect-changes fans the language jobs out in parallel, and both the JavaScript and Python jobs push their version bump to main. On the last release the JavaScript job landed first and Python failed outright:

! [remote rejected] HEAD -> main (cannot lock ref 'refs/heads/main':
  is at 9d49c79 but expected 3ab5d49)

The push is now wrapped in a retry loop that rebases onto origin/main between attempts, with jittered backoff over five tries. Any commit touching two SDKs would have hit this, so it was going to keep recurring.

2. Publishing happens before the GitHub Release is created

The previous step order was bump → commit → tag/release → publish. When npm publish failed, the tag and release for javascript/v1.1.0 had already been created, leaving a release for a version that does not exist on the registry. Publishing first means a registry failure aborts the job before anything is tagged.

Notes

  • No change to the PHP workflow, which neither bumps a version nor pushes.
  • The javascript/v1.1.0 tag and release are still present and still have no corresponding npm package. Cleaning those up is a separate call, not included here.
  • The npm 404 that triggered all this was a missing @cosmoner scope on the registry, which is a registry-side fix rather than a workflow one.

The Python release job failed with a rejected push: the JavaScript job
landed its version bump on main first, leaving Python pushing a stale
ref. Both jobs are fanned out in parallel by detect-changes, so any
commit touching two SDKs hit this.

Retry the version-bump push with a rebase and jittered backoff so a lost
ref-lock race no longer fails the release.

Also move the registry publish ahead of the GitHub Release step. The
previous order tagged and released before publishing, which is why a
failed npm publish left behind a javascript/v1.1.0 release for a version
that was never published.
@pannoury
pannoury merged commit ecdc538 into main Aug 8, 2026
5 checks passed
@pannoury
pannoury deleted the fix/serialize-release-pushes branch August 8, 2026 15:52
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