File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
.github/actions/overwrite-package-version Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -38,15 +38,24 @@ runs:
38
38
env :
39
39
TIMESTAMP : ${{ inputs.timestamp }}
40
40
run : |
41
+ # Read the current version from the Rust crate's Cargo.toml
41
42
CURRENT_VERSION=$(python -c "import toml; print(toml.load('bindings/python/Cargo.toml')['package']['version'])")
42
43
export NEW_VERSION="${CURRENT_VERSION}.dev${TIMESTAMP}"
44
+ echo "Current version: ${CURRENT_VERSION}"
45
+ echo "New dev version: ${NEW_VERSION}"
46
+
47
+ # Update bindings/python/pyproject.toml:
48
+ # - Set project.version = NEW_VERSION
49
+ # - Ensure 'version' is not listed in project.dynamic
43
50
python -c "
44
51
import toml
45
52
import os
46
- config = toml.load('bindings/python/Cargo .toml')
53
+ config = toml.load('bindings/python/pyproject .toml')
47
54
new_version = os.environ['NEW_VERSION']
48
- config['package']['version'] = new_version
49
- with open('bindings/python/Cargo.toml', 'w') as f:
55
+ config['project']['version'] = new_version
56
+ if 'dynamic' in config['project']:
57
+ config['project']['dynamic'] = [v for v in config['project']['dynamic'] if v != 'version']
58
+ with open('bindings/python/pyproject.toml', 'w') as f:
50
59
toml.dump(config, f)
51
60
print(f'Updated version to: {new_version}')
52
61
"
You can’t perform that action at this time.
0 commit comments