Merge branch 'main' into dev #5
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: Autobuild (Dev) | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: Build on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [windows-latest, ubuntu-latest] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| working-directory: src | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install pyinstaller | |
| - name: Build with PyInstaller | |
| working-directory: src | |
| run: | | |
| pyinstaller \ | |
| --onefile \ | |
| --windowed \ | |
| --name 123pan-dev \ | |
| --icon icon.ico \ | |
| 123pan.py | |
| shell: bash | |
| # Windows | |
| - name: Upload Windows artifact | |
| if: runner.os == 'Windows' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: 123pan-windows | |
| path: src/dist/123pan-dev.exe | |
| # Linux | |
| - name: Upload Linux artifact | |
| if: runner.os == 'Linux' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: 123pan-linux | |
| path: src/dist/123pan-dev | |
| release: | |
| name: Publish Autobuild Release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Delete old autobuild tag | |
| run: | | |
| git push origin :refs/tags/autobuild || true | |
| - name: Create autobuild tag | |
| run: | | |
| git tag autobuild | |
| git push origin autobuild --force | |
| - name: Publish Autobuild (Pre-release) | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: autobuild | |
| name: Autobuild (Dev / 测试版) | |
| prerelease: true | |
| body: | | |
| ⚠️ **这是自动构建的测试版本(Autobuild)** | |
| - 来自 `dev` 分支的最新提交 | |
| - 可能不稳定,仅用于测试 | |
| - 每次 dev 更新都会自动覆盖此版本 | |
| Commit: ${{ github.sha }} | |
| files: | | |
| artifacts/123pan-windows/* | |
| artifacts/123pan-linux/* |