Update version calculation.
This commit is contained in:
parent
3fcf1131ac
commit
23aae490df
@ -35,11 +35,15 @@ setSettingWithTitle() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
description=$(git describe --always --dirty --long --match '*-release')
|
case $PLATFORM_NAME in
|
||||||
version=${description%-g*}
|
macosx) platform=mac ;;
|
||||||
release=${version%%-*} build=${version##*-}
|
ios) platform=ios ;;
|
||||||
printf -v version '%s.%d' "$release" "$build"
|
*) ftl 'ERROR: Unknown platform: %s.' "$PLATFORM_NAME"; exit 1 ;;
|
||||||
printf -v commit '%s' "${description##*-g}"
|
esac
|
||||||
|
|
||||||
|
description=$(git describe --always --dirty --long --match "*-$platform-*")
|
||||||
|
version=${description%-g*} build=${version##*-} version=${version%-$build}
|
||||||
|
version=${version//-*-/.} release=${version%%-*} commit=${description##*-g}
|
||||||
|
|
||||||
addPlistWithKey GITDescription string "$description"
|
addPlistWithKey GITDescription string "$description"
|
||||||
setPlistWithKey CFBundleVersion "$(hr "${version%%.*}" 14).${version#*.}"
|
setPlistWithKey CFBundleVersion "$(hr "${version%%.*}" 14).${version#*.}"
|
||||||
@ -55,6 +59,8 @@ if [[ $DEPLOYMENT_LOCATION = YES ]]; then
|
|||||||
passed=1
|
passed=1
|
||||||
[[ $description != *-dirty ]] || \
|
[[ $description != *-dirty ]] || \
|
||||||
{ passed=0; err 'ERROR: Cannot release a dirty version, first commit any changes.'; }
|
{ passed=0; err 'ERROR: Cannot release a dirty version, first commit any changes.'; }
|
||||||
|
[[ $build == 0 ]] || \
|
||||||
|
{ passed=0; err 'ERROR: Commit is not tagged for release, first tag accordingly.'; }
|
||||||
[[ -r "$crashlyticsPlist" && $(PlistBuddy -c "Print :'API Key'" "$crashlyticsPlist" 2>/dev/null) ]] || \
|
[[ -r "$crashlyticsPlist" && $(PlistBuddy -c "Print :'API Key'" "$crashlyticsPlist" 2>/dev/null) ]] || \
|
||||||
{ passed=0; err 'ERROR: Cannot release: Crashlytics API key is missing.'; }
|
{ passed=0; err 'ERROR: Cannot release: Crashlytics API key is missing.'; }
|
||||||
(( passed )) || \
|
(( passed )) || \
|
||||||
|
Loading…
Reference in New Issue
Block a user