Skip to content

Commit 99b06df

Browse files
adrastogiAditya Rastogi
andauthored
Add notes for bumping version as part of a release (#27080)
### Description <!-- Describe your changes. --> When creating a release branch for a new ORT release, there are some steps required to comprehensively update the version number across the codebase. This change adds the steps for that for anyone driving a release. ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> This will help with the release process and ensure that any bits produced from release branches carry the right version information. --------- Co-authored-by: Aditya Rastogi <adityar@ntdev.microsoft.com>
1 parent 06566ef commit 99b06df

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

docs/Versioning.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,67 @@ The version number of the current stable release can be found
1111
## Release cadence
1212
See [Release Management](ReleaseManagement.md)
1313

14+
## Updating the Version for a Release
15+
16+
When preparing a release, follow these steps to update the version number across the codebase. This applies both when creating an initial release branch (updating `main`) and when preparing patch releases on release branches:
17+
18+
### Prerequisites
19+
- Node.js (check [js/.nvmrc](../js/.nvmrc) for the required version)
20+
- npm (comes with Node.js)
21+
- Python 3
22+
23+
Verify your setup:
24+
```bash
25+
node --version # Should match the version in js/.nvmrc
26+
npm --version # Should be v8.0 or newer
27+
```
28+
29+
### Steps
30+
31+
1. **Update the VERSION_NUMBER file**
32+
33+
Edit [VERSION_NUMBER](../VERSION_NUMBER) in the repository root to reflect the new version (e.g., `1.23.3`).
34+
35+
2. **Run the version update script**
36+
37+
From the repository root, run:
38+
```bash
39+
python tools/python/update_version.py
40+
```
41+
42+
This script automatically updates version numbers in:
43+
- `docs/Versioning.md` - Adds a new row to the version table
44+
- `docs/python/README.rst` - Adds release notes entry
45+
- `onnxruntime/__init__.py` - Python package version
46+
- `js/` packages - All NPM package versions and lock files
47+
48+
3. **Update the C API static_assert (Manual Step)**
49+
50+
The script does **not** update the version check in the C API. You must manually update the `static_assert` in [onnxruntime/core/session/onnxruntime_c_api.cc](../onnxruntime/core/session/onnxruntime_c_api.cc).
51+
52+
Search for `static_assert(std::string_view(ORT_VERSION)` and update the version string:
53+
```cpp
54+
static_assert(std::string_view(ORT_VERSION) == "X.Y.Z",
55+
"ORT_Version change detected, please follow below steps to ensure OrtApi is updated properly");
56+
```
57+
58+
Replace `X.Y.Z` with your new version number. The comments following this assert explain additional steps if new APIs were added to this release.
59+
60+
4. **Review all changes**
61+
62+
Review all modified files. Verify:
63+
- Version numbers are correct in all updated files
64+
- The release notes URL format is correct (e.g., `https://github.com/Microsoft/onnxruntime/releases/tag/vX.Y.Z`)
65+
66+
5. **Commit and create PR**
67+
68+
Commit all changes and create a PR targeting `main` or a release branch as appropriate.
69+
70+
### Notes
71+
72+
- The version table in this file and the ONNX opset compatibility information on [onnxruntime.ai](https://onnxruntime.ai/docs/reference/compatibility.html#onnx-opset-support) are the canonical sources for version compatibility information.
73+
- For ONNX version/opset/IR reference numbers, see the [ONNX Versioning documentation](https://github.com/onnx/onnx/blob/main/docs/Versioning.md#released-versions).
74+
1475
# Compatibility
1576
1677
## Backwards compatibility

0 commit comments

Comments
 (0)