完善自动地鬼,自动悬赏,自动结界 #29
Workflow file for this run
This file contains 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 and Release | |
on: | |
push: | |
branches: | |
- main | |
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 }} |