Create your Gitee Account
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
Clone or download
tag.sh 1.72 KB
Copy Edit Web IDE Raw Blame History
kl222 authored 2019-06-24 12:00 . Add update_linux_appimage.xml
#!/bin/bash
set -e
SOURCE_DIR=`pwd`
if [ -n "$1" ]; then
VERSION=`git describe --tags`
if [ -z "$VERSION" ]; then
VERSION=` git rev-parse HEAD`
fi
echo "Current verion: $VERSION, The version to will be set: $1"
read -t 30 -p "Be sure to input Y, not input N: " INPUT
if [ "$INPUT" != "Y" -a "$INPUT" != "y" ]; then
exit 0
fi
git tag -a $1 -m "Release $1"
fi
VERSION=`git describe --tags`
if [ -z "$VERSION" ]; then
VERSION=`git rev-parse --short HEAD`
fi
sed -i "s/^\!define PRODUCT_VERSION.*/\!define PRODUCT_VERSION \"${VERSION}\"/g" ${SOURCE_DIR}/Install/Install.nsi
APPVERYOR_VERSION="version: '${VERSION}.{build}'"
sed -i "s/^version: '.*{build}'/${APPVERYOR_VERSION}/g" ${SOURCE_DIR}/appveyor.yml
sed -i "s/^\ BUILD_VERSION=.*/\ BUILD_VERSION=\"${VERSION}\"/g" ${SOURCE_DIR}/SerialPortAssistant.pro
sed -i "s/export VERSION=.*/export VERSION=\"${VERSION}\"/g" ${SOURCE_DIR}/ci/build.sh
sed -i "s/export VERSION=.*/export VERSION=\"${VERSION}\"/g" ${SOURCE_DIR}/.travis.yml
#sed -i "s/^\ - export VERSION=.*/\ - export VERSION=\"${VERSION}\"/g" ${SOURCE_DIR}/.travis.yml
sed -i "s/^\Standards-Version:.*/\Standards-Version:\"${VERSION}\"/g" ${SOURCE_DIR}/debian/control
sed -i "s/<VERSION>.*</<VERSION>${VERSION}</g" ${SOURCE_DIR}/Update/update.xml
DEBIAN_VERSION=`echo ${VERSION}|cut -d "v" -f 2`
sed -i "s/[0-9]\+\.[0-9]\+\.[0-9]\+/${DEBIAN_VERSION}/g" ${SOURCE_DIR}/README*.md
sed -i "s/serialportassistant (.*)/serialportassistant (${DEBIAN_VERSION})/g" ${SOURCE_DIR}/debian/changelog
if [ -n "$1" ]; then
git add .
git commit -m "Release $1"
git push
git tag -d $1
git tag -a $1 -m "Release $1"
git push origin :refs/tags/$1
git push origin $1
fi

Comment ( 0 )

Sign in for post a comment