-
Notifications
You must be signed in to change notification settings - Fork 63
improve: embed res #215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve: embed res #215
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -20,6 +20,8 @@ jobs: | |||||||||||||||||
| strategy: | ||||||||||||||||||
| matrix: | ||||||||||||||||||
| builder: [pyinstaller, nuitka] | ||||||||||||||||||
| env: | ||||||||||||||||||
| PYTHONOPTIMIZATION: 2 | ||||||||||||||||||
| runs-on: windows-latest | ||||||||||||||||||
| steps: | ||||||||||||||||||
| - name: Checkout code | ||||||||||||||||||
|
|
@@ -33,12 +35,15 @@ jobs: | |||||||||||||||||
|
|
||||||||||||||||||
| - name: Install dependencies | ||||||||||||||||||
| run: | | ||||||||||||||||||
| python -m pip install --upgrade pip | ||||||||||||||||||
| pip install -r requirements.txt | ||||||||||||||||||
| python3 -m pip install --upgrade pip | ||||||||||||||||||
| python3 -m pip install -r requirements.txt | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 建议 (bug_risk): 硬编码 'python3' 可能会在 Windows 运行器上导致问题。 在 Windows 上,'python3' 可能不可用;使用 'python' 可以提高跨平台兼容性。
Suggested change
Original comment in Englishsuggestion (bug_risk): Hardcoding 'python3' may cause issues on Windows runners. On Windows, 'python3' may not be available; using 'python' improves cross-platform compatibility.
Suggested change
|
||||||||||||||||||
|
|
||||||||||||||||||
| - name: Download External Data Release | ||||||||||||||||||
| id: download_data | ||||||||||||||||||
| run: | | ||||||||||||||||||
| mkdir data | ||||||||||||||||||
| cd data | ||||||||||||||||||
| touch __init__.py | ||||||||||||||||||
| # 获取 LiteLoaderQQNT 的最新版本 | ||||||||||||||||||
| $LLtag = (Invoke-RestMethod -Uri "https://api.github.com/repos/LiteLoaderQQNT/LiteLoaderQQNT/releases/latest").tag_name | ||||||||||||||||||
| echo "LLtag=$LLtag" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||||||||||||||||||
|
|
@@ -51,35 +56,38 @@ jobs: | |||||||||||||||||
| curl -L -o "list-viewer-${LVtag}.zip" "https://github.com/ltxhhz/LL-plugin-list-viewer/releases/download/${LVtag}/list-viewer.zip" | ||||||||||||||||||
|
|
||||||||||||||||||
| dir | ||||||||||||||||||
| cd .. | ||||||||||||||||||
|
|
||||||||||||||||||
| - name: Restore Cache | ||||||||||||||||||
| uses: actions/cache/restore@v4 | ||||||||||||||||||
| if: matrix.builder == 'nuitka' | ||||||||||||||||||
| with: | ||||||||||||||||||
| path: nuitka_cache | ||||||||||||||||||
| key: nuitka-cache | ||||||||||||||||||
| restore-keys: nuitka- | ||||||||||||||||||
| path: | | ||||||||||||||||||
| ${{ matrix.builder }}_cache | ||||||||||||||||||
| dist | ||||||||||||||||||
| key: ${{ matrix.builder }}-cache-${{ github.run_number }} | ||||||||||||||||||
| restore-keys: ${{ matrix.builder }}-cache- | ||||||||||||||||||
|
|
||||||||||||||||||
| - name: Build by ${{ matrix.builder }} | ||||||||||||||||||
| env: | ||||||||||||||||||
| LLtag: ${{ env.LLtag }} | ||||||||||||||||||
| LVtag: ${{ env.LVtag }} | ||||||||||||||||||
| run: | | ||||||||||||||||||
| python -m pip install ${{ matrix.builder }} | ||||||||||||||||||
| # python3 -m pip install ${{ matrix.builder }} | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 问题 (bug_risk): 构建器安装被注释掉了。 如果构建器尚未安装,这可能会导致构建失败。 Original comment in Englishissue (bug_risk): Builder installation is commented out. If the builder is not already installed, this may cause the build to fail. |
||||||||||||||||||
|
|
||||||||||||||||||
| if ('${{ matrix.builder }}' -eq 'nuitka') { | ||||||||||||||||||
| $env:NUITKA_CACHE_DIR = "nuitka_cache" | ||||||||||||||||||
| nuitka --onefile --windows-uac-admin --include-data-files="LiteLoaderQQNT-$($env:LLtag).zip"="./" --include-data-files="list-viewer-$($env:LVtag).zip"="./" install_windows.py --output-dir="dist" --output-file="install_windows_nuitka" --assume-yes-for-downloads --enable-plugins="tk-inter" --enable-console --mingw64 | ||||||||||||||||||
| nuitka --onefile --windows-uac-admin --include-raw-dir="data/"="data/" install_windows.py --output-dir="dist" --output-file="install_windows_nuitka" --assume-yes-for-downloads --enable-plugins="tk-inter" --windows-console-mode=force --mingw64 --lto=yes | ||||||||||||||||||
| } else { | ||||||||||||||||||
| pyinstaller --onefile --uac-admin --add-data "LiteLoaderQQNT-$($env:LLtag).zip:." --add-data "list-viewer-$($env:LVtag).zip:." install_windows.py --distpath dist --name install_windows_pyinstaller | ||||||||||||||||||
| pyinstaller --onefile --uac-admin --add-data "data/:data/" install_windows.py --distpath dist --name install_windows_pyinstaller | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| - name: Save Cache | ||||||||||||||||||
| uses: actions/cache/save@v4 | ||||||||||||||||||
| if: matrix.builder == 'nuitka' | ||||||||||||||||||
| with: | ||||||||||||||||||
| path: nuitka_cache | ||||||||||||||||||
| key: nuitka-cache | ||||||||||||||||||
| path: | | ||||||||||||||||||
| ${{ matrix.builder }}_cache | ||||||||||||||||||
| dist | ||||||||||||||||||
| key: ${{ matrix.builder }}-cache-${{ github.run_number }} | ||||||||||||||||||
|
|
||||||||||||||||||
| - name: Upload install_windows_${{ matrix.builder }}.exe | ||||||||||||||||||
| uses: actions/upload-artifact@v4 | ||||||||||||||||||
|
|
@@ -90,7 +98,7 @@ jobs: | |||||||||||||||||
| - name: Download and Install QQ Software | ||||||||||||||||||
| run: | | ||||||||||||||||||
| # Download QQ software | ||||||||||||||||||
| python3 -m pip install requests | ||||||||||||||||||
| # python3 -m pip install requests | ||||||||||||||||||
| python3 get_qqnt.py QQInstaller.exe windows ntDownloadX64Url | ||||||||||||||||||
| # Install QQ silently | ||||||||||||||||||
| Start-Process -FilePath QQInstaller.exe -ArgumentList '/S' -Wait | ||||||||||||||||||
|
|
||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
问题 (typo): 环境变量名称可能存在拼写错误。
'PYTHONOPTIMIZATION' 应为 'PYTHONOPTIMIZE' 以设置 Python 优化级别;否则,此变量将无效。
Original comment in English
issue (typo): Possible typo in environment variable name.
'PYTHONOPTIMIZATION' should be 'PYTHONOPTIMIZE' to set the Python optimization level; otherwise, this variable will not have any effect.