Skip to content

Commit 80b6aab

Browse files
committed
ci: only create .rnm-publish sentinel file if versioning happened
1 parent 9ea49c3 commit 80b6aab

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

packages/nx-release-version/index.js

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,25 @@ const afterAllProjectsVersioned = async (cwd, opts) => {
7676
const changedFiles = [...baseResult.changedFiles];
7777
const deletedFiles = [...baseResult.deletedFiles];
7878

79-
try {
80-
// Create the .rnm-publish file to indicate versioning has occurred
81-
fs.writeFileSync(path.join(REPO_ROOT, '.rnm-publish'), '');
79+
// Only update React Native artifacts if versioning actually happened
80+
if (changedFiles.length > 0) {
81+
try {
82+
// Create the .rnm-publish file to indicate versioning has occurred
83+
fs.writeFileSync(path.join(REPO_ROOT, '.rnm-publish'), '');
8284

83-
// Update React Native artifacts
84-
const versionedFiles = await runSetVersion();
85+
// Update React Native artifacts
86+
const versionedFiles = await runSetVersion();
8587

86-
// Add the versioned files to changed files
87-
changedFiles.push(...versionedFiles);
88+
// Add the versioned files to changed files
89+
changedFiles.push(...versionedFiles);
8890

89-
console.log('✅ Updated React Native artifacts');
90-
console.table(versionedFiles.map(file => path.relative(REPO_ROOT, file)));
91-
} catch (error) {
92-
const errorMessage = error instanceof Error ? error.message : String(error);
93-
console.error(`❌ Failed to update React Native artifacts: ${errorMessage}`);
94-
throw error;
91+
console.log('✅ Updated React Native artifacts');
92+
console.table(versionedFiles.map(file => path.relative(REPO_ROOT, file)));
93+
} catch (error) {
94+
const errorMessage = error instanceof Error ? error.message : String(error);
95+
console.error(`❌ Failed to update React Native artifacts: ${errorMessage}`);
96+
throw error;
97+
}
9598
}
9699

97100
return {

0 commit comments

Comments
 (0)