|
| 1 | +name: release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'v*' |
| 7 | + workflow_dispatch: {} |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + name: Build binaries |
| 12 | + runs-on: ${{ matrix.os }} |
| 13 | + strategy: |
| 14 | + fail-fast: false |
| 15 | + matrix: |
| 16 | + os: [windows-latest, macos-13] |
| 17 | + python-version: ['3.11'] |
| 18 | + steps: |
| 19 | + - name: Checkout |
| 20 | + uses: actions/checkout@v4 |
| 21 | + |
| 22 | + - name: Set up Python |
| 23 | + uses: actions/setup-python@v5 |
| 24 | + with: |
| 25 | + python-version: ${{ matrix.python-version }} |
| 26 | + |
| 27 | + - name: Install dependencies |
| 28 | + shell: bash |
| 29 | + run: | |
| 30 | + python -m pip install --upgrade pip |
| 31 | + if [ -f requirements.txt ]; then pip install -r requirements.txt; else pip install PyQt6; fi |
| 32 | + pip install pyinstaller requests ffmpeg-python |
| 33 | +
|
| 34 | + - name: Build PyQt6 app |
| 35 | + shell: bash |
| 36 | + run: | |
| 37 | + pyinstaller --name WINFF-GUI-PyQt6 --noconfirm --onefile --windowed GUI_pyqt6_WINFF.py |
| 38 | +
|
| 39 | + - name: Build Tkinter app |
| 40 | + shell: bash |
| 41 | + run: | |
| 42 | + pyinstaller --name WINFF-GUI-Tkinter --noconfirm --onefile --windowed GUI_tkinter_WINFF.py |
| 43 | +
|
| 44 | + - name: Package artifacts |
| 45 | + shell: bash |
| 46 | + run: | |
| 47 | + mkdir -p artifacts |
| 48 | + if [[ "$RUNNER_OS" == "Windows" ]]; then |
| 49 | + cp dist/WINFF-GUI-PyQt6.exe artifacts/ |
| 50 | + cp dist/WINFF-GUI-Tkinter.exe artifacts/ |
| 51 | + elif [[ "$RUNNER_OS" == "macOS" ]]; then |
| 52 | + cd dist |
| 53 | + zip -r ../artifacts/WINFF-GUI-PyQt6-macos.app.zip "WINFF-GUI-PyQt6.app" |
| 54 | + zip -r ../artifacts/WINFF-GUI-Tkinter-macos.app.zip "WINFF-GUI-Tkinter.app" |
| 55 | + cd - |
| 56 | + else |
| 57 | + cp -r dist/* artifacts/ |
| 58 | + fi |
| 59 | +
|
| 60 | + - name: Upload artifacts |
| 61 | + uses: actions/upload-artifact@v4 |
| 62 | + with: |
| 63 | + name: ${{ runner.os }}-release-artifacts |
| 64 | + path: artifacts/* |
| 65 | + |
| 66 | + publish: |
| 67 | + name: Publish GitHub Release |
| 68 | + runs-on: ubuntu-latest |
| 69 | + needs: build |
| 70 | + steps: |
| 71 | + - name: Download Windows artifacts |
| 72 | + uses: actions/download-artifact@v4 |
| 73 | + with: |
| 74 | + name: Windows-release-artifacts |
| 75 | + path: release-assets |
| 76 | + continue-on-error: true |
| 77 | + |
| 78 | + - name: Download macOS artifacts |
| 79 | + uses: actions/download-artifact@v4 |
| 80 | + with: |
| 81 | + name: macOS-release-artifacts |
| 82 | + path: release-assets |
| 83 | + continue-on-error: true |
| 84 | + |
| 85 | + - name: List assets |
| 86 | + run: ls -la release-assets || true |
| 87 | + |
| 88 | + - name: Create/Update GitHub Release |
| 89 | + uses: softprops/action-gh-release@v2 |
| 90 | + with: |
| 91 | + files: release-assets/* |
| 92 | + generate_release_notes: true |
| 93 | + env: |
| 94 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments