chore: automate RN release with prepare and publish workflows - #893
Open
joaodordio wants to merge 1 commit into
Open
chore: automate RN release with prepare and publish workflows#893joaodordio wants to merge 1 commit into
joaodordio wants to merge 1 commit into
Conversation
Aligns the RN release process with the iOS and Android automations. - Add prepare-release.yml (workflow_dispatch) that bumps package.json, regenerates src/itblBuildInfo.ts, optionally bumps the pinned Iterable iOS and Android SDK versions in Iterable-React-Native-SDK.podspec and android/build.gradle, promotes the CHANGELOG.md ## [Unreleased] block to ## X.Y.Z, and opens a release-labeled PR via peter-evans. - Add release.yml (workflow_dispatch) that verifies version consistency, extracts the changelog section, tags the target branch, creates the GitHub Release, and publishes to npm with OIDC provenance. - Add a ## [Unreleased] marker to CHANGELOG.md so contributors accumulate entries there and the workflow can promote them at release time. Older entries left untouched. The existing Validate Release PR workflow still enforces the docs PR link, changelog entry, and itblBuildInfo.ts version consistency, so the generated PRs are validated by the same rules as manual ones.
|
Coverage Impact This PR will not change total coverage. 🚦 See full report on Qlty Cloud »🛟 Help
|
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
Add two workflows to align the RN release process with the automations in
swift-sdkanditerable-android-sdk. Today RN still relies on the manualscripts/release_next_version.shflow which runsnpm publishoff a laptop.prepare-release.yml(workflow_dispatch): takesversionplus optionalios_sdk_version,android_sdk_version,jira_ticket, anddocs_pr_url. It bumpspackage.json, regeneratessrc/itblBuildInfo.ts, optionally bumps the pinned Iterable iOS and Android SDK versions inIterable-React-Native-SDK.podspecandandroid/build.gradle, promotes the## [Unreleased]block inCHANGELOG.mdto## X.Y.Z, and opens arelease-labeled PR viapeter-evans/create-pull-request.release.yml(workflow_dispatch): takesversion,branch(defaultmaster), andset_prerelease. Verifiespackage.jsonandsrc/itblBuildInfo.tsmatch, extracts the changelog section for that version, tags the branch, creates the GitHub Release, and runsnpm publish --provenance --access public(matchesiterable-web-sdk).Also adds a
## [Unreleased]marker at the top ofCHANGELOG.md. Contributors accumulate entries under it going forward and the prepare workflow promotes them at release time. Older## X.Y.Zentries left untouched, andvalidate-release.ymlneeds no changes because the workflow writes## X.Y.Z(no brackets) which matches its existinggrep -qF "## $version"check.Why this shape
npm publish. All auth lives in a GitHub Environment.Validate Release PRin charge. The generated PR is validated by the same rules as manual ones (docs PR link, changelog entry,itblBuildInfo.tsconsistency).Setup required before first run
npmneeds to exist on this repo. Either addNPM_TOKENas a secret, or configure npm Trusted Publisher for@iterable/react-native-sdk. This matches the setup initerable-web-sdk. Without provenance, drop--provenancefromrelease.yml.secrets.GITHUB_TOKEN, soValidate Release PRand CI won't fire on the PR until the release manager edits the body or pushes an empty commit. Same limitation as iOS/Android today. Followup will swap this toSDK_RELEASE_TOKEN(already exists in iOS) or a GitHub App across all four SDK repos in one pass.Verification
## X.Y.Zblock; release-side extraction pulls the exact promoted section.Iterable-React-Native-SDK.podspec(Iterable-iOS-SDK6.6.7→6.6.8) andandroid/build.gradle(com.iterable:iterableapi3.6.2→3.6.3)..nvmrc(v22.14.0) and the repo-pinned yarn 3.6.1 viayarnPath.yarn install --immutablepicks the right binary.Test plan
Prepare Releaseonmasterwith a throwaway version (e.g.9.9.9-test) to inspect the generated PR diff.CHANGELOG.md## [Unreleased]beforehand to confirm promotion works, and rerun.npmenvironment is set up, runReact Native SDK Releaseagainst a-beta1version end-to-end.Not touched
scripts/release_next_version.shand therelease-itconfig inpackage.jsonremain as a manual escape hatch. Retire once the automation ships one or two releases cleanly.README.mdversion compatibility table is intentionally left to human edit in the release PR (native pins are optional and diverging them automatically is risky). Called out in the generated PR checklist.