Skip to content

Add --autogenerateVersionNumber option to bump-oss-version.js #989

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
4 changes: 2 additions & 2 deletions .ado/templates/android-build-office.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ steps:
# ReactCommon/cxxreact/ReactNativeVersion.h
# Libraries/Core/ReactNativeVersion.js
#
# --nightly => version = `0.0.0-${currentCommit.slice(0, 9)}`;
# --nightly --autogenerateVersionNumber => version = `0.0.0-${currentCommit.slice(0, 9)}`;
# When on main branch or non-stable branch.
- task: CmdLine@2
displayName: Bump canary package version
inputs:
script: node scripts/bump-oss-version.js --nightly
script: node scripts/bump-oss-version.js --nightly --autogenerateVersionNumber
condition: or(eq(variables['Build.SourceBranchName'], 'main'), not(contains(variables['Build.SourceBranchName'], '-stable')))

# TODO: We don't seem to be running bump-oss-version.js for stable branches, hence we would end up publishing using the values in the repository.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
CatalystInstanceImpl::handleMemoryPressure),
makeNativeMethod(
"getRuntimeExecutor", CatalystInstanceImpl::getRuntimeExecutor),
+ makeNativeMethod("getPointerOfInstancePointer", CatalystInstanceImpl::getPointerOfInstancePointer)
+ makeNativeMethod("getPointerOfInstancePointer", CatalystInstanceImpl::getPointerOfInstancePointer),
makeNativeMethod(
"warnOnLegacyNativeModuleSystemUse",
CatalystInstanceImpl::warnOnLegacyNativeModuleSystemUse),
Expand Down
24 changes: 19 additions & 5 deletions scripts/bump-oss-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
type: 'boolean',
default: false,
})
.option('a', { // TODO(macOS GH#774): See note below
alias: 'autogenerate-version-number',
type: 'boolean',
default: false,
})
.option('v', {
alias: 'to-version',
type: 'string',
Expand All @@ -46,14 +51,23 @@
default: false,
}).argv;

const autogenerateVersionNumber = argv.autogenerateVersionNumber;
const nightlyBuild = argv.nightly;
const version = argv.toVersion;
let version = argv.toVersion;

if (!version) {
echo(
'You must specify a version using -v',
);
exit(1);
// TODO(macOS GH#774): Some of our calls to bump-oss-version.js still depend on an automatically generated version number
if (nightlyBuild && autogenerateVersionNumber) {
const currentCommit = exec('git rev-parse HEAD', {
silent: true,
}).stdout.trim();
version = `0.0.0-${currentCommit.slice(0, 9)}`;
} else {
echo(
'You must specify a version using -v',
);
exit(1);
}
}

let branch;
Expand Down