From 7bedfbf107216969b0a8fd28711ea2d40de31bd2 Mon Sep 17 00:00:00 2001 From: Starfire-Win Date: Mon, 10 Jun 2024 15:07:03 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E2=9C=A8=20up=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/README.md | 6 +++--- .github/README_EN.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/README.md b/.github/README.md index 1166aa0..9bf5cf5 100644 --- a/.github/README.md +++ b/.github/README.md @@ -7,13 +7,13 @@

English | 简体中文

- + - + - + diff --git a/.github/README_EN.md b/.github/README_EN.md index 8404b7c..5505a9d 100644 --- a/.github/README_EN.md +++ b/.github/README_EN.md @@ -7,13 +7,13 @@

简体中文 | English

- + - + - + From d9a4a7be4f8fb6d130865d024bab45b6d2d51be4 Mon Sep 17 00:00:00 2001 From: Starfire-Win Date: Mon, 10 Jun 2024 15:13:06 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E2=9C=A8=20up=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/README.md | 2 +- .github/README_EN.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/README.md b/.github/README.md index 9bf5cf5..a643d32 100644 --- a/.github/README.md +++ b/.github/README.md @@ -108,7 +108,7 @@ Runner.StartCoroutine(mono, T1(), T2()); Runner.StopCoroutine(Test); Runner.StopCoroutine(mono);``` Runner.StopCoroutine(mono, Test); -Runner.StopCoroutine(Test());

Task

+Runner.StopCoroutine(Test()); ```

开启协程

diff --git a/.github/README_EN.md b/.github/README_EN.md index 5505a9d..696c379 100644 --- a/.github/README_EN.md +++ b/.github/README_EN.md @@ -108,7 +108,7 @@ Runner.StartCoroutine(mono, T1(), T2()); Runner.StopCoroutine(Test); Runner.StopCoroutine(mono);``` Runner.StopCoroutine(mono, Test); -Runner.StopCoroutine(Test());

Task

+Runner.StopCoroutine(Test()); ```

Start Task

From e4b166bca6a27be1c2d43c1ab27ceaf59658b4f8 Mon Sep 17 00:00:00 2001 From: Starfire-Win Date: Mon, 10 Jun 2024 15:46:03 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E2=9C=A8=20up=20version=20py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/upversion.py | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/.github/upversion.py b/.github/upversion.py index 3d66ea6..1cf8dfc 100644 --- a/.github/upversion.py +++ b/.github/upversion.py @@ -89,9 +89,22 @@ def read_current_branch() -> str: # 判断当前分支 return branch.replace("* ", "") -def read_current_version() -> str: +def read_local_username() -> str: + result = subprocess.run(['git', 'config', 'user.name'], stdout=subprocess.PIPE) + return result.stdout.decode('utf-8').strip() + + +def read_local_email() -> str: + result = subprocess.run(['git', 'config', 'user.email'], stdout=subprocess.PIPE) + return result.stdout.decode('utf-8').strip() + + +def read_current_version() -> str | None: subprocess.run(['git', 'fetch', '--tags'], check=True) tags = os.popen("git tag").read().split("\n") + # 需要判断是否有标签列表 + if len(tags) == 0: + return None # 所有标签去掉空字符串 -preview标签去掉preview 然后按照version排序 1.2.3-preview -> 1.3.0-preview tags = sorted([tag.replace("-preview", "") for tag in tags if tag], key=lambda x: list(map(int, x.split(".")))) return tags[-1] @@ -102,8 +115,8 @@ def read_current_version() -> str: current_path = os.getcwd() print("当前路径: " + current_path) -username = "Star fire" -email = "xinansky99@gmail.com" +username = read_local_username() +email = read_local_email() print("用户名称: " + username) print("用户邮箱: " + email) @@ -137,14 +150,18 @@ def read_current_version() -> str: step_function() version = read_current_version() # 读取当前版本号 -print("当前版本号: " + version) -# 递增版本号 -version_list = version.split(".") -if is_preview: - version_list[2] = str(int(version_list[2]) + 1) + "-preview" +if version is None: + version = "1.0.0" + new_version = "1.0.0" else: - version_list[2] = str(int(version_list[2]) + 1) -new_version = ".".join(version_list) + # 递增版本号 + version_list = version.split(".") + if is_preview: + version_list[2] = str(int(version_list[2]) + 1) + "-preview" + else: + version_list[2] = str(int(version_list[2]) + 1) + new_version = ".".join(version_list) +print("版本号: {0} -> {1}".format(version, new_version)) # 写入新版本号 with open("package.json", "r+") as f: From 2875166bcb82c14d1d586dee135799fa1225b93d Mon Sep 17 00:00:00 2001 From: Starfire-Win Date: Mon, 10 Jun 2024 15:48:19 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E2=9C=A8=20up=20version=201.x=20->=201.0.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d22f188..18e5869 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "com.aio.runner", "displayName": "AIO Unity Runner", "description": "AIO Unity Runner is a Unity package that provides a simple and efficient timer system for Unity.", - "version": "1.0.0-preview", + "version": "1.0.0", "unity": "2019.4", "category": "Runtime", "unityRelease": "0f1", @@ -25,5 +25,6 @@ "name": "AIO GAME", "url": "https://github.com/AIO-GAME/Unity.Runner" }, - "type": "library" + "type": "module" +}brary" } \ No newline at end of file From cdf199b19dce88c41f448bd853de934c15d6b478 Mon Sep 17 00:00:00 2001 From: Starfire-Win Date: Mon, 10 Jun 2024 15:49:41 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E2=9C=A8=20=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/upversion.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/upversion.py b/.github/upversion.py index 1cf8dfc..4ba3eff 100644 --- a/.github/upversion.py +++ b/.github/upversion.py @@ -100,14 +100,16 @@ def read_local_email() -> str: def read_current_version() -> str | None: - subprocess.run(['git', 'fetch', '--tags'], check=True) - tags = os.popen("git tag").read().split("\n") - # 需要判断是否有标签列表 - if len(tags) == 0: + try: + subprocess.run(['git', 'fetch', '--tags'], check=True) + tags = os.popen("git tag").read().split("\n") + if len(tags) == 0: # 需要判断是否有标签列表 + return None + # 所有标签去掉空字符串 -preview标签去掉preview 然后按照version排序 1.2.3-preview -> 1.3.0-preview + tags = sorted([tag.replace("-preview", "") for tag in tags if tag], key=lambda x: list(map(int, x.split(".")))) + return tags[-1] + except Exception: return None - # 所有标签去掉空字符串 -preview标签去掉preview 然后按照version排序 1.2.3-preview -> 1.3.0-preview - tags = sorted([tag.replace("-preview", "") for tag in tags if tag], key=lambda x: list(map(int, x.split(".")))) - return tags[-1] # 切换上一级目录 @@ -151,7 +153,7 @@ def read_current_version() -> str | None: version = read_current_version() # 读取当前版本号 if version is None: - version = "1.0.0" + version = "1.0.0" + ("-preview" if is_preview else "") new_version = "1.0.0" else: # 递增版本号 From 7071a72ae82415a67101de38f94bc9f1a20b80de Mon Sep 17 00:00:00 2001 From: Starfire-Win Date: Mon, 10 Jun 2024 15:54:33 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E2=9C=A8=20=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 18e5869..7f05b7f 100644 --- a/package.json +++ b/package.json @@ -26,5 +26,4 @@ "url": "https://github.com/AIO-GAME/Unity.Runner" }, "type": "module" -}brary" } \ No newline at end of file From e0ca847c45308cf2559a6922e275601dfc781401 Mon Sep 17 00:00:00 2001 From: Starfire-Win Date: Mon, 10 Jun 2024 15:57:12 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E2=9C=A8=20=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/upversion.py | 11 +++++++++-- package.json | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/upversion.py b/.github/upversion.py index 4ba3eff..b1fa572 100644 --- a/.github/upversion.py +++ b/.github/upversion.py @@ -154,7 +154,7 @@ def read_current_version() -> str | None: version = read_current_version() # 读取当前版本号 if version is None: version = "1.0.0" + ("-preview" if is_preview else "") - new_version = "1.0.0" + new_version = "1.0.0" + ("-preview" if is_preview else "") else: # 递增版本号 version_list = version.split(".") @@ -170,7 +170,6 @@ def read_current_version() -> str | None: package = json.load(f) current_version = package["version"] package["version"] = new_version - package["type"] = "module" f.seek(0) json.dump(package, f, indent=2) print("写入配置: 版本号 {0} -> {1}".format(current_version, new_version)) @@ -241,6 +240,14 @@ def read_current_version() -> str | None: else: print("删除成功") +# 写入新版本号 +with open("package.json", "r+") as f: + package = json.load(f) + package["type"] = "module" + f.seek(0) + json.dump(package, f, indent=2) + f.close() + steps = [ ("删除标签", lambda: delete_remote_tag()), ("设置用户名", diff --git a/package.json b/package.json index 7f05b7f..18e98bc 100644 --- a/package.json +++ b/package.json @@ -25,5 +25,5 @@ "name": "AIO GAME", "url": "https://github.com/AIO-GAME/Unity.Runner" }, - "type": "module" + "type": "library" } \ No newline at end of file From 4d27ac9719d6acc753aad9e47dc058ffc842210e Mon Sep 17 00:00:00 2001 From: Starfire-Win Date: Mon, 10 Jun 2024 15:57:31 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E2=9C=A8=20up=20version=201.x=20->=201.0.0?= =?UTF-8?q?-preview?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 18e98bc..d22f188 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "com.aio.runner", "displayName": "AIO Unity Runner", "description": "AIO Unity Runner is a Unity package that provides a simple and efficient timer system for Unity.", - "version": "1.0.0", + "version": "1.0.0-preview", "unity": "2019.4", "category": "Runtime", "unityRelease": "0f1", From dcae9b5aaf655e15be7f3dca7e02314ca832035f Mon Sep 17 00:00:00 2001 From: Starfire-Win Date: Mon, 10 Jun 2024 23:21:08 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E2=9C=A8=20update?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/upversion.py | 8 +++----- package.json | 6 +++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/upversion.py b/.github/upversion.py index b1fa572..0d9f2a9 100644 --- a/.github/upversion.py +++ b/.github/upversion.py @@ -1,12 +1,11 @@ -import shutil -import time import json import os +import shutil import subprocess -from typing import Any +import time -from tqdm import tqdm import requests +from tqdm import tqdm def get_latest_github_tag(repo_url) -> str | None: @@ -70,7 +69,6 @@ def remove_readonly(func, path, _) -> None: func(path) -# 删除文件夹 def delete_folder(folder_path) -> None: try: if os.path.exists(folder_path): diff --git a/package.json b/package.json index d22f188..337151c 100644 --- a/package.json +++ b/package.json @@ -21,9 +21,9 @@ "coroutine", "task" ], + "type": "module", "author": { "name": "AIO GAME", - "url": "https://github.com/AIO-GAME/Unity.Runner" - }, - "type": "library" + "url": "https://github.com/AIO-GAME" + } } \ No newline at end of file