Skip to content

Commit

Permalink
实现打Release包时versionCode自增
Browse files Browse the repository at this point in the history
Change-Id: Ie970098391d4ed152d9ee05a7f7dab81c7175757
(cherry picked from commit 3f3bbfd)
  • Loading branch information
archurcode committed Nov 2, 2020
1 parent 2e75723 commit fdc5286
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/scripts/updateVersionCodeForRelease.sh
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions .github/workflows/tencent_official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fdc5286

Please sign in to comment.