build: package macOS release as .dmg instead of .zip #6
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
| # ============================================================ | |
| # Bulk PDF Generator — GitHub Actions Release Pipeline | |
| # ============================================================ | |
| # Triggered by pushing a version tag (e.g. v2.6). | |
| # Builds Windows .exe and macOS .app in parallel, then creates | |
| # a GitHub Release with both binaries attached. | |
| # | |
| # Usage: | |
| # git tag v2.6 | |
| # git push origin --tags | |
| # ============================================================ | |
| name: Build & Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| # ── Windows .exe build ────────────────────────────────────── | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Full history for _generate_version.py | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install pyinstaller | |
| - name: Bake version info | |
| run: python _generate_version.py | |
| - name: Build .exe | |
| run: python -m PyInstaller BulkPDFGenerator.spec --clean --noconfirm | |
| - name: Verify build output | |
| run: | | |
| if (!(Test-Path "dist/Bulk PDF Generator.exe")) { | |
| Write-Error "Build failed — .exe not found" | |
| exit 1 | |
| } | |
| $size = (Get-Item "dist/Bulk PDF Generator.exe").Length / 1MB | |
| Write-Host "Built: Bulk PDF Generator.exe ($([math]::Round($size, 1)) MB)" | |
| shell: pwsh | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-exe | |
| path: dist/Bulk PDF Generator.exe | |
| retention-days: 1 | |
| # ── macOS .app build ──────────────────────────────────────── | |
| build-macos: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install pyinstaller | |
| - name: Bake version info | |
| run: python _generate_version.py | |
| - name: Build .app | |
| run: python -m PyInstaller BulkPDFGenerator_mac.spec --clean --noconfirm | |
| - name: Create .dmg installer | |
| run: | | |
| if [ ! -d "dist/Bulk PDF Generator.app" ]; then | |
| echo "Build failed — .app not found" | |
| exit 1 | |
| fi | |
| hdiutil create -volname "Bulk PDF Generator" \ | |
| -srcfolder "dist/Bulk PDF Generator.app" \ | |
| -ov -format UDZO \ | |
| "dist/Bulk.PDF.Generator.macOS.dmg" | |
| SIZE=$(du -h "dist/Bulk.PDF.Generator.macOS.dmg" | cut -f1) | |
| echo "Built: Bulk.PDF.Generator.macOS.dmg ($SIZE)" | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: macos-app | |
| path: dist/Bulk.PDF.Generator.macOS.dmg | |
| retention-days: 1 | |
| # ── Create GitHub Release ─────────────────────────────────── | |
| release: | |
| needs: [build-windows, build-macos] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: windows-exe | |
| path: artifacts/ | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: macos-app | |
| path: artifacts/ | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| body: | | |
| ## ⬇ Download | |
| ### 🪟 Windows | |
| **[Bulk.PDF.Generator.exe](https://github.com/mrdavearms/bulk-pdf-extractor-and-generator/releases/download/${{ github.ref_name }}/Bulk.PDF.Generator.exe)** — Double-click to run. No installation needed. | |
| > **Windows security prompt:** Windows may show a "Windows protected your PC" screen. This is normal for newly released apps. Click **More info → Run anyway** to proceed. | |
| ### 🍎 macOS | |
| **[Bulk.PDF.Generator.macOS.dmg](https://github.com/mrdavearms/bulk-pdf-extractor-and-generator/releases/download/${{ github.ref_name }}/Bulk.PDF.Generator.macOS.dmg)** — Open the disk image and drag the app to Applications. | |
| > First time only: right-click the app → Open (macOS security prompt). | |
| --- | |
| ## What's new in ${{ github.ref_name }} | |
| - **Fixed: "Check for Updates" failing on Mac** — The update checker now works reliably on macOS. Previously it failed with an SSL certificate error because bundled Mac apps couldn't access the system certificate store. | |
| <!-- Add release notes above this line before tagging --> | |
| <details> | |
| <summary>Technical details</summary> | |
| Built by GitHub Actions from commit `${{ github.sha }}`. | |
| </details> | |
| files: | | |
| artifacts/Bulk PDF Generator.exe | |
| artifacts/Bulk.PDF.Generator.macOS.dmg |