Skip to content

Commit 14525b1

Browse files
committed
AUTO VERSION UPDATE
1 parent 8e7e1ee commit 14525b1

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import os
2+
import json, requests, re
3+
4+
GITHUB_ENV_PATH = os.getenv("GITHUB_ENV")
5+
6+
API_ENDPOINT="https://api.github.com/repos/RandomCoderOrg/udroid-download/releases"
7+
8+
headers = {
9+
"Content-Type": "application/x-www-form-urlencoded"
10+
}
11+
12+
resp = requests.get(API_ENDPOINT, headers=headers)
13+
Json_data = json.loads(resp.text)
14+
15+
16+
17+
BUILD_TYPE="AB"
18+
19+
# Geting the latest release tag name
20+
lR = Json_data[0]['tag_name']
21+
pattern = re.compile(r'V(\d+)(\D+)(\d+)')
22+
match = pattern.findall(lR)
23+
udroid_version, RELEASE_TYPE, udroid_download = match[0]
24+
udroid_download = int(udroid_download) + 1
25+
26+
# Latest_release_tag = f"V{udroid_version}{RELEASE_TYPE}{udroid_download}"
27+
Latest_release_tag = "V%s%s%s%s" % (udroid_version,BUILD_TYPE,RELEASE_TYPE,udroid_download)
28+
29+
with open(GITHUB_ENV_PATH, "a+") as f:
30+
f.write(Latest_release_tag)

0 commit comments

Comments
 (0)