Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/actions/build-android/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ runs:
- name: Install node dependencies
uses: ./.github/actions/yarn-install
- name: Set React Native Version
# We don't want to set the version for stable branches, because this has been
# already set from the 'create release' commits on the release branch.
if: ${{ !endsWith(github.ref_name, '-stable') }}
shell: bash
run: node ./scripts/releases/set-rn-artifacts-version.js --build-type ${{ inputs.release-type }}
- name: Setup gradle
Expand Down
25 changes: 19 additions & 6 deletions scripts/releases-ci/publish-npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const {
} = require('../releases/utils/release-utils');
const {REPO_ROOT} = require('../shared/consts');
const {getPackages} = require('../shared/monorepoUtils');
const fs = require('fs');
const path = require('path');
const yargs = require('yargs');

Expand Down Expand Up @@ -94,12 +95,24 @@ async function publishNpm(buildType /*: BuildType */) /*: Promise<void> */ {
const {version, tag} = getNpmInfo(buildType);

// For stable releases, ci job `prepare_package_for_release` handles this
if (['dry-run', 'nightly'].includes(buildType)) {
if (buildType === 'nightly') {
// Set same version for all monorepo packages
await setVersion(version);
await publishMonorepoPackages(tag);
} else {
if (buildType === 'nightly') {
// Set same version for all monorepo packages
await setVersion(version);
await publishMonorepoPackages(tag);
} else if (buildType === 'dry-run') {
// Before updating React Native artifacts versions for dry-run, we check if the version has already been set.
// If it has, we don't need to update the artifacts at all (at this will revert them back to 1000.0.0)
// If it hasn't, we can update the native artifacts accordingly.
const reactNativePackageJson = path.join(
REPO_ROOT,
'packages',
'react-native',
'package.json',
);
const packageJsonContent = fs.readFileSync(reactNativePackageJson, 'utf8');
const packageJson = JSON.parse(packageJsonContent);

if (packageJson.version === '1000.0.0') {
await updateReactNativeArtifacts(version, buildType);
}
}
Expand Down
Loading