Skip to content

Update version for 2.x branch #1672

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
merged 3 commits into from
Sep 19, 2024
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
22 changes: 22 additions & 0 deletions bin/update-release-version.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function usage()
to-stable: Mark the current version as stable
to-next-patch-dev: Update to the next patch development version
to-next-minor-dev: Update to the next minor development version
to-next-major-dev: Update to the next major development version
get-version: Print the current version number

EOT;
Expand Down Expand Up @@ -167,6 +168,23 @@ function get_next_minor_version(array $versions): array
];
}

function get_next_major_version(array $versions): array
{
$versionComponents = $versions['versionComponents'];

// Increase major version, set other components to 0
$versionComponents[0] += 1;
$versionComponents[1] = 0;
$versionComponents[2] = 0;
$versionComponents[3] = 0;

return [
'version' => get_version_string_from_components($versionComponents) . 'dev',
'stability' => 'devel',
'versionComponents' => $versionComponents,
];
}

function get_next_release_version(array $versions, string $releaseVersion): array
{
$releaseVersion = parse_release_version($releaseVersion);
Expand Down Expand Up @@ -244,6 +262,10 @@ function get_next_dev_version(array $versions): array
$newVersion = get_next_minor_version($currentVersion);
break;

case 'to-next-major-dev':
$newVersion = get_next_major_version($currentVersion);
break;

default:
usage();
}
Expand Down
4 changes: 2 additions & 2 deletions phongo_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
* publishing a release. */

/* clang-format off */
#define PHP_MONGODB_VERSION "1.21.0dev"
#define PHP_MONGODB_VERSION "2.0.0dev"
#define PHP_MONGODB_STABILITY "devel"
#define PHP_MONGODB_VERSION_DESC 1,21,0,0
#define PHP_MONGODB_VERSION_DESC 2,0,0,0
/* clang-format on */

#endif /* PHONGO_VERSION_H */
2 changes: 1 addition & 1 deletion tests/manager/manager-debug-001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ rmdir($name);
<?php exit(0); ?>
--EXPECTF--
%A[%s] PHONGO: DEBUG > Connection string: '%s'
[%s] PHONGO: DEBUG > Creating Manager, phongo-1.%d.%d%S[%s] - mongoc-1.%s(%s), libbson-1.%s(%s), php-%s
[%s] PHONGO: DEBUG > Creating Manager, phongo-%d.%d.%d%S[%s] - mongoc-1.%s(%s), libbson-1.%s(%s), php-%s
%A===DONE===%A
2 changes: 1 addition & 1 deletion tests/manager/manager-debug-002.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ $manager = new MongoDB\Driver\Manager;
<?php exit(0); ?>
--EXPECTF--
%A[%s] PHONGO: DEBUG > Connection string: '%s'
[%s] PHONGO: DEBUG > Creating Manager, phongo-1.%d.%d%S[%s] - mongoc-1.%s(%s), libbson-1.%s(%s), php-%s
[%s] PHONGO: DEBUG > Creating Manager, phongo-%d.%d.%d%S[%s] - mongoc-1.%s(%s), libbson-1.%s(%s), php-%s
%A===DONE===%A