action: generate version.txt

give github action the opportunity to generate this file .
If not existed ,  qmake will generate one
This commit is contained in:
xiaoyifang 2022-12-14 10:02:20 +08:00
parent 77aa253222
commit afb5c4f951
2 changed files with 5 additions and 3 deletions

View file

@ -75,8 +75,6 @@ jobs:
previousTag=$(git tag --sort=-creatordate | sed -n 1p |cut -c 2-) previousTag=$(git tag --sort=-creatordate | sed -n 1p |cut -c 2-)
echo "$previousTag">version.txt echo "$previousTag">version.txt
cat version.txt cat version.txt
pwd
ls
# # msvc编译 # # msvc编译
- uses: ilammy/msvc-dev-cmd@v1 - uses: ilammy/msvc-dev-cmd@v1

View file

@ -13,7 +13,11 @@ system(git describe --tags --always --dirty): hasGit=1
GIT_HASH=$$system(git rev-parse --short=8 HEAD ) GIT_HASH=$$system(git rev-parse --short=8 HEAD )
} }
!exists( version.txt ) {
message( "generate version.txt...." )
system(echo $${VERSION}.$${GIT_HASH} on $${_DATE_} > version.txt) system(echo $${VERSION}.$${GIT_HASH} on $${_DATE_} > version.txt)
}
!CONFIG( verbose_build_output ) { !CONFIG( verbose_build_output ) {
!win32|*-msvc* { !win32|*-msvc* {