diff --git a/.github/scripts/updateVersionCodeForRelease.sh b/.github/scripts/updateVersionCodeForRelease.sh new file mode 100644 index 000000000..6aebbb283 --- /dev/null +++ b/.github/scripts/updateVersionCodeForRelease.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +#当前时间 +curTime=$(date +%s) +echo "当前时间---$curTime" + +#基准差值 +baseTime=$(date -d "2020-10-29 00:00:00" +%s) +timeStamp=$((curTime-baseTime)) +echo "基准差值---$timeStamp" + +#版本号 +buildTime=$((timeStamp/(86400*7)+4)) +echo "版本号---$buildTime" + +sed -i 's#versionCode: 3#versionCode: '$buildTime'#g' config.gradle \ No newline at end of file diff --git a/.github/workflows/tencent_official.yml b/.github/workflows/tencent_official.yml index 7d4c12355..6a07b594c 100644 --- a/.github/workflows/tencent_official.yml +++ b/.github/workflows/tencent_official.yml @@ -43,6 +43,7 @@ jobs: export KEY_ID_OF_SIGN=$IOT_GPG_KEYNAME export PASSWORD_OF_SIGN=$IOT_GPG_PASSPHRASE sh .github/scripts/updateValuesForSign.sh + sh .github/scripts/updateVersionCodeForRelease.sh - name: Adapt build.gradle from debug to release run: | sed -i 's#opensource_keystore#tencent_official_keystore#g' app/build.gradle