Skip to content

Commit d0ce4e5

Browse files
committed
实现打Release包时versionCode自增
Change-Id: Ie970098391d4ed152d9ee05a7f7dab81c7175757 (cherry picked from commit b5510ce)
1 parent 024583e commit d0ce4e5

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh
2+
3+
#当前时间
4+
curTime=$(date +%s)
5+
echo "当前时间---$curTime"
6+
7+
#基准差值
8+
baseTime=$(date -d "2020-10-29 00:00:00" +%s)
9+
timeStamp=$((curTime-baseTime))
10+
echo "基准差值---$timeStamp"
11+
12+
#版本号
13+
buildTime=$((timeStamp/(86400*7)+4))
14+
echo "版本号---$buildTime"
15+
16+
sed -i 's#versionCode: 3#versionCode: '$buildTime'#g' config.gradle

.github/workflows/tencent_official.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
export KEY_ID_OF_SIGN=$IOT_GPG_KEYNAME
4444
export PASSWORD_OF_SIGN=$IOT_GPG_PASSPHRASE
4545
sh .github/scripts/updateValuesForSign.sh
46+
sh .github/scripts/updateVersionCodeForRelease.sh
4647
- name: Adapt build.gradle from debug to release
4748
run: |
4849
sed -i 's#opensource_keystore#tencent_official_keystore#g' app/build.gradle

0 commit comments

Comments
 (0)