diff --git a/.github/workflows/build-loaders.yml b/.github/workflows/build-loaders.yml index 9aad953..bf47bc4 100644 --- a/.github/workflows/build-loaders.yml +++ b/.github/workflows/build-loaders.yml @@ -31,7 +31,6 @@ jobs: dotnet-version: | 6.0.x 7.0.x - include-prerelease: false - name: Build Loaders working-directory: "KitX Standard/KitX Loaders" diff --git a/.github/workflows/build-plugins.yml b/.github/workflows/build-plugins.yml index ebd3754..e63674a 100644 --- a/.github/workflows/build-plugins.yml +++ b/.github/workflows/build-plugins.yml @@ -31,7 +31,6 @@ jobs: dotnet-version: | 6.0.x 7.0.x - include-prerelease: false - name: Build Plugins working-directory: "KitX Standard/KitX Plugins" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b28471a..fbaab63 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,7 +35,6 @@ jobs: dotnet-version: | 6.0.x 7.0.x - include-prerelease: false - name: Build Contracts working-directory: "KitX Standard/KitX Contracts" diff --git a/.github/workflows/pr-auto-rename.yml b/.github/workflows/pr-auto-format.yml similarity index 95% rename from .github/workflows/pr-auto-rename.yml rename to .github/workflows/pr-auto-format.yml index 27e2791..d01d0c8 100644 --- a/.github/workflows/pr-auto-rename.yml +++ b/.github/workflows/pr-auto-format.yml @@ -1,4 +1,4 @@ -name: Check Pull Request Title +name: Format Pull Request Title on: pull_request: @@ -28,7 +28,7 @@ jobs: run: | pull_request_number=${{ github.event.pull_request.number }} current_title="${{ github.event.pull_request.title }}" - updated_title=$(python3 "./ToolKits/Actions/pr_auto_rename.py" "$current_title") + updated_title=$(python3 "./ToolKits/Actions/pr_format.py" "$current_title") curl -X PATCH \ -H "Authorization: Bearer ${{ secrets.GITHUBTOKEN }}" \ diff --git a/.github/workflows/publish-packages.yml b/.github/workflows/publish-packages.yml index 7544d0e..ec6e2f6 100644 --- a/.github/workflows/publish-packages.yml +++ b/.github/workflows/publish-packages.yml @@ -12,7 +12,7 @@ jobs: build-on-ubuntu: runs-on: ubuntu-latest environment: Publish Packages - if: "contains(github.event.head_commit.message, '[Publish Packages]')" + if: contains(github.event.head_commit.message, '[Publish Packages]') steps: - uses: actions/checkout@v3 @@ -25,7 +25,6 @@ jobs: dotnet-version: | 6.0.x 7.0.x - include-prerelease: false - name: Add to GitHub Repo run: | diff --git a/.gitignore b/.gitignore index bed1189..59869de 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,11 @@ - -# Ignore for special folders +## Platform Ignore +*.DS_Store + +## Ignore for special folders KitX\ Build/ KitX\ Publish/ -# Ignore for IDE settings +## Ignore for IDE settings .idea/ .vscode/ diff --git a/KitX Clients/KitX Dashboard b/KitX Clients/KitX Dashboard index 99325d8..cdc0d1d 160000 --- a/KitX Clients/KitX Dashboard +++ b/KitX Clients/KitX Dashboard @@ -1 +1 @@ -Subproject commit 99325d8c8cad5cd619a371a0c4cedde33ac423e6 +Subproject commit cdc0d1dc9124ede324d7382065342b44a76541a7 diff --git a/KitX Clients/KitX Installer b/KitX Clients/KitX Installer index 2b92f82..db730f9 160000 --- a/KitX Clients/KitX Installer +++ b/KitX Clients/KitX Installer @@ -1 +1 @@ -Subproject commit 2b92f82037cab9ba919e1e4de9d01a3dc5d77209 +Subproject commit db730f978db7e9bc5df5357b50ecbc3ff628fb4b diff --git a/KitX Clients/KitX Mobile b/KitX Clients/KitX Mobile index e14b392..8eab8ee 160000 --- a/KitX Clients/KitX Mobile +++ b/KitX Clients/KitX Mobile @@ -1 +1 @@ -Subproject commit e14b392ebcb5f67c2de2a21ebb475bad49acc7a6 +Subproject commit 8eab8ee82beeda732c6b8c7a72ffa9fb55c4b11e diff --git a/KitX Clients/KitX Website b/KitX Clients/KitX Website index 73efc8d..6054ba1 160000 --- a/KitX Clients/KitX Website +++ b/KitX Clients/KitX Website @@ -1 +1 @@ -Subproject commit 73efc8d0540015172814d2524078239aa0e3f73d +Subproject commit 6054ba19da4b2d92c38b7417e365ea15a084da1b diff --git a/KitX Docs b/KitX Docs index 0fac064..d2075a1 160000 --- a/KitX Docs +++ b/KitX Docs @@ -1 +1 @@ -Subproject commit 0fac064b67628edee2a491823f94dfc3c097219a +Subproject commit d2075a1916cf4c98960f19d9db15958003daa422 diff --git a/KitX SDK b/KitX SDK index 7077eac..329fb1c 160000 --- a/KitX SDK +++ b/KitX SDK @@ -1 +1 @@ -Subproject commit 7077eac7ed422b76243d6af4a4ea8ef4234fa01b +Subproject commit 329fb1cf9c704fc942db7d01ed535a37a6e75db7 diff --git a/KitX Standard/KitX File Formats b/KitX Standard/KitX File Formats index 50b818a..7c17547 160000 --- a/KitX Standard/KitX File Formats +++ b/KitX Standard/KitX File Formats @@ -1 +1 @@ -Subproject commit 50b818aa22b68c8d456125d27baff891ae283031 +Subproject commit 7c1754756979cf0c288f87dfbd4b7303322334e5 diff --git a/KitX Standard/KitX Rules b/KitX Standard/KitX Rules index 646eb4f..c4c630d 160000 --- a/KitX Standard/KitX Rules +++ b/KitX Standard/KitX Rules @@ -1 +1 @@ -Subproject commit 646eb4f63db1466825c7459be2810e2a1a81d31c +Subproject commit c4c630d069233b829c8dc5d0dec9913d45219f85 diff --git a/KitX.sln b/KitX.sln index f948343..90fa368 100644 --- a/KitX.sln +++ b/KitX.sln @@ -115,6 +115,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KitX.Formats.KXP", "KitX St EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KitX.Dashboard", "KitX Clients\KitX Dashboard\KitX Dashboard\KitX.Dashboard.csproj", "{1DA8715C-E5A1-40CC-9C6C-F39E90A0C3E7}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cheese", "KitX SDK\Cheese\Cheese.csproj", "{9663A503-6B07-4F77-A5F5-CF3DC6C682BC}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -849,6 +851,26 @@ Global {1DA8715C-E5A1-40CC-9C6C-F39E90A0C3E7}.Release|x64.Build.0 = Release|Any CPU {1DA8715C-E5A1-40CC-9C6C-F39E90A0C3E7}.Release|x86.ActiveCfg = Release|Any CPU {1DA8715C-E5A1-40CC-9C6C-F39E90A0C3E7}.Release|x86.Build.0 = Release|Any CPU + {9663A503-6B07-4F77-A5F5-CF3DC6C682BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9663A503-6B07-4F77-A5F5-CF3DC6C682BC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9663A503-6B07-4F77-A5F5-CF3DC6C682BC}.Debug|ARM.ActiveCfg = Debug|Any CPU + {9663A503-6B07-4F77-A5F5-CF3DC6C682BC}.Debug|ARM.Build.0 = Debug|Any CPU + {9663A503-6B07-4F77-A5F5-CF3DC6C682BC}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {9663A503-6B07-4F77-A5F5-CF3DC6C682BC}.Debug|ARM64.Build.0 = Debug|Any CPU + {9663A503-6B07-4F77-A5F5-CF3DC6C682BC}.Debug|x64.ActiveCfg = Debug|Any CPU + {9663A503-6B07-4F77-A5F5-CF3DC6C682BC}.Debug|x64.Build.0 = Debug|Any CPU + {9663A503-6B07-4F77-A5F5-CF3DC6C682BC}.Debug|x86.ActiveCfg = Debug|Any CPU + {9663A503-6B07-4F77-A5F5-CF3DC6C682BC}.Debug|x86.Build.0 = Debug|Any CPU + {9663A503-6B07-4F77-A5F5-CF3DC6C682BC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9663A503-6B07-4F77-A5F5-CF3DC6C682BC}.Release|Any CPU.Build.0 = Release|Any CPU + {9663A503-6B07-4F77-A5F5-CF3DC6C682BC}.Release|ARM.ActiveCfg = Release|Any CPU + {9663A503-6B07-4F77-A5F5-CF3DC6C682BC}.Release|ARM.Build.0 = Release|Any CPU + {9663A503-6B07-4F77-A5F5-CF3DC6C682BC}.Release|ARM64.ActiveCfg = Release|Any CPU + {9663A503-6B07-4F77-A5F5-CF3DC6C682BC}.Release|ARM64.Build.0 = Release|Any CPU + {9663A503-6B07-4F77-A5F5-CF3DC6C682BC}.Release|x64.ActiveCfg = Release|Any CPU + {9663A503-6B07-4F77-A5F5-CF3DC6C682BC}.Release|x64.Build.0 = Release|Any CPU + {9663A503-6B07-4F77-A5F5-CF3DC6C682BC}.Release|x86.ActiveCfg = Release|Any CPU + {9663A503-6B07-4F77-A5F5-CF3DC6C682BC}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -902,6 +924,7 @@ Global {1CA8F49B-F083-47A1-BA93-6C5A4A25938E} = {CC0FBC12-F30C-480E-8FCA-A0382FB4F167} {778C3C4C-E47A-4178-B6AC-D31657E08E7F} = {F1ED9B93-78A6-451D-A925-0F2BC2967FEF} {1DA8715C-E5A1-40CC-9C6C-F39E90A0C3E7} = {0194E969-1457-4C16-AFAB-D2753DFA07F0} + {9663A503-6B07-4F77-A5F5-CF3DC6C682BC} = {69E9C41D-1848-4F9F-8C9C-0CAC1C167336} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {09BBC227-F41B-4D10-9E38-0EEE07ED17BC} diff --git a/README.md b/README.md index 3459eec..d75e2ab 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@

- KitX Logo + KitX Logo

diff --git a/Reference/Common.BasicHelper b/Reference/Common.BasicHelper index cbf1df1..30d09d6 160000 --- a/Reference/Common.BasicHelper +++ b/Reference/Common.BasicHelper @@ -1 +1 @@ -Subproject commit cbf1df16ab8c533a509a7e4a069b990340a8bb03 +Subproject commit 30d09d666e6267567d29afe235afd27822597efb diff --git a/ToolKits/Actions/check_new_commit.py b/ToolKits/Actions/check_new_commit.py index 5aa5769..cd57ed6 100644 --- a/ToolKits/Actions/check_new_commit.py +++ b/ToolKits/Actions/check_new_commit.py @@ -17,9 +17,17 @@ print("Time delta: ", time_difference) +has_new_commit = time_difference > timedelta(days=days_deference) +env_to_add = "HAS_NEW_COMMIT=" + if time_difference > timedelta(days=days_deference): - print("No new commit found. Check in env var: [HAS_NEW_COMMIT].") - os.putenv("HAS_NEW_COMMIT", "false") + print("No new commit found. Check in env var: [env.HAS_NEW_COMMIT].") + env_to_add = env_to_add + 'false' else: - print("New commit found. Check in env var: [HAS_NEW_COMMIT].") - os.putenv("HAS_NEW_COMMIT", "true") + print("New commit found. Check in env var: [env.HAS_NEW_COMMIT].") + env_to_add = env_to_add + 'true' + +command = "echo \"" + env_to_add + "\" >> $env:GITHUB_ENV" + +with open('set_env.ps1', 'w', encoding='utf-8') as file: + file.write(command) diff --git a/ToolKits/Actions/pr_auto_rename.py b/ToolKits/Actions/pr_auto_rename.py deleted file mode 100644 index d1ff0a9..0000000 --- a/ToolKits/Actions/pr_auto_rename.py +++ /dev/null @@ -1,63 +0,0 @@ -# Update the name of PR - -import sys -import re - -left_brackets_cn = ["『", "「", "〔", "【", "(", "《", "〈"] -right_brackets_cn = ["』", "」", "〕", "】", ")", "》", "〉"] - -left_quotation_cn = ["“", "‘"] -right_quotation_cn = ["”", "’"] - -left_brackets_en_replace_to = ["[", "[", "{", "[", "(", "<<", "<"] -right_brackets_en_replace_to = ["]", "]", "}", "]", ")", ">>", ">"] - -left_quotation_en = ['"', "'"] -right_quotation_en = ['"', "'"] - -connection_signs = ["_", "-"] - - -def convert_cn_to_en(title: str): - for i in range(len(left_brackets_cn)): - title = title.replace(left_brackets_cn[i], left_brackets_en_replace_to[i]).replace( - right_brackets_cn[i], right_brackets_en_replace_to[i] - ) - - for i in range(len(left_quotation_cn)): - title = title.replace(left_quotation_cn[i], left_quotation_en[i]).replace( - right_quotation_cn[i], left_quotation_en[i] - ) - - return title - - -def check_and_format(title: str): - """ - Check and update the name of PR. - - Args: - title (str): _description_ - - Returns: - _type_: _description_ - """ - - title = convert_cn_to_en(title.strip()) - - regex_check = ( - r"^(\[?[pP][rR]\]?|\[?[pP][uU][lL][lL][- _]?[rR][eE][qQ][uU][eE][sS][tT]\]?|\[?[pP][uU][lL][lL]\]?) ([^\n]*)$" - ) - - if not title.startswith("[Pull Request]"): - result = re.match(regex_check, title, re.M | re.I) - - if result: - title = "[Pull Request] " + result.group(2) - else: - title = "[Pull Request] " + title - - return title - - -print(check_and_format(sys.argv[1])) diff --git a/ToolKits/Actions/pr_format.py b/ToolKits/Actions/pr_format.py new file mode 100644 index 0000000..f74ed24 --- /dev/null +++ b/ToolKits/Actions/pr_format.py @@ -0,0 +1,61 @@ +""" +Format the pull request title to the standard format. +""" + +import sys +import re + +# Chinese replacement. +replacemap = { + # Brackets. + "(": "(", + ")": ")", + "『": "[", + "』": "]", + "「": "[", + "」": "]", + "【": "[", + "】": "]", + "〔": "{", + "〕": "}", + # Quotation marks. + "‘": "'", + "’": "'", + "“": '"', + "”": '"', + ",": ", ", + "。": ". ", + ";": "; ", + ":": ": ", + "?": "? ", + "!": "! ", + "、": ", ", + "…": "...", + "—": "-", + "·": ".", + "~": "~", +} + + +HEAD = "[Pull Request]" +FORMAT_REGEX = r"^(\[?[pP][rR]\]?|\[?[pP][uU][lL][lL][- _]?[rR][eE][qQ][uU][eE][sS][tT]\]?|\[?[pP][uU][lL][lL]\]?)([^\n]*)$" # pylint: disable=line-too-long + +if __name__ == "__main__": + if len(sys.argv) < 2: + print(f"Usage: python {sys.argv[0]} ") + sys.exit(1) + title = sys.argv[1] + + # Step 1: Convert Chinese to English. + for key, value in replacemap.items(): + title = title.replace(key, value) + + # Step 2: Check and update the name of PR. + if not title.startswith(HEAD): + result = re.match(FORMAT_REGEX, title, re.M | re.I) + if result: + title = f"{HEAD} {result.group(2).strip()}" + else: + title = f"{HEAD} {title.strip()}" + + print(title) diff --git a/commit.template.txt b/commit-template.txt similarity index 63% rename from commit.template.txt rename to commit-template.txt index dcaa3eb..d711c53 100644 --- a/commit.template.txt +++ b/commit-template.txt @@ -1,13 +1,14 @@ - + # <emoji> <types>(<scope>): <subject> # <emoji>: 💾/🔧/📄/🎇/🧩/✅/❌/📝/📦/🐛 # <types>: Feat/Fix/Docs/Style/Refactor/Test/Test/Chore/Struct/Bug # demo: 💾 📝 📦 Feat, Chore, Struct(Scope): issue or changelog +# docs: https://docs.catrol.cn/rules/team/git/#%25E6%258F%2590%25E4%25BA%25A4%25E6%25B6%2588%25E6%2581%25AF%25E8%25A7%2584%25E8%258C%2583 # <body> # <footer> (Breaking Changes) -# Date: -# Author: +# Date: +# Author: