Skip to content

Commit

Permalink
Fix deploy.sh bug
Browse files Browse the repository at this point in the history
  • Loading branch information
KangLin committed Jun 19, 2024
1 parent 7f7e5ea commit eb0b8ca
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,22 @@ set -e

SOURCE_DIR=`pwd`

PRE_TAG=`git tag --sort=-creatordate | head -n 1`

if [ -n "$1" ]; then
VERSION=`git describe --tags`
if [ -z "$VERSION" ]; then
VERSION=` git rev-parse HEAD`
VERSION=`git rev-parse HEAD`
fi

echo "Current version: $VERSION, The version to will be set: $1"

if [ -n "$2" ]; then
MESSAGE="Release $1 $2"
else
MESSAGE="Release $1"
fi

PRE_TAG=`git tag --sort=-taggerdate | head -n 1`
echo "Current version: $VERSION, current tag: $PRE_TAG. The version to will be set tag version: $1 message: $MESSAGE"
echo "Please check the follow list:"
echo " - Test is ok ?"
echo " - Translation is ok ?"
Expand All @@ -20,7 +29,11 @@ if [ -n "$1" ]; then
if [ "$INPUT" != "Y" -a "$INPUT" != "y" ]; then
exit 0
fi
git tag -a $1 -m "Release $1"
git tag -a $1 -m "Release $1 ${MESSAGE}"
else
echo "Usage: $0 release_version [release_message]"
echo " release_version format: [v][0-9].[0-9].[0-9]"
exit -1
fi

VERSION=`git describe --tags`
Expand Down Expand Up @@ -54,6 +67,13 @@ if [ -f ${SOURCE_DIR}/vcpkg.json ]; then
sed -i "s/ \"version-string\":.*\"[0-9]\+\.[0-9]\+\.[0-9]\+\",/ \"version-string\": \"${DEBIAN_VERSION}\",/g" ${SOURCE_DIR}/vcpkg.json
fi

CHANGLOG_TMP=${SOURCE_DIR}/debian/changelog.tmp
CHANGLOG_FILE=${SOURCE_DIR}/debian/changelog
echo "rabbitcommon (${DEBIAN_VERSION}) unstable; urgency=medium" > ${CHANGLOG_FILE}
echo "" >> ${CHANGLOG_FILE}
echo "`git log --pretty=format:' * %s' ${PRE_TAG}..HEAD`" >> ${CHANGLOG_FILE}
echo "" >> ${CHANGLOG_FILE}
echo " -- `git log --pretty=format:'%an <%ae>' HEAD^..HEAD` `date --rfc-email`" >> ${CHANGLOG_FILE}

MAJOR_VERSION=`echo ${DEBIAN_VERSION}|cut -d "." -f 1`
sed -i "s/android:versionCode=.*android/android:versionCode=\"${MAJOR_VERSION}\" android/g" ${SOURCE_DIR}/App/android/AndroidManifest.xml
Expand Down

0 comments on commit eb0b8ca

Please sign in to comment.