diff --git a/.travis.yml b/.travis.yml index e376e688..fac3a17f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ env: # Environment variables for packaging - PRODUCT=flameshot #TODO: we should take version from the last tag in git history + build number - - VERSION=0.7.4 + - VERSION=0.7.3-74e563e - RELEASE=1 - ARCH=x86_64 # Dockerfile from https://github.com/flameshotapp/flameshot-docker-images diff --git a/appveyor.yml b/appveyor.yml index 0a863225..a6f10b89 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,7 @@ image: Visual Studio 2015 #TODO: we should take version from the last tag in git history + build number -version: 0.7.4.{build} +version: 0.7.3-74e563e.{build} # Major_Version_Number.Minor_Version_Number.Patch_Number.Build_Number skip_branch_with_pr: true diff --git a/flameshot.pro b/flameshot.pro index 94a731e8..9b7393ef 100644 --- a/flameshot.pro +++ b/flameshot.pro @@ -6,15 +6,17 @@ win32:LIBS += -luser32 -lshell32 -BASE_VERSION = 0.7.4 -TAG_VERSION = "$$system(git --git-dir $$PWD/.git --work-tree $$PWD describe --always --tags)" -isEmpty(TAG_VERSION){ - TAG_VERSION = $$BASE_VERSION - DEFINES += APP_VERSION=\\\"$$BASE_VERSION\\\" -} -else { - DEFINES += APP_VERSION=\\\"$$BASE_VERSION-$$TAG_VERSION\\\" -} +BASE_VERSION = 0.7.3-74e563e +#TAG_VERSION = "$$system(git --git-dir $$PWD/.git --work-tree $$PWD describe --always --tags)" +#isEmpty(TAG_VERSION){ +# TAG_VERSION = $$BASE_VERSION +# DEFINES += APP_VERSION=\\\"$$BASE_VERSION\\\" +#} +#else { +# DEFINES += APP_VERSION=\\\"$$BASE_VERSION-$$TAG_VERSION\\\" +#} + +DEFINES += APP_VERSION=\\\"$$BASE_VERSION\\\" QT += core gui widgets network svg diff --git a/update_release_version.sh b/update_release_version.sh new file mode 100755 index 00000000..439d1d00 --- /dev/null +++ b/update_release_version.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +BASE_VERSION_NEW="0.7.3" + +BASE_VERSION_CUR=$(cat flameshot.pro |grep "[0-9]\+\.[0-9]\+\.[0-9]\+-[0-9a-e]*" |awk "{print \$3}") +GIT_SHORT_HASH=$(git rev-parse --short HEAD) +BASE_VERSION_NEW="${BASE_VERSION_NEW}-${GIT_SHORT_HASH}" + + + +if [ "${BASE_VERSION_CUR}" == "${BASE_VERSION_NEW}" ]; then + echo "Current and new versions are the same, no action required" + exit 1 +fi + + +TAG_EXISTS=$(git ls-remote --tags origin |grep "refs/tags/v${BASE_VERSION_NEW}") +if [ "" != "${TAG_EXISTS}" ]; then + echo "Tag already exists: ${TAG_EXISTS}" + echo "Please update to another version or remove git tag" + exit 1 +fi + +# update version to a new one +sed -i "s/BASE_VERSION = ${BASE_VERSION_CUR}/BASE_VERSION = ${BASE_VERSION_NEW}/g" flameshot.pro +sed -i "s/AppVersion=${BASE_VERSION_CUR}/AppVersion=${BASE_VERSION_NEW}/g" ./win_setup/flameshot.iss +sed -i "s/VersionInfoVersion=${BASE_VERSION_CUR}/VersionInfoVersion=${BASE_VERSION_NEW}/g" ./win_setup/flameshot.iss +sed -i "s/version: ${BASE_VERSION_CUR}/version: ${BASE_VERSION_NEW}/g" appveyor.yml +sed -i "s/VERSION=${BASE_VERSION_CUR}/VERSION=${BASE_VERSION_NEW}/g" .travis.yml + +qmake + +# push current release +git add flameshot.pro ./win_setup/flameshot.iss appveyor.yml .travis.yml +git commit -m "Update version to ${BASE_VERSION_NEW}" +git push + +# add new release tag +git tag "v${BASE_VERSION_NEW}" +git push origin --tags + +echo "New Flameshot version is: ${BASE_VERSION_NEW}" diff --git a/update_version_everywhere.sh b/update_version_everywhere.sh deleted file mode 100755 index cfc4745e..00000000 --- a/update_version_everywhere.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -BASE_VERSION_OLD=0.7.3 -BASE_VERSION_NEW=0.7.4 - -sed -i "s/BASE_VERSION = ${BASE_VERSION_OLD}/BASE_VERSION = ${BASE_VERSION_NEW}/g" flameshot.pro - -sed -i "s/AppVersion=${BASE_VERSION_OLD}/AppVersion=${BASE_VERSION_NEW}/g" ./win_setup/flameshot.iss -sed -i "s/VersionInfoVersion=${BASE_VERSION_OLD}/VersionInfoVersion=${BASE_VERSION_NEW}/g" ./win_setup/flameshot.iss - -sed -i "s/version: ${BASE_VERSION_OLD}/version: ${BASE_VERSION_NEW}/g" appveyor.yml - -sed -i "s/VERSION=${BASE_VERSION_OLD}/VERSION=${BASE_VERSION_NEW}/g" .travis.yml - -qmake diff --git a/win_setup/flameshot.iss b/win_setup/flameshot.iss index 560aeb24..9f531939 100644 --- a/win_setup/flameshot.iss +++ b/win_setup/flameshot.iss @@ -6,9 +6,9 @@ [Setup] AppName=Flameshot -AppVersion=0.7.4 +AppVersion=0.7.3-74e563e AppCopyright=NameCheap inc. -VersionInfoVersion=0.7.4 +VersionInfoVersion=0.7.3-74e563e WizardStyle=modern DefaultDirName={autopf}\Flameshot DefaultGroupName=Flameshot