From d670363cc57d06ef2a01ecd92765e0bdd6cae97f Mon Sep 17 00:00:00 2001 From: mikumifa <1055069518@qq.com> Date: Sat, 7 Sep 2024 03:16:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=89=93=E5=8C=85=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 10 ++-------- main.py | 6 +++--- main.spec | 33 +-------------------------------- 3 files changed, 6 insertions(+), 43 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f69fec7..9b93b9b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,11 +19,11 @@ jobs: - os: name: macos-14 filename: MacOS_amd64 - end: ".dmg" + end: "" - os: name: macos-12 filename: MacOS_x64 - end: ".dmg" + end: "" - os: name: windows-latest filename: Windows @@ -60,12 +60,6 @@ jobs: # - name: Zip the Build-MacOS # if: matrix.config.os.filename == 'MacOS_amd64' or matrix.config.os.filename == 'MacOS_x64' # run: zip -r ${{ secrets.ReleaseZipName }}_${{ matrix.config.os.filename }}-${{github.ref_name}}.zip ./dist/biliTickerBuy.app/* - - name: dmg create - if: matrix.config.os.filename == 'MacOS_amd64' || matrix.config.os.filename == 'MacOS_x64' - uses: L-Super/create-dmg-actons@v1.0.3 - with: - dmg_name: dist/biliTickerBuy - src_dir: dist/biliTickerBuy.app - name: Upload binaries to release uses: svenstaro/upload-release-action@v2 diff --git a/main.py b/main.py index 4551baf..eda502b 100644 --- a/main.py +++ b/main.py @@ -7,9 +7,9 @@ from config import get_application_path from tab.go import go_tab from tab.login import login_tab +from tab.problems import problems_tab from tab.settings import setting_tab from tab.train import train_tab -from tab.problems import problems_tab header = """ # B 站会员购抢票🌈 @@ -36,8 +36,8 @@ parser.add_argument("--port", type=int, default=7860, help="server port") parser.add_argument("--share", type=bool, default=False, help="create a public link") args = parser.parse_args() - - logger.add(os.path.join(get_application_path(), "app.log")) + log_file = os.path.join(get_application_path(), "app.log") + logger.add(log_file) with gr.Blocks(head=short_js, css=custom_css) as demo: gr.Markdown(header) with gr.Tab("生成配置"): diff --git a/main.spec b/main.spec index 4c48509..19607fc 100644 --- a/main.spec +++ b/main.spec @@ -46,35 +46,4 @@ exe = EXE( codesign_identity=None, entitlements_file=None, icon=['assets/icon.ico'] -) - - -app = BUNDLE(exe, - name='biliTickerBuy.app', - icon='assets/icon.icns', - bundle_identifier=None - ) -if platform.system() == "Darwin": - ## Make app bundle double-clickable - import plistlib - from pathlib import Path - app_path = Path(app.name) - - # read Info.plist - with open(app_path / 'Contents/Info.plist', 'rb') as f: - pl = plistlib.load(f) - - # write Info.plist - with open(app_path / 'Contents/Info.plist', 'wb') as f: - pl['CFBundleExecutable'] = 'wrapper' - plistlib.dump(pl, f) - - # write new wrapper script - shell_script = """#!/bin/bash - dir=$(dirname $0) - open -a Terminal file://${dir}/%s""" % app.appname - with open(app_path / 'Contents/MacOS/wrapper', 'w') as f: - f.write(shell_script) - - # make it executable - (app_path / 'Contents/MacOS/wrapper').chmod(0o755) \ No newline at end of file +) \ No newline at end of file