Skip to content
Merged
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
15 changes: 12 additions & 3 deletions .github/actions/overwrite-package-version/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,24 @@ runs:
env:
TIMESTAMP: ${{ inputs.timestamp }}
run: |
# Read the current version from the Rust crate's Cargo.toml
CURRENT_VERSION=$(python -c "import toml; print(toml.load('bindings/python/Cargo.toml')['package']['version'])")
export NEW_VERSION="${CURRENT_VERSION}.dev${TIMESTAMP}"
echo "Current version: ${CURRENT_VERSION}"
echo "New dev version: ${NEW_VERSION}"

# Update bindings/python/pyproject.toml:
# - Set project.version = NEW_VERSION
# - Ensure 'version' is not listed in project.dynamic
python -c "
import toml
import os
config = toml.load('bindings/python/Cargo.toml')
config = toml.load('bindings/python/pyproject.toml')
new_version = os.environ['NEW_VERSION']
config['package']['version'] = new_version
with open('bindings/python/Cargo.toml', 'w') as f:
config['project']['version'] = new_version
if 'dynamic' in config['project']:
config['project']['dynamic'] = [v for v in config['project']['dynamic'] if v != 'version']
with open('bindings/python/pyproject.toml', 'w') as f:
toml.dump(config, f)
print(f'Updated version to: {new_version}')
"
Loading