Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 19 additions & 14 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
strategy:
matrix:
builder: [pyinstaller, nuitka]
env:
PYTHONOPTIMIZE: 2
runs-on: windows-latest
steps:
- name: Checkout code
Expand All @@ -34,11 +36,14 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
python -m pip install -r requirements.txt

- 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
Expand All @@ -51,35 +56,36 @@ 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 }}

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
Expand All @@ -90,8 +96,7 @@ jobs:
- name: Download and Install QQ Software
run: |
# Download QQ software
python3 -m pip install requests
python3 get_qqnt.py QQInstaller.exe windows ntDownloadX64Url
pythonget_qqnt.py QQInstaller.exe windows ntDownloadX64Url
# Install QQ silently
Start-Process -FilePath QQInstaller.exe -ArgumentList '/S' -Wait

Expand Down
Loading
Loading