From afb5c4f95197bf3d483c3dbe587ef000d60301bf Mon Sep 17 00:00:00 2001 From: xiaoyifang Date: Wed, 14 Dec 2022 10:02:20 +0800 Subject: [PATCH] action: generate version.txt give github action the opportunity to generate this file . If not existed , qmake will generate one --- .github/workflows/windows-6.x-xapian.yml | 2 -- goldendict.pro | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/windows-6.x-xapian.yml b/.github/workflows/windows-6.x-xapian.yml index 73ee62d7..cfd839a5 100644 --- a/.github/workflows/windows-6.x-xapian.yml +++ b/.github/workflows/windows-6.x-xapian.yml @@ -75,8 +75,6 @@ jobs: previousTag=$(git tag --sort=-creatordate | sed -n 1p |cut -c 2-) echo "$previousTag">version.txt cat version.txt - pwd - ls # # msvc编译 - uses: ilammy/msvc-dev-cmd@v1 diff --git a/goldendict.pro b/goldendict.pro index a7018b4f..cdf3ba9a 100644 --- a/goldendict.pro +++ b/goldendict.pro @@ -13,7 +13,11 @@ system(git describe --tags --always --dirty): hasGit=1 GIT_HASH=$$system(git rev-parse --short=8 HEAD ) } -system(echo $${VERSION}.$${GIT_HASH} on $${_DATE_} > version.txt) +!exists( version.txt ) { + message( "generate version.txt...." ) + system(echo $${VERSION}.$${GIT_HASH} on $${_DATE_} > version.txt) +} + !CONFIG( verbose_build_output ) { !win32|*-msvc* {