diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c5351d5..70239db 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,7 +9,7 @@ jobs: build: permissions: contents: write - runs-on: windows-2019 + runs-on: windows-latest steps: - name: Check out git repository uses: actions/checkout@v4 @@ -76,6 +76,20 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Gitee Release + uses: nicennnnnnnlee/action-gitee-release@v1.0.5 + with: + gitee_owner: ikun0014 + gitee_repo: Onekey + gitee_token: ${{ secrets.GITEE_TOKEN }} + gitee_tag_name: v${{ env.PACKAGE_VERSION }} + gitee_release_name: v${{ env.PACKAGE_VERSION }} + gitee_release_body: I don't know + gitee_target_commitish: main + gitee_upload_retry_times: 3 + gitee_file_name: Onekey---v${{ env.PACKAGE_VERSION }}.exe + gitee_file_path: build/Onekey---v${{ env.PACKAGE_VERSION }}.exe + - name: Upload to Telegram Channel run: | & curl -F "chat_id=${{ secrets.TELEGRAM_TO }}" ` diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml new file mode 100644 index 0000000..a4149e4 --- /dev/null +++ b/.github/workflows/sync.yml @@ -0,0 +1,25 @@ +name: Sync to Gitee + +on: + push: + branches: + - main + +jobs: + sync: + permissions: + contents: write + runs-on: windows-latest + steps: + - name: Sync to Gitee + uses: Yikun/hub-mirror-action@master + with: + src: github/ikunshare + dst: gitee/ikun0014 + dst_key: ${{ secrets.GITEE_PRIVATE_KEY }} + dst_token: ${{ secrets.GITEE_TOKEN }} + src_account_type: org + dst_account_type: user + white_list: "Onekey" + force_update: true + debug: true \ No newline at end of file diff --git a/README.md b/README.md index fdbc137..bc97aaa 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Onekey Steam Depot Manifest Downloader ## 开发 本程序使用Python编程语言开发 -要求环境: +要求环境: 1.Python 3.10及以上 2.Windows 10及以上 3.使用Git进行版本管理 @@ -39,7 +39,7 @@ pip install -r requirements.txt ## 项目协议 本项目基于 GPL-3.0 许可证发行,以下协议是对于 GPL-3.0 原协议的补充,如有冲突,以以下协议为准。 - 词语约定:“使用者”指签署本协议的使用者;“版权数据”指包括但不限于图像、音频、名字等在内的他人拥有所属版权的数据。 + 词语约定: “使用者”指签署本协议的使用者;“版权数据”指包括但不限于图像、音频、名字等在内的他人拥有所属版权的数据。 本项目的数据来源原理是从Steam官方的CDN服务器中拉取游戏清单数据,经过对数据简单地筛选与合并后进行展示,因此本项目不对数据的准确性负责。 使用本项目的过程中可能会产生版权数据,对于这些版权数据,本项目不拥有它们的所有权,为了避免造成侵权,使用者务必在24 小时内清除使用本项目的过程中所产生的版权数据。 @@ -65,6 +65,6 @@ pip install -r requirements.txt 查看 [FAQ](https://ikunshare.com/d/49) 获取常见问题的解答。 ## 社区和支持 -加入我们的社区,参与讨论和支持: +加入我们的社区,参与讨论和支持: - [GitHub Discussions](https://github.com/ikunshare/Onekey/discussions) - [Telegram](https://t.me/ikunshare_qun) diff --git a/common/check.py b/common/check.py index f0dde9b..5b2003a 100644 --- a/common/check.py +++ b/common/check.py @@ -28,9 +28,9 @@ async def check_github_api_rate_limit(headers, session): log.error('Github请求数检查失败, 网络错误') except KeyboardInterrupt: - log.info("\n 程序已退出") + log.info("程序已退出") except ClientError as e: - log.error(f'检查Github API 请求数失败,{stack_error(e)}') + log.error(f'检查Github API 请求数失败, {stack_error(e)}') except ConnectionTimeoutError as e: log.error(f'检查Github API 请求数超时: {stack_error(e)}') except Exception as e: diff --git a/common/checkcn.py b/common/checkcn.py index 2990d5f..b364983 100644 --- a/common/checkcn.py +++ b/common/checkcn.py @@ -20,7 +20,7 @@ async def checkcn(client) -> bool: return True except KeyboardInterrupt: - log.info("\n 程序已退出") + log.info("程序已退出") except aiohttp.ClientError as e: os.environ['IS_CN'] = 'yes' log.warning('检查服务器位置失败,已忽略,自动认为你在中国大陆') diff --git a/common/config.py b/common/config.py index bbf8496..5856ba4 100644 --- a/common/config.py +++ b/common/config.py @@ -9,7 +9,7 @@ from .log import log DEFAULT_CONFIG = { "Github_Personal_Token": "", "Custom_Steam_Path": "", - "QA1": "温馨提示:Github_Personal_Token可在Github设置的最底下开发者选项找到,详情看教程", + "QA1": "温馨提示: Github_Personal_Token可在Github设置的最底下开发者选项找到,详情看教程", "教程": "https://ikunshare.com/Onekey_tutorial" } @@ -19,9 +19,9 @@ async def gen_config_file(): async with aiofiles.open("./config.json", mode="w", encoding="utf-8") as f: await f.write(json.dumps(DEFAULT_CONFIG, indent=2, ensure_ascii=False, escape_forward_slashes=False)) - log.info('🖱️ 程序可能为第一次启动或配置重置,请填写配置文件后重新启动程序') + log.info('程序可能为第一次启动或配置重置,请填写配置文件后重新启动程序') except KeyboardInterrupt: - log.info("\n 程序已退出") + log.info("程序已退出") except Exception as e: log.error(f'配置文件生成失败,{stack_error(e)}') @@ -37,7 +37,7 @@ async def load_config(): config = json.loads(await f.read()) return config except KeyboardInterrupt: - log.info("\n 程序已退出") + log.info("程序已退出") except Exception as e: log.error(f"配置文件加载失败,原因: {stack_error(e)},重置配置文件中...") os.remove("./config.json") diff --git a/common/dkey_merge.py b/common/dkey_merge.py index f9889dd..9f6ce5a 100644 --- a/common/dkey_merge.py +++ b/common/dkey_merge.py @@ -37,7 +37,7 @@ async def depotkey_merge(config_path: Path, depots_config: dict) -> bool: return True except KeyboardInterrupt: - log.info("\n 程序已退出") + log.info("程序已退出") except Exception as e: async with lock: log.error(f'合并失败, 原因: {e}') diff --git a/common/dl.py b/common/dl.py index 4e42677..dd0877a 100644 --- a/common/dl.py +++ b/common/dl.py @@ -41,7 +41,7 @@ async def get(sha: str, path: str, repo: str, session, chunk_size: int = 1024) - else: log.error(f'获取失败: {path} - 状态码: {response.status}') except KeyboardInterrupt: - log.info("\n 程序已退出") + log.info("程序已退出") except ClientError as e: log.error(f'获取失败: {path} - 连接错误: {str(e)}') except ConnectionTimeoutError as e: diff --git a/common/get_manifest_info.py b/common/get_manifest_info.py index 783bf19..4bb173a 100644 --- a/common/get_manifest_info.py +++ b/common/get_manifest_info.py @@ -37,7 +37,7 @@ async def get_manifest(sha: str, path: str, steam_path: Path, repo: str, session ] except KeyboardInterrupt: - log.info("\n 程序已退出") + log.info("程序已退出") except Exception as e: log.error(f'处理失败: {path} - {stack_error(e)}') raise diff --git a/common/get_steam_path.py b/common/get_steam_path.py index 56707f8..374f96a 100644 --- a/common/get_steam_path.py +++ b/common/get_steam_path.py @@ -14,7 +14,7 @@ def get_steam_path() -> Path: custom_steam_path = config.get("Custom_Steam_Path", "").strip() return Path(custom_steam_path) if custom_steam_path else steam_path except KeyboardInterrupt: - log.info("\n 程序已退出") + log.info("程序已退出") except Exception as e: log.error(f'Steam路径获取失败, {stack_error(e)}, 请检查是否正确安装Steam') os.system('pause') diff --git a/common/init_text.py b/common/init_text.py index fac7500..ba5ffdd 100644 --- a/common/init_text.py +++ b/common/init_text.py @@ -14,8 +14,8 @@ def init(): log.info(f'作者: ikun0014') log.warning(f'本项目采用GNU General Public License v3开源许可证,请勿用于商业用途') - log.info(f'版本: 1.3.2') - log.info(f'项目Github仓库: https://github.com/ikunshare/Onekey') + log.info(f'版本: 1.3.3') + log.info(f'项目Github仓库: https://github.com/ikunshare/Onekey \n Gitee: https://gitee.com/ikun0014/Onekey') log.info(f'官网: ikunshare.com') log.warning( f'本项目完全开源免费, 如果你在淘宝, QQ群内通过购买方式获得, 赶紧回去骂商家死全家\n 交流群组:\n https://t.me/ikunshare_qun') diff --git a/common/main_func.py b/common/main_func.py index 73fa56f..8e52122 100644 --- a/common/main_func.py +++ b/common/main_func.py @@ -23,7 +23,7 @@ async def fetch_branch_info(session, url, headers) -> str | None: async with session.get(url, headers=headers, ssl=False) as response: return await response.json() except KeyboardInterrupt: - log.info("\n 程序已退出") + log.info("程序已退出") except Exception as e: log.error(f'获取信息失败: {stack_error(e)}') return None @@ -88,7 +88,7 @@ async def main(app_id: str, repos: list) -> bool: if isSteamTools: await migrate(st_use=True, session=session) await stool_add(collected_depots, app_id) - log.info('找到SteamTools,已添加解锁文件') + log.info('找到SteamTools, 已添加解锁文件') if isGreenLuma: await migrate(st_use=False, session=session) @@ -97,9 +97,9 @@ async def main(app_id: str, repos: list) -> bool: 'DecryptionKey': depot_key} for depot_id, depot_key in collected_depots}} await depotkey_merge(steam_path / 'config' / 'config.vdf', depot_config) if await greenluma_add([int(i) for i in depot_config['depots'] if i.isdecimal()]): - log.info('找到GreenLuma,已添加解锁文件') + log.info('找到GreenLuma, 已添加解锁文件') - log.info(f'清单最后更新时间:{latest_date}') + log.info(f'清单最后更新时间: {latest_date}') log.info(f'入库成功: {app_id}') os.system('pause') return True diff --git a/common/migration.py b/common/migration.py index 7be797d..8cffe69 100644 --- a/common/migration.py +++ b/common/migration.py @@ -38,7 +38,7 @@ async def download_setup_file(session) -> None: else: log.error('网络错误,无法下载安装程序') except KeyboardInterrupt: - log.info("\n 程序已退出") + log.info("程序已退出") except Exception as e: log.error(f'下载失败: {e}') except ConnectionTimeoutError as e: diff --git a/common/unlock.py b/common/unlock.py index bb8ac2e..f0d953b 100644 --- a/common/unlock.py +++ b/common/unlock.py @@ -32,14 +32,14 @@ async def stool_add(depot_data: list, app_id: str) -> bool: log.info('处理完成') except KeyboardInterrupt: - log.info("\n 程序已退出") + log.info("程序已退出") except Exception as e: log.error(f'处理过程出现错误: {e}') return False finally: if lua_filepath.exists(): os.remove(lua_filepath) - log.info(f'🗑️ 删除临时文件: {lua_filepath}') + log.info(f'删除临时文件: {lua_filepath}') return True diff --git a/main.py b/main.py index 88386d4..5f902e0 100644 --- a/main.py +++ b/main.py @@ -41,7 +41,7 @@ async def main_loop(): app_id = prompt_app_id() await main(app_id, repos) except KeyboardInterrupt: - log.info("\n 程序已退出") + log.info("程序已退出") except EOFError: break @@ -51,7 +51,7 @@ async def run(): log.info('App ID可以在SteamDB或Steam商店链接页面查看') await main_loop() except KeyboardInterrupt: - log.info("\n 程序已退出") + log.info("程序已退出") except Exception as e: log.error(f'发生错误: {stack_error(e)}, 将在5秒后退出') await asyncio.sleep(5) @@ -60,6 +60,6 @@ if __name__ == '__main__': try: asyncio.run(run()) except KeyboardInterrupt: - log.info("\n 程序已退出") + log.info("程序已退出") except SystemExit: sys.exit()