mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
22 lines
735 B
Python
22 lines
735 B
Python
import os
|
|
import git
|
|
from release_helper import *
|
|
|
|
repo = git.Repo(REPO_PATH)
|
|
commit_head = repo.head.commit.hexsha
|
|
pkgReleases = PackageReleaseList(PACKAGE_RELEASE_PATH)
|
|
|
|
# for each folder in package, run the following command
|
|
for folder in os.listdir(PACKAGE_PATH):
|
|
if os.path.isdir(PACKAGE_PATH + "/" + folder):
|
|
# check git diff
|
|
diff = repo.git.diff("HEAD", pkgReleases.latestCommit(folder), WORK_DIR +
|
|
"/" + PACKAGE_PATH + "/" + folder)
|
|
if diff != '':
|
|
newVersion = pkgReleases.versionRelease(
|
|
folder, VersoinType.PATCH, commit_head)
|
|
print(f"Changes detected: {folder} --> {newVersion}")
|
|
|
|
pkgReleases.dump(PACKAGE_RELEASE_PATH)
|
|
exit()
|