chore(workflow): 调整Facebook部署工作流 #14
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: Deploy via FTP | |
| on: | |
| push: | |
| tags: | |
| - 'v*' # 监听标签推送,只匹配以'v'开头的标签 | |
| # paths: | |
| # - "facebook/**" | |
| workflow_dispatch: | |
| jobs: | |
| deploy: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.10' | |
| - name: Install PyInstaller | |
| run: | | |
| pip install pyinstaller | |
| pip install PyQt5 | |
| pip install pyodbc | |
| pip install clr | |
| pip install pyperclip | |
| pip install playwright | |
| pip install qasync | |
| pip install aiohttp | |
| pip install requests | |
| pip install setuptools | |
| # 读取并执行打包命令 | |
| - name: Build project | |
| run: | | |
| $command = Get-Content -Path "facebook\packaging_script\packaging.text" | |
| Invoke-Expression $command | |
| - name: Create release folder and zip executable | |
| run: | | |
| New-Item -ItemType Directory -Force -Path release\ | |
| # 将 FBrereptilever.exe 压缩为 ZIP 文件 | |
| Compress-Archive -Path "dist\FBreptilever.exe" -DestinationPath "release\FBreptilever.zip" | |
| - name: Create GitHub Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| release_name: Release ${{ github.ref_name }} | |
| draft: false | |
| prerelease: false | |
| - name: Upload to server via FTP | |
| uses: SamKirkland/FTP-Deploy-Action@v4.3.6 | |
| with: | |
| server: ${{ secrets.FTP_SERVER }} | |
| username: ${{ secrets.FTP_USERNAME }} | |
| password: ${{ secrets.FTP_PASSWORD }} | |
| protocol: ftp | |
| port: ${{ secrets.FTP_PORT }} | |
| local-dir: release/ | |
| server-dir: /UpData/FBfans/ | |
| security: | |
| exclude: | | |
| release/*.json | |
| # - name: Upload Release Asset | |
| # uses: actions/upload-release-asset@v1.0.1 | |
| # env: | |
| # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # with: | |
| # upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| # asset_path: release/FBreptilever.zip | |
| # asset_name: FBreptilever.zip | |
| # asset_content_type: application/zip |