Skip to content

Conversation

@graycreate
Copy link
Member

Summary

Updated release pipeline to work with the new centralized version management in Version.xcconfig

Changes

  1. Updated workflow trigger - Now watches V2er/Config/Version.xcconfig for changes
  2. Fixed version detection - Reads versions from xcconfig instead of project.pbxproj
  3. Added update script - scripts/update-version.sh for easy version updates
  4. Updated documentation - Added script usage instructions

How it Works

  1. When Version.xcconfig is updated and pushed to main → triggers version check
  2. Version check creates a new tag if it doesn't exist → triggers build
  3. Build job uploads to TestFlight

Testing

  • Tested update script successfully updates versions
  • Workflow correctly reads versions from xcconfig file
  • Manual tag creation still triggers the build pipeline

🤖 Generated with Claude Code

- 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.
Copilot AI review requested due to automatic review settings September 22, 2025 16:08
@graycreate graycreate merged commit d0671e5 into main Sep 22, 2025
6 checks passed
@graycreate graycreate deleted the bugfix/update-pipeline-for-xcconfig branch September 22, 2025 16:09
@github-actions
Copy link

Code Coverage Report ❌

Current coverage: 0%

Copy link

Copilot AI left a 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.xcconfig for 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.

Comment on lines +22 to +31
# 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"
Copy link

Copilot AI Sep 22, 2025

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.

Suggested change
# 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"

Copilot uses AI. Check for mistakes.
Comment on lines +27 to +31
# 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"
Copy link

Copilot AI Sep 22, 2025

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.

Suggested change
# 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"

Copilot uses AI. Check for mistakes.
# Usage: ./scripts/update-version.sh [version] [build]
# Example: ./scripts/update-version.sh 1.1.3 31

CONFIG_FILE="V2er/Config/Version.xcconfig"
Copy link

Copilot AI Sep 22, 2025

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.

Copilot uses AI. Check for mistakes.
Comment on lines +17 to +18
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)
Copy link

Copilot AI Sep 22, 2025

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants