-
Notifications
You must be signed in to change notification settings - Fork 48
fix: update release pipeline for xcconfig-based version management #39
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
Conversation
- Changed workflow trigger to watch V2er/Config/Version.xcconfig - Updated version detection to read from xcconfig instead of project.pbxproj - Added convenient update-version.sh script for easy version updates - Updated documentation with script usage The release pipeline now properly detects version changes from the centralized xcconfig file.
Code Coverage Report ❌Current coverage: 0% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the release pipeline to use a centralized version management system based on an xcconfig file instead of parsing the Xcode project file directly.
- Updates the GitHub Actions workflow to monitor
Version.xcconfigfor changes and extract version information from it - Adds a convenient shell script for updating versions with both interactive and command-line modes
- Updates documentation to include usage instructions for the new version update script
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| scripts/update-version.sh | New shell script for updating app versions with validation and user confirmation |
| VERSIONING.md | Updated documentation to include the new script usage alongside manual editing instructions |
| .github/workflows/release.yml | Modified workflow to watch xcconfig file and extract versions from it instead of project.pbxproj |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| # Function to update version | ||
| update_version() { | ||
| local new_version=$1 | ||
| local new_build=$2 | ||
|
|
||
| # Update MARKETING_VERSION | ||
| sed -i '' "s/^MARKETING_VERSION = .*/MARKETING_VERSION = $new_version/" "$CONFIG_FILE" | ||
|
|
||
| # Update CURRENT_PROJECT_VERSION | ||
| sed -i '' "s/^CURRENT_PROJECT_VERSION = .*/CURRENT_PROJECT_VERSION = $new_build/" "$CONFIG_FILE" |
Copilot
AI
Sep 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sed commands use unescaped variables in regex patterns, which could break if the version contains special regex characters (like dots or brackets). Consider escaping the variables or using a more robust replacement method.
| # Function to update version | |
| update_version() { | |
| local new_version=$1 | |
| local new_build=$2 | |
| # Update MARKETING_VERSION | |
| sed -i '' "s/^MARKETING_VERSION = .*/MARKETING_VERSION = $new_version/" "$CONFIG_FILE" | |
| # Update CURRENT_PROJECT_VERSION | |
| sed -i '' "s/^CURRENT_PROJECT_VERSION = .*/CURRENT_PROJECT_VERSION = $new_build/" "$CONFIG_FILE" | |
| # Escape replacement string for sed (escapes &, \, and | for use as delimiter) | |
| escape_sed_replacement() { | |
| printf '%s' "$1" | sed -e 's/[&\\/|]/\\&/g' | |
| } | |
| # Function to update version | |
| update_version() { | |
| local new_version=$1 | |
| local new_build=$2 | |
| # Escape replacement strings | |
| local esc_version | |
| local esc_build | |
| esc_version=$(escape_sed_replacement "$new_version") | |
| esc_build=$(escape_sed_replacement "$new_build") | |
| # Update MARKETING_VERSION | |
| sed -i '' "s|^MARKETING_VERSION = .*|MARKETING_VERSION = $esc_version|" "$CONFIG_FILE" | |
| # Update CURRENT_PROJECT_VERSION | |
| sed -i '' "s|^CURRENT_PROJECT_VERSION = .*|CURRENT_PROJECT_VERSION = $esc_build|" "$CONFIG_FILE" |
| # Update MARKETING_VERSION | ||
| sed -i '' "s/^MARKETING_VERSION = .*/MARKETING_VERSION = $new_version/" "$CONFIG_FILE" | ||
|
|
||
| # Update CURRENT_PROJECT_VERSION | ||
| sed -i '' "s/^CURRENT_PROJECT_VERSION = .*/CURRENT_PROJECT_VERSION = $new_build/" "$CONFIG_FILE" |
Copilot
AI
Sep 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sed commands use unescaped variables in regex patterns, which could break if the version contains special regex characters (like dots or brackets). Consider escaping the variables or using a more robust replacement method.
| # Update MARKETING_VERSION | |
| sed -i '' "s/^MARKETING_VERSION = .*/MARKETING_VERSION = $new_version/" "$CONFIG_FILE" | |
| # Update CURRENT_PROJECT_VERSION | |
| sed -i '' "s/^CURRENT_PROJECT_VERSION = .*/CURRENT_PROJECT_VERSION = $new_build/" "$CONFIG_FILE" | |
| # Escape replacement strings for sed | |
| local escaped_version | |
| local escaped_build | |
| escaped_version=$(printf '%s' "$new_version" | sed 's/[&/\]/\\&/g') | |
| escaped_build=$(printf '%s' "$new_build" | sed 's/[&/\]/\\&/g') | |
| # Update MARKETING_VERSION | |
| sed -i '' "s/^MARKETING_VERSION = .*/MARKETING_VERSION = $escaped_version/" "$CONFIG_FILE" | |
| # Update CURRENT_PROJECT_VERSION | |
| sed -i '' "s/^CURRENT_PROJECT_VERSION = .*/CURRENT_PROJECT_VERSION = $escaped_build/" "$CONFIG_FILE" |
| # Usage: ./scripts/update-version.sh [version] [build] | ||
| # Example: ./scripts/update-version.sh 1.1.3 31 | ||
|
|
||
| CONFIG_FILE="V2er/Config/Version.xcconfig" |
Copilot
AI
Sep 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The config file path is hardcoded. Consider making this configurable through an environment variable or command-line argument to improve flexibility and testability.
| CURRENT_VERSION=$(grep '^MARKETING_VERSION = ' "$CONFIG_FILE" | sed 's/.*MARKETING_VERSION = //' | xargs) | ||
| CURRENT_BUILD=$(grep '^CURRENT_PROJECT_VERSION = ' "$CONFIG_FILE" | sed 's/.*CURRENT_PROJECT_VERSION = //' | xargs) |
Copilot
AI
Sep 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script doesn't validate that the config file exists before trying to read from it. If the file is missing, these commands will fail silently and return empty values, leading to confusing behavior.
Summary
Updated release pipeline to work with the new centralized version management in Version.xcconfig
Changes
V2er/Config/Version.xcconfigfor changesscripts/update-version.shfor easy version updatesHow it Works
Version.xcconfigis updated and pushed to main → triggers version checkTesting
🤖 Generated with Claude Code