Add version update script - #4
Conversation
Replit-Commit-Author: Agent Replit-Commit-Session-Id: 79c60e56-af99-4011-a509-f8e82de07405 Replit-Commit-Checkpoint-Type: full_checkpoint
Creates a shell script that prompts for a new version, updates version information across multiple files (CMakeLists.txt, __init__.py, Dockerfile), and creates a corresponding git tag. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 79c60e56-af99-4011-a509-f8e82de07405 Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Create a bash script that prompts the user for a new version number, updates the package.json version, commits the change, and creates a new git tag. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 79c60e56-af99-4011-a509-f8e82de07405 Replit-Commit-Checkpoint-Type: full_checkpoint
Adds a script to automate the version bumping process, including staging changes, committing with a version message, and updating existing scripts. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 79c60e56-af99-4011-a509-f8e82de07405 Replit-Commit-Checkpoint-Type: intermediate_checkpoint
This commit introduces a new script designed to streamline the process of version bumping in conjunction with Git commits, likely for release management. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 79c60e56-af99-4011-a509-f8e82de07405 Replit-Commit-Checkpoint-Type: full_checkpoint
|
Coverage after merging version-update-script into master will be
Coverage Report for Changed Files
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds a comprehensive bash script for automating version updates across the LitePB project and updates the project version from 1.0.0 to 1.0.1 as a demonstration.
- Introduces a new automated version update script with validation and git integration
- Updates project version from 1.0.0 to 1.0.1 across all version files
- Implements cross-platform sed compatibility and user confirmation prompts
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| scripts/update_version.sh | New comprehensive script for automating version updates with validation, file updates, and git operations |
| generator/init.py | Version bump from 1.0.0 to 1.0.1 |
| docker/Dockerfile | Version bump from 1.0.0 to 1.0.1 in container label |
| cmake/CMakeLists.txt | Version bump from 1.0.0 to 1.0.1 in project configuration |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| # Function to extract current version from CMakeLists.txt | ||
| get_current_version() { | ||
| grep 'VERSION' "$CMAKE_FILE" | grep -E '[0-9]+\.[0-9]+\.[0-9]+' | sed -E 's/.*VERSION ([0-9]+\.[0-9]+\.[0-9]+).*/\1/' | head -1 |
There was a problem hiding this comment.
The version extraction pattern is too broad and could extract version numbers from comments or other contexts. It should specifically target the project() VERSION line to ensure accuracy.
| grep 'VERSION' "$CMAKE_FILE" | grep -E '[0-9]+\.[0-9]+\.[0-9]+' | sed -E 's/.*VERSION ([0-9]+\.[0-9]+\.[0-9]+).*/\1/' | head -1 | |
| grep -E '^project\(.*VERSION [0-9]+\.[0-9]+\.[0-9]+' "$CMAKE_FILE" | sed -E 's/.*VERSION ([0-9]+\.[0-9]+\.[0-9]+).*/\1/' | head -1 |
| echo " ✓ Updated $CMAKE_FILE" | ||
|
|
||
| # Update Python __init__.py | ||
| sed "s/__version__ = '${old_version}'/__version__ = '${new_version}'/" "$PYTHON_FILE" > "${PYTHON_FILE}.tmp" && mv "${PYTHON_FILE}.tmp" "$PYTHON_FILE" |
There was a problem hiding this comment.
The sed replacement patterns contain special characters that could cause issues if the version contains regex metacharacters. Consider escaping the version strings or using a more robust replacement method.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Coverage after merging version-update-script into master will be
Coverage Report for Changed Files
|
1 similar comment
|
Coverage after merging version-update-script into master will be
Coverage Report for Changed Files
|
|
Coverage after merging version-update-script into master will be
Coverage Report for Changed Files
|
No description provided.