|
| 1 | +name: Build & Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'v*' |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: write |
| 11 | + |
| 12 | +jobs: |
| 13 | + build: |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + include: |
| 17 | + - os: windows-latest |
| 18 | + artifact: PDFApps-Windows |
| 19 | + - os: ubuntu-22.04 |
| 20 | + artifact: PDFApps-Linux |
| 21 | + - os: macos-latest |
| 22 | + artifact: PDFApps-macOS |
| 23 | + |
| 24 | + runs-on: ${{ matrix.os }} |
| 25 | + |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v4 |
| 28 | + |
| 29 | + - name: Set up Python |
| 30 | + uses: actions/setup-python@v5 |
| 31 | + with: |
| 32 | + python-version: '3.12' |
| 33 | + |
| 34 | + - name: Install dependencies |
| 35 | + run: | |
| 36 | + python -m pip install --upgrade pip |
| 37 | + pip install -r requirements.txt |
| 38 | +
|
| 39 | + # ── Windows ───────────────────────────────────────────────── |
| 40 | + - name: Build (Windows) |
| 41 | + if: runner.os == 'Windows' |
| 42 | + run: | |
| 43 | + python -m PyInstaller --noconfirm pdfapps.spec |
| 44 | + python -m PyInstaller --noconfirm uninstaller.spec |
| 45 | + python -m PyInstaller --noconfirm installer.spec |
| 46 | +
|
| 47 | + - name: Upload (Windows) |
| 48 | + if: runner.os == 'Windows' |
| 49 | + uses: actions/upload-artifact@v4 |
| 50 | + with: |
| 51 | + name: ${{ matrix.artifact }} |
| 52 | + path: | |
| 53 | + dist/PDFApps.exe |
| 54 | + dist/PDFAppsSetup.exe |
| 55 | + dist/PDFAppsUninstall.exe |
| 56 | +
|
| 57 | + # ── Linux ─────────────────────────────────────────────────── |
| 58 | + - name: Install Linux system deps |
| 59 | + if: runner.os == 'Linux' |
| 60 | + run: | |
| 61 | + sudo apt-get update |
| 62 | + sudo apt-get install -y libegl1 libxkbcommon0 libxcb-cursor0 |
| 63 | +
|
| 64 | + - name: Build (Linux) |
| 65 | + if: runner.os == 'Linux' |
| 66 | + run: | |
| 67 | + python -m PyInstaller --noconfirm pdfapps.spec |
| 68 | + chmod +x dist/PDFApps |
| 69 | + tar -czf dist/PDFApps-Linux.tar.gz -C dist PDFApps |
| 70 | +
|
| 71 | + - name: Upload (Linux) |
| 72 | + if: runner.os == 'Linux' |
| 73 | + uses: actions/upload-artifact@v4 |
| 74 | + with: |
| 75 | + name: ${{ matrix.artifact }} |
| 76 | + path: dist/PDFApps-Linux.tar.gz |
| 77 | + |
| 78 | + # ── macOS ─────────────────────────────────────────────────── |
| 79 | + - name: Build (macOS) |
| 80 | + if: runner.os == 'macOS' |
| 81 | + run: | |
| 82 | + python -m PyInstaller --noconfirm pdfapps.spec |
| 83 | + chmod +x dist/PDFApps |
| 84 | + cd dist && zip -r PDFApps-macOS.zip PDFApps |
| 85 | +
|
| 86 | + - name: Upload (macOS) |
| 87 | + if: runner.os == 'macOS' |
| 88 | + uses: actions/upload-artifact@v4 |
| 89 | + with: |
| 90 | + name: ${{ matrix.artifact }} |
| 91 | + path: dist/PDFApps-macOS.zip |
| 92 | + |
| 93 | + release: |
| 94 | + needs: build |
| 95 | + runs-on: ubuntu-latest |
| 96 | + if: startsWith(github.ref, 'refs/tags/v') |
| 97 | + |
| 98 | + steps: |
| 99 | + - name: Download all artifacts |
| 100 | + uses: actions/download-artifact@v4 |
| 101 | + with: |
| 102 | + path: artifacts |
| 103 | + |
| 104 | + - name: Create Release |
| 105 | + uses: softprops/action-gh-release@v2 |
| 106 | + with: |
| 107 | + generate_release_notes: true |
| 108 | + files: | |
| 109 | + artifacts/PDFApps-Windows/PDFAppsSetup.exe |
| 110 | + artifacts/PDFApps-Windows/PDFApps.exe |
| 111 | + artifacts/PDFApps-Linux/PDFApps-Linux.tar.gz |
| 112 | + artifacts/PDFApps-macOS/PDFApps-macOS.zip |
0 commit comments