Skip to content

The only downloader you need. 下载器的集大成者。

修复 GitHub Action 打包脚本

XiaoYouChR9c0e6d000d79
diff --git a/.github/workflows/deploy-application.yml b/.github/workflows/deploy-application.yml
index 4746a4c7..d252c96d 100644
--- a/.github/workflows/deploy-application.yml
+++ b/.github/workflows/deploy-application.yml
@@ -21,12 +21,15 @@ jobs:
- name: Install dependencies
run: |
pip install --timeout=300 -r requirements.txt
+ pip install nuitka==2.6.4
- name: Build with Nuitka
run: |
- $VERSION = python -c "from app.common.setting import VERSION; print(VERSION)"
+ python -c "from app.common.config import VERSION; f = open('version.txt', 'w'); f.write(VERSION); f.close()"
+ $VERSION = gc version.txt
Write-Host "VERSION=$VERSION"
echo "VERSION=$VERSION" >> $env:GITHUB_ENV
+ del version.txt
python deploy.py
# nuitka --module plugins/jy_os_page.py
# mv jy_os_page*.pyd output/
@@ -58,11 +61,13 @@ jobs:
- name: Build with Nuitka
run: |
- VERSION=$(python3 -c "from app.common.setting import VERSION; print(VERSION)")
- echo "VERSION=${VERSION}" >> $GITHUB_ENV
+ python3 -c "import sys; sys.path.append('./app/common'); import config; print(config.VERSION)" > version.txt
+ version=$(sed -n '4p' version.txt)
+ echo "VERSION=${version}" >> "$GITHUB_ENV"
+ rm -rf version.txt
python3 deploy.py
- chmod u+x "dist/Ghost Downloader.app/Contents/MacOS/Ghost Downloader"
- rm -rf "dist/Ghost Downloader.build"
+# chmod u+x "dist/Ghost Downloader.app/Contents/MacOS/Ghost Downloader"
+# rm -rf "dist/Ghost Downloader.build"
- name: Create DMG
run: |
@@ -73,7 +78,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: Ghost-Downloader-v${{ env.VERSION }}-macOS-${{ matrix.architecture }}
- path: Ghost-Downloader-v${{ env.VERSION }}-macOS-${{ matrix.architecture }}.dmg
+ path: dist/
build-macos-13-x86_64:
strategy:
@@ -96,11 +101,13 @@ jobs:
- name: Build with Nuitka
run: |
- VERSION=$(python3 -c "from app.common.setting import VERSION; print(VERSION)")
- echo "VERSION=${VERSION}" >> $GITHUB_ENV
+ python3 -c "import sys; sys.path.append('./app/common'); import config; print(config.VERSION)" > version.txt
+ version=$(sed -n '4p' version.txt)
+ echo "VERSION=${version}" >> "$GITHUB_ENV"
+ rm -rf version.txt
python3 deploy.py
- chmod u+x "dist/Ghost Downloader.app/Contents/MacOS/Ghost Downloader"
- rm -rf "dist/Ghost Downloader.build"
+# chmod u+x "dist/Ghost Downloader.app/Contents/MacOS/Ghost Downloader"
+# rm -rf "dist/Ghost Downloader.build"
- name: Create DMG
run: |
@@ -111,7 +118,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: Ghost-Downloader-v${{ env.VERSION }}-macOS-${{ matrix.architecture }}
- path: Ghost-Downloader-v${{ env.VERSION }}-macOS-${{ matrix.architecture }}.dmg
+ path: dist/
build-ubuntu:
strategy:
@@ -136,8 +143,10 @@ jobs:
- name: Build with Nuitka
run: |
- VERSION=$(python3 -c "from app.common.setting import VERSION; print(VERSION)")
- echo "VERSION=${VERSION}" >> $GITHUB_ENV
+ python3 -c "import sys; sys.path.append('./app/common'); import config; print(config.VERSION)" > version.txt
+ version=$(sed -n '4p' version.txt)
+ echo "VERSION=${version}" >> "$GITHUB_ENV"
+ rm -rf version.txt
python deploy.py
# nuitka --module plugins/jy_os_page.py
# mkdir -p "output/Ghost-Downloader-3.dist/plugins/"
diff --git a/main.py b/Ghost-Downloader-3.py
similarity index 100%
rename from main.py
rename to Ghost-Downloader-3.py
diff --git a/app/view/main_window.py b/app/view/main_window.py
index c01f551e..4e7d81b6 100644
--- a/app/view/main_window.py
+++ b/app/view/main_window.py
@@ -237,6 +237,9 @@ class MainWindow(MSFluentWindow):
self.setWindowIcon(QIcon(':/image/logo.png'))
self.setWindowTitle('Ghost Downloader')
+ if sys.platform == 'darwin':
+ self.titleBar.maxBtn.hide()
+
# create splash screen
self.splashScreen = CustomSplashScreen(self.windowIcon(), self)
self.splashScreen.setIconSize(QSize(106, 106))
diff --git a/deploy.py b/deploy.py
index 36ed70f0..937f86fd 100644
--- a/deploy.py
+++ b/deploy.py
@@ -20,7 +20,7 @@ if sys.platform == "win32":
f'--file-version={VERSION}',
f'--product-version={VERSION}',
'--file-description="Ghost Downloader"',
- f'--copyright="Copyright(C) {YEAR} {AUTHOR}"'
+ f'--copyright="Copyright(C) {YEAR} {AUTHOR}"',
'--output-dir=dist',
'Ghost-Downloader-3.py',
]
@@ -37,9 +37,9 @@ elif sys.platform == "darwin":
f"--macos-app-version={VERSION}",
'--macos-app-name="Ghost Downloader"',
"--macos-app-icon=resources/logo.icns",
- f'--copyright="Copyright(C) {YEAR} {AUTHOR}"'
+ f'--copyright="Copyright(C) {YEAR} {AUTHOR}"',
'--output-dir=dist',
- '--macos-signed-app-name=com.xiaoyouchr.ghostdownloader'
+ '--macos-signed-app-name=com.xiaoyouchr.ghostdownloader',
'Ghost-Downloader-3.py',
]
else:
@@ -58,4 +58,3 @@ else:
os.system(' '.join(args))
-