mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-24 04:38:16 +00:00
Checks SemVer and default to force tagging
This commit is contained in:
1 parent
cd8794acce
commit
78a0d4e4e7
2 files changed
+6
-4
No files matched your search
@@ -90,6 +90,8 @@ if [ "$ACTION" = "" ] ; then
|
||||
# Get latest git tag
|
||||
cd "$SRCROOT"
|
||||
latest_git_tag=$(git describe --abbrev=0)
|
||||
# Check semantic versioning
|
||||
[[ $latest_git_tag =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$ ]] && echo "Tag $latest_git_tag follows semantic versioning" || echo "WARNING: Tag $latest_git_tag does not follow semantic versioning! SPM will not be able to resolve the repository"
|
||||
# Generate new Package manifest
|
||||
cd "$CONFIGURATION_BUILD_DIR"
|
||||
cp "$SRCROOT/Package.swift" "$CONFIGURATION_BUILD_DIR"
|
||||
|
||||
@@ -10,9 +10,11 @@ if [ "$commits_since_tag" -gt 0 ]; then
|
||||
echo "Package.swift has not been committed and tag has not been moved."
|
||||
else
|
||||
# TODO: add sanity check to see if version is actually being updated or not?
|
||||
read -p "Do you want to commit changes to Package.swift and force move tag '$latest_git_tag'? (required for SPM release) [y/N]" -n 1 -r
|
||||
read -p "Do you want to commit changes to Package.swift and force move tag '$latest_git_tag'? (required for SPM release) [Y/n]" -n 1 -r
|
||||
echo # (optional) move to a new line
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
if [[ $REPLY =~ ^[Nn]$ ]]; then
|
||||
echo "Package.swift has not been committed and tag has not been moved."
|
||||
else
|
||||
long_message=$(git tag -n99 -l $latest_git_tag) # gets corresponding message
|
||||
long_message=${long_message/$latest_git_tag} # trims tag name
|
||||
long_message="$(echo -e "${long_message}" | sed -e 's/^[[:space:]]*//')" # trim leading whitespace
|
||||
@@ -20,7 +22,5 @@ else
|
||||
git commit -m "Update Package.swift"
|
||||
git tag -fa $latest_git_tag -m "${long_message}"
|
||||
echo "Package.swift committed and tag '$latest_git_tag' moved."
|
||||
else
|
||||
echo "Package.swift has not been committed and tag has not been moved."
|
||||
fi
|
||||
fi
|
||||
Reference in new issue
Block a user