[FSSDK-12882] release pipeline update#343
Open
junaed-optimizely wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
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.shto 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 on lines
+40
to
+42
| - name: Checkout branch | ||
| uses: actions/checkout@v4 | ||
|
|
|
|
||
| for v in $versions; do | ||
| echo "::group::${pkg}@${v}" | ||
| tarball=$(npm pack "${pkg}@${v}" --registry https://registry.npmjs.org 2>/dev/null | tail -n1) |
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.
Summary
This pull request introduces significant improvements to the release and publishing workflow for the
@optimizely/react-sdkpackage. It adds a new, idempotent script for publishing to both npm and GitHub Package Registry (GHR), splits the release workflow into separate jobs for npm and GHR, and provides a manual workflow to backfill historical versions to GHR. These changes ensure consistent, safe, and repeatable publishing across registries, and make it easy to synchronize GHR with npm.Release workflow improvements:
.github/workflows/react_release.yml) is refactored to split publishing into two jobs: one for npm and one for GitHub Package Registry, both using a shared publish script for consistent behavior. [1] [2]New publish script:
scripts/publish.shis added, which is registry-agnostic, idempotent, and automatically computes the correct npm dist-tag (latest,beta,alpha,rc) based on the version string. It skips publishing if the version already exists and supports dry runs.Backfill workflow:
.github/workflows/ghr_backfill.yml) is introduced to backfill all missing or specific versions from npm to GHR, ensuring the GHR registry mirrors npm exactly and safely.These changes make the release process more robust, automate version/tag handling, and simplify maintenance of both npm and GHR registries.
Test plan
Existing tests should pass
Issues