Skip to content

完善退出后资源清理 #26

完善退出后资源清理

完善退出后资源清理 #26

Workflow file for this run

name: Build and Release
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: windows-latest # 切换到 Windows 环境
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Copy DLL files to Python root
run: |
# Check if the DLL folder exists
if (Test-Path -Path "${{ github.workspace }}\DLL") {
# Get all files in the DLL folder
$dllFiles = Get-ChildItem -Path "${{ github.workspace }}\DLL" -File
# Copy each DLL file to the Python environment root
foreach ($file in $dllFiles) {
Copy-Item -Path $file.FullName -Destination "${{ env.pythonLocation }}\$($file.Name)" -Force
Write-Host "Copied $($file.Name) to ${{ env.pythonLocation }}"
}
} else {
Write-Host "DLL folder not found."
}
- name: Run build script
run: python build.py # 在 Windows 环境中运行打包脚本
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
dist/**
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}