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 and Release | ||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| python-version: ['3.11', '3.12'] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install build twine | ||
| - name: Build package | ||
| run: python -m build | ||
| - name: Check package | ||
| run: twine check dist/* | ||
| build-windows: | ||
| needs: build | ||
| runs-on: windows-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '3.12' | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install build | ||
| - name: Build package | ||
| run: python -m build | ||
| - name: Create Windows Package | ||
| shell: powershell | ||
| run: | | ||
| $version = "${{ github.ref_name }}" | ||
| $version = $version -replace '^v', '' | ||
| $packageName = "Fix_Agent_${version}_Portable_Windows" | ||
| New-Item -ItemType Directory -Force -Path "dist\$packageName" | ||
| Get-ChildItem "dist\*.whl" | ForEach-Object { | ||
| Copy-Item $_ -Destination "dist\$packageName\" | ||
| } | ||
| $batContent = @" | ||
| @echo off | ||
| title Fix Agent | ||
| echo Starting Fix Agent... | ||
| python --version >nul 2>&1 | ||
| if errorlevel 1 ( | ||
| echo Error: Python not found | ||
| pause | ||
| exit /b 1 | ||
| ) | ||
| python -m Fix_agent %* | ||
| if errorlevel 1 ( | ||
| pause) | ||
| "@ | ||
| $batContent | Out-File -FilePath "dist\$packageName\Fix_Agent.bat" -Encoding UTF8 | ||
| Copy-Item "README.md" -Destination "dist\$packageName\" -ErrorAction SilentlyContinue | ||
| Copy-Item "LICENSE" -Destination "dist\$packageName\" -ErrorAction SilentlyContinue | ||
| Compress-Archive -Path "dist\$packageName\*" -DestinationPath "dist\$packageName.zip" -Force | ||
| - name: Upload Windows artifacts | ||
| uses: actions/upload-artifact@v3 | ||
| with: | ||
| name: windows-package | ||
| path: dist/Fix_Agent_*_Portable_Windows.zip | ||
| upload: | ||
| needs: [build, build-windows] | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '3.12' | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install build twine | ||
| - name: Build package | ||
| run: python -m build | ||
| - name: Download Windows artifacts | ||
| uses: actions/download-artifact@v3 | ||
| with: | ||
| name: windows-package | ||
| path: dist/ | ||
| - name: Create Release | ||
| uses: softprops/action-gh-release@v1 | ||
| with: | ||
| tag_name: ${{ github.ref_name }} | ||
| name: Fix Agent ${{ github.ref_name }} | ||
| body: | | ||
| ## Fix Agent ${{ github.ref_name }} | ||
| ### 🚀 新特性 | ||
| - PowerShell完整支持 | ||
| - Windows服务管理功能 | ||
| - WSL环境检测 | ||
| - 跨平台路径处理 | ||
| - 智能系统信息显示 | ||
| ### 📦 安装方式 | ||
| 1. **推荐**: `pip install Fix_agent` | ||
| 2. **便携版**: 下载 Windows ZIP 包 | ||
| 3. **开发版**: `pip install git+https://github.com/3uyuan1ee/Fix_agent.git` | ||
| ### 🪟 Windows特定功能 | ||
| ```cmd | ||
| # 系统信息 | ||
| fix-agent | ||
| > /sys | ||
| # 服务管理 | ||
| fix-agent | ||
| > /services list | ||
| # PowerShell命令 | ||
| fix-agent | ||
| ! pwsh Get-Process | ||
| ``` | ||
| ### 🔧 系统要求 | ||
| - Python 3.11+ | ||
| - Windows 10/11 | ||
| - 可选: Node.js (JavaScript项目分析) | ||
| 📚 [完整文档](https://github.com/3uyuan1ee/Fix_agent#readme) | ||
| 🐛 [问题反馈](https://github.com/3uyuan1ee/Fix_agent/issues) | ||
| files: | | ||
| dist/*.whl | ||
| dist/*.tar.gz | ||
| dist/Fix_Agent_*_Portable_Windows.zip | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Publish to PyPI | ||
| env: | ||
| TWINE_USERNAME: __token__ | ||
| TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | ||
| run: | | ||
| twine upload dist/* | ||