🐛 fix: 修复登录后登录窗口不会自动关闭的问题 #18
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Windows Release | |
on: | |
push: | |
tags: | |
- '*' | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python 3.11 Environment | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.11' | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install nuitka requests wxPython qrcode[pil]==7.4.2 | |
- name: Get Version Tag | |
id: get_version | |
run: | | |
$tag = $(curl -s "https://api.github.com/repos/${{ github.repository }}/tags" | jq -r '.[0].name') | |
$version = ($tag -replace '^v|\.', '').ToCharArray() -join '.' | |
Write-Output "tag=$tag" >> $env:GITHUB_OUTPUT | |
Write-Output "version=$version" >> $env:GITHUB_OUTPUT | |
- name: Generate Compile Data | |
run: | | |
$currentDate = Get-Date | |
$timezone = [System.TimeZoneInfo]::FindSystemTimeZoneById("China Standard Time") | |
$convertedDate = [System.TimeZoneInfo]::ConvertTime($currentDate, $timezone) | |
$date = $convertedDate.ToString("yyyy-MM-dd HH:mm:ss") | |
$content = "date = ""$date""" + "`n" + "compile = True" | |
Set-Content -Path "src/utils/common/compile_data.py" -Value $content | |
- name: Build with Nuitka | |
run: | | |
nuitka --standalone --nofollow-import-to=numpy,PIL --windows-console-mode=disable --windows-file-version=${{ steps.get_version.outputs.version }} --windows-icon-from-ico=icon.ico --product-name="Bili23 Downloader" --company-name="Scott Sloan" --file-description="Bili23 Downloader" --copyright="Copyright (C) 2022-2025 Scott Sloan" --show-progress --mingw64 --assume-yes-for-downloads --output-dir=out src/GUI.py | |
- name: Add License | |
run: | | |
Rename-Item "out/GUI.dist" "Bili23 Downloader" | |
Copy-Item ./LICENSE "out/Bili23 Downloader/" | |
- name: Generate Source Code Artifacts | |
shell: pwsh | |
run: | | |
$new = "source/Bili23 Downloader" | |
New-Item -Path $new -ItemType Directory -Force | |
Copy-Item -Path src -Destination $new -Recurse | |
Copy-Item -Path LICENSE -Destination $new | |
Copy-Item -Path README.md -Destination $new | |
Copy-Item -Path requirements.txt -Destination $new | |
- name: Upload Artifacts (source_code) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Bili23_Downloader_${{ steps.get_version.outputs.tag }}_release.zip | |
path: | | |
source/Bili23 Downloader | |
- name: Upload Artifacts (no_ffmpeg) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Bili23_Downloader_${{ steps.get_version.outputs.tag }}_win_x64_release.zip | |
path: | | |
out/Bili23 Downloader | |
- name: Download FFmpeg | |
run: | | |
Invoke-WebRequest -Uri "https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip" -OutFile "ffmpeg.zip" | |
Expand-Archive -Path "ffmpeg.zip" -DestinationPath "FFmpeg" | |
$appExePath = Get-ChildItem -Path $extractedFolder -Recurse | Where-Object { $_.Name -match '^ffmpeg\.exe$' } | |
Copy-Item $appExePath.FullName "out/Bili23 Downloader/" | |
- name: Upload Artifacts (with_ffmpeg) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Bili23_Downloader_${{ steps.get_version.outputs.tag }}_win_x64_with_ffmpeg_release.zip | |
path: | | |
out/Bili23 Downloader | |
- name: Compression (source_code) | |
shell: pwsh | |
run: | | |
Compress-Archive -Path "source/Bili23 Downloader" -DestinationPath "Bili23_Downloader_${{ steps.get_version.outputs.tag }}_release.zip" | |
- name: Compression (with_ffmpeg) | |
shell: pwsh | |
run: | | |
Compress-Archive -Path "out/Bili23 Downloader" -DestinationPath "Bili23_Downloader_${{ steps.get_version.outputs.tag }}_win_x64_with_ffmpeg_release.zip" | |
- name: Compression (no_ffmpeg) | |
shell: pwsh | |
run: | | |
Remove-Item -Path "out/Bili23 Downloader/ffmpeg.exe" | |
Compress-Archive -Path "out/Bili23 Downloader" -DestinationPath "Bili23_Downloader_${{ steps.get_version.outputs.tag }}_win_x64_release.zip" | |
- name: Print SHA1 | |
run: | | |
$sha1_1 = Get-FileHash -Path "Bili23_Downloader_${{ steps.get_version.outputs.tag }}_release.zip" -Algorithm SHA1 | |
$sha1_2 = Get-FileHash -Path "Bili23_Downloader_${{ steps.get_version.outputs.tag }}_win_x64_release.zip" -Algorithm SHA1 | |
$sha1_3 = Get-FileHash -Path "Bili23_Downloader_${{ steps.get_version.outputs.tag }}_win_x64_with_ffmpeg_release.zip" -Algorithm SHA1 | |
echo "release" | |
echo $sha1_1 | |
echo "win_release" | |
echo $sha1_2 | |
echo "win_release_ffmpeg" | |
echo $sha1_3 | |
- name: Upload to Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
Bili23_Downloader_${{ steps.get_version.outputs.tag }}_release.zip | |
Bili23_Downloader_${{ steps.get_version.outputs.tag }}_win_x64_release.zip | |
Bili23_Downloader_${{ steps.get_version.outputs.tag }}_win_x64_with_ffmpeg_release.zip | |
token: ${{ secrets.RELEASE }} | |
name: ${{ steps.get_version.outputs.tag }} | |
body_path: CHANGELOG.md | |
make_latest: true | |
tag_name: ${{ steps.get_version.outputs.tag }} | |
draft: false | |
prerelease: false | |
generate_release_notes: false | |
discussion_category_name: announcements |