diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml index 7cb0a10..ed2c8bd 100644 --- a/.github/workflows/build_release.yml +++ b/.github/workflows/build_release.yml @@ -26,22 +26,22 @@ jobs: with: fetch-depth: 0 - - name: Set up Python 3.11 + - name: Set up Python 3.12 uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: '3.12' - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt - pip install pyinstaller + pip install -U pyinstaller - name: Build executables (Linux) if: matrix.os == 'ubuntu-latest' run: | for script in setDNS.py setHosts.py setHosts_Classic.py; do - pyinstaller --onefile "$script" + pyinstaller --clean --onefile "$script" mv "dist/${script%.py}" "dist/${script%.py}-Linux-x64" done zip -j "cnNetTool-Linux-x64.zip" dist/*-Linux-x64 @@ -57,9 +57,9 @@ jobs: $icoName = $script -replace '\.py$', '.ico' if (Test-Path -Path $icoName) { - pyinstaller --onefile $script --uac-admin --icon $icoName + pyinstaller --clean --onefile $script --uac-admin --icon $icoName } else { - pyinstaller --onefile $script --uac-admin + pyinstaller --clean --onefile $script --uac-admin } # pyinstaller --onefile $script --uac-admin @@ -73,7 +73,7 @@ jobs: if: matrix.os == 'macos-latest' run: | for script in setDNS.py setHosts.py setHosts_Classic.py; do - pyinstaller --onefile "$script" + pyinstaller --clean --onefile "$script" mv "dist/${script%.py}" "dist/${script%.py}-macOS-x64" done zip -j "cnNetTool-macOS-x64.zip" dist/*-macOS-x64 diff --git a/setDNS.py b/setDNS.py index 1d3459d..d22dc8e 100644 --- a/setDNS.py +++ b/setDNS.py @@ -187,7 +187,8 @@ def find_available_dns(args) -> tuple[dict, dict]: domain_resolutions[domain][server] = ips logger.debug( - f"{ip_version.upper()} DNS {server} ({region} - {provider}) 成功率 {success_rate:.2%}, 平均延迟 {avg_response_time:.2f}ms" + f"{ip_version.upper()} DNS {server} ({ + region} - {provider}) 成功率 {success_rate:.2%}, 平均延迟 {avg_response_time:.2f}ms" ) except Exception as exc: logger.error(f"{server} 测试出错: {str(exc)}")