Skip to content

[FSSDK-12882] release pipeline update#343

Merged
junaed-optimizely merged 6 commits into
masterfrom
junaed/fssdk-12882-ghr-publish-adjustment
Jul 17, 2026
Merged

[FSSDK-12882] release pipeline update#343
junaed-optimizely merged 6 commits into
masterfrom
junaed/fssdk-12882-ghr-publish-adjustment

Conversation

@junaed-optimizely

@junaed-optimizely junaed-optimizely commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds GitHub Package Registry (GHR) publishing alongside the existing npm release, and a way to backfill historical versions to GHR.

Changes

  • react_release.yml — on release, builds/tests/packs a single tarball once and publishes that same artifact to both npm and GHR, so both registries get identical bytes. npm publishes first; if it fails the job stops before GHR, keeping the registries in sync.
  • scripts/publish.sh — shared, idempotent publish helper: skips versions already present on the target registry (safe re-runs), computes the dist-tag from the version (beta/alpha/rc/latest), and never moves latest backwards onto an older major (tags it v-latest instead).
  • ghr_backfill.yml — manual (workflow_dispatch) workflow to backfill any or all npm versions into GHR by re-publishing the npm tarballs. Idempotent, with a dry-run option.

Recovery

  • npm ok / GHR fails → re-run the release, or run the backfill (guard skips what's already published).
  • npm fails → GHR is skipped; nothing is half-published.

Test plan

Existing tests should pass

Issues

  • FSSDK-12882

Comment thread .github/workflows/ghr_backfill.yml
Comment thread .github/workflows/ghr_backfill.yml

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the @optimizely/react-sdk release tooling to make publishing repeatable across both npm and GitHub Package Registry (GHR) by introducing a shared, idempotent publish script, splitting the release workflow into separate npm/GHR jobs, and adding a manual backfill workflow for populating historical versions into GHR from npm tarballs.

Changes:

  • Added scripts/publish.sh to publish idempotently to a specified registry and compute the correct dist-tag from the version.
  • Refactored the release workflow to publish to npm and GHR in separate jobs using the shared publish script.
  • Added a manual backfill workflow to republish npm tarballs into GHR (with optional dry-run).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
scripts/publish.sh New registry-agnostic publish helper with version-exists guard and dist-tag selection.
.github/workflows/react_release.yml Splits release publishing into npm and GHR jobs, both calling the shared publish script.
.github/workflows/ghr_backfill.yml Adds manual workflow to backfill versions from npm into GHR using packed tarballs and the publish script.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ghr_backfill.yml
Comment thread scripts/publish.sh Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/react_release.yml
Comment thread .github/workflows/ghr_backfill.yml Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Comment thread .github/workflows/ghr_backfill.yml
Comment thread .github/workflows/ghr_backfill.yml Outdated
Comment thread .github/workflows/react_release.yml Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/ghr_backfill.yml
Comment thread .github/workflows/react_release.yml

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Comment thread scripts/publish.sh Outdated
*) tag=latest ;;
esac

if npm view "${pkg}@${version}" version --registry "$registry" >/dev/null 2>&1; then

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.

npm the npm view command fails for any reason (like network error) other than the package not existing, it will assume the package does not exists and will continue. Can we make this check more robust?

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.

like calling the api directly to fetch version data?

Comment thread scripts/publish.sh Outdated
*-beta*) tag=beta ;;
*-alpha*) tag=alpha ;;
*-rc*) tag=rc ;;
*) tag=latest ;;

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.

this tag should be set to latest only if the published version is strictly greater than the latest published version. We should cover the cases where a patch is released for a previous minor of the latest major, like so: current latest: 6.5.0, but we are releasing say 6.4.1. We don't face such cases normally but would be good to cover

Comment thread scripts/publish.sh Outdated
current_latest=$(npm view "${pkg}" version --registry "$registry" 2>/dev/null || true)
our_major=${version%%.*}
latest_major=${current_latest%%.*}
if [[ "$our_major" =~ ^[0-9]+$ && "$latest_major" =~ ^[0-9]+$ ]] && (( our_major < latest_major )); then

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.

the tag should be set to latest only if the version being published is strictly greater than the latest published version. We should cover the cases where a patch is released for a previous minor of the latest major, like so: current latest: 6.5.0, but we are releasing say 6.4.1. We don't face such cases normally but would be good to cover

@junaed-optimizely
junaed-optimizely merged commit 4f968a3 into master Jul 17, 2026
11 checks passed
@junaed-optimizely
junaed-optimizely deleted the junaed/fssdk-12882-ghr-publish-adjustment branch July 17, 2026 10:26
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.

3 participants