Skip to content

Commit

Permalink
Version 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Sneed committed Aug 4, 2021
1 parent 0c3d3fe commit 98d4f4e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Sources/Segment/Version.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
// Use release.sh's automation.

// BREAKING.FEATURE.FIX
internal let __segment_version = "1.0.1"
internal let __segment_version = "1.0.2"
28 changes: 22 additions & 6 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,19 @@ then
exit 1
fi

# check if `gh` tool has auth access.
# command will return non-zero if not auth'd.
authd=$(gh auth status -t)
if [[ $? != 0 ]]; then
echo "ex: $ gh auth login"
exit 1
fi

# check that we're on the `main` branch
branch=$(git rev-parse --abbrev-ref HEAD)
if [ branch != 'main' ]
if [ $branch != 'main' ]
then
echo "The 'main' branch must be the current branch out to make a release."
echo "The 'main' must be the current branch to make a release."
echo "You are currently on: $branch"
exit 1
fi
Expand All @@ -70,8 +78,7 @@ then
fi

newVersion="${1%.*}.$((${1##*.}))"
echo "$version"
echo "$newVersion"
echo "Preparing to release $newVersion..."

vercomp $newVersion $version
case $? in
Expand All @@ -86,12 +93,21 @@ then
exit 1
fi

read -r -p "Are you sure you want to release $newVersion? [y/N] " response
case "$response" in
[yY][eE][sS]|[yY])
;;
*)
exit 1
;;
esac

# get the commits since the last release...
# note: we do this here so the "Version x.x.x" commit doesn't show up in logs.
changelog=git log --pretty=format:"- (%an) %s" $(git describe --tags --abbrev=0 @^)..@
changelog=$(git log --pretty=format:"- (%an) %s" $(git describe --tags --abbrev=0 @^)..@)
tempFile=$(mktemp)
#write changelog to temp file.
echo $changelog >> $tempFile
echo -e "$changelog" >> $tempFile

# update sources/Segment/Version.swift
# - remove last line...
Expand Down

0 comments on commit 98d4f4e

Please sign in to comment.