diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile index a99f62f0..2c66fff4 100644 --- a/android/fastlane/Fastfile +++ b/android/fastlane/Fastfile @@ -90,7 +90,7 @@ platform :android do print_log "build flavor for: #{flavor}" build_number = Time.now.strftime("%Y%m%d%H") print_log "BuildNo #{build_number}" - build_version = $current_tag.match(/^v(\d+\.\d+\.\d+)/).captures[0] + build_version = $current_tag.match(/^(sky_)?v(\d+\.\d+\.\d+)/).captures.last print_log "buildVersion #{build_version}" commit_hash = last_git_commit short_hash = commit_hash[:abbreviated_commit_hash] @@ -112,7 +112,7 @@ platform :android do print_log "build flavor for: #{flavor}" build_number = Time.now.strftime("%Y%m%d%H") print_log "BuildNo #{build_number}" - build_version = $current_tag.match(/^v(\d+\.\d+\.\d+)/).captures[0] + build_version = $current_tag.match(/^(sky_)?v(\d+\.\d+\.\d+)/).captures.last print_log "buildVersion #{build_version}" commit_hash = last_git_commit short_hash = commit_hash[:abbreviated_commit_hash] diff --git a/tag_generator.sh b/tag_generator.sh index f83b2c54..35529ba2 100755 --- a/tag_generator.sh +++ b/tag_generator.sh @@ -15,7 +15,9 @@ if [ "$tags_length" -lt 1 ]; then next_tag="v1.0.0" else newest_tag=$(echo "$tags" | head -n 1) - IFS='.' read -r major minor patch <<< "$newest_tag" + # 去除已有的sky_前缀,防止重复 + base_tag=${newest_tag#sky_} + IFS='.' read -r major minor patch <<< "$base_tag" major="${major#v}" compare_json="" if [[ "$1" == "generate_tag" ]];then