fix: unify Windows Fluent controls and restore chrome interactions #74
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: Packaging | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| paths-ignore: | |
| - '**/*.md' | |
| - 'doc/**' | |
| - '!doc/icon.png' | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: electron-compile-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| compile: | |
| name: Build and launch ${{ matrix.platform }} ${{ matrix.arch }} ${{ matrix.extra-arch }} | |
| runs-on: ${{ matrix.runner }} | |
| timeout-minutes: 30 | |
| env: | |
| # Packaging downloads the target binary; Bun only needs Electron metadata. | |
| ELECTRON_SKIP_BINARY_DOWNLOAD: '1' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - runner: macos-15 | |
| platform: darwin | |
| arch: arm64 | |
| extra-arch: '' | |
| - runner: macos-15-intel | |
| platform: darwin | |
| arch: x64 | |
| extra-arch: '' | |
| - runner: windows-2022 | |
| platform: win32 | |
| arch: x64 | |
| extra-arch: ia32 | |
| - runner: ubuntu-24.04 | |
| platform: linux | |
| arch: x64 | |
| extra-arch: armv7l | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| # TranslationSession(installedSource:target:) requires the macOS 26 SDK. | |
| # The Intel macOS 15 image still defaults to Xcode 16.4. | |
| - name: Select Xcode 26.3 | |
| if: matrix.platform == 'darwin' | |
| run: | | |
| sudo xcode-select --switch /Applications/Xcode_26.3.app/Contents/Developer | |
| xcodebuild -version | |
| xcrun --sdk macosx --show-sdk-version | |
| - uses: actions/setup-node@v5 | |
| id: node | |
| with: | |
| node-version: '22' | |
| - uses: oven-sh/setup-bun@v2 | |
| id: bun | |
| with: | |
| bun-version: 1.3.14 | |
| # Native dependencies require the same host OS, CPU and exact Node version. | |
| # No partial restores: changed lockfiles always require a frozen Bun install. | |
| - name: Restore installed dependencies | |
| uses: actions/cache@v5 | |
| id: dependencies | |
| with: | |
| path: node_modules | |
| key: modules-bun-v1-${{ matrix.runner }}-${{ runner.arch }}-${{ steps.node.outputs.node-version }}-${{ steps.bun.outputs.bun-version }}-${{ hashFiles('package.json', 'bun.lock') }} | |
| - name: Install dependencies | |
| if: steps.dependencies.outputs.cache-hit != 'true' | |
| run: bun install --frozen-lockfile | |
| - name: Cache Electron downloads | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.cache/electron | |
| ~/Library/Caches/electron | |
| ~/AppData/Local/electron/Cache | |
| key: electron-v1-${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.extra-arch }}-${{ hashFiles('bun.lock', '.github/workflows/electron-build.yml') }} | |
| restore-keys: | | |
| electron-v1-${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.extra-arch }}- | |
| - name: Cache macOS icons and symbols | |
| if: matrix.platform == 'darwin' | |
| uses: actions/cache@v5 | |
| id: icons | |
| with: | |
| path: | | |
| electron/AppIcon.icns | |
| electron/AppIcon.ico | |
| electron/AppIcon.png | |
| public/symbols | |
| key: icons-v1-${{ matrix.runner }}-${{ hashFiles('doc/icon.png', 'electron/generate-icon.mjs', 'electron/export-symbols.swift', '.github/workflows/electron-build.yml') }} | |
| - name: Generate macOS icons and symbols | |
| if: matrix.platform == 'darwin' && steps.icons.outputs.cache-hit != 'true' | |
| run: bun run icons:mac | |
| # Both architectures share this host installation and frontend build. | |
| - name: Build frontend | |
| run: bun run build | |
| - name: Package primary architecture | |
| run: node electron/package.mjs --platform=${{ matrix.platform }} --arch=${{ matrix.arch }} --unsigned --distribute | |
| - name: Launch packaged application | |
| if: matrix.platform != 'linux' | |
| run: node electron/launch-check.mjs --platform=${{ matrix.platform }} --arch=${{ matrix.arch }} | |
| - name: Launch packaged application on Linux | |
| if: matrix.platform == 'linux' | |
| run: xvfb-run --auto-servernum node electron/launch-check.mjs --platform=linux --arch=x64 --no-sandbox | |
| - name: Package secondary architecture | |
| if: matrix.extra-arch != '' | |
| run: node electron/package.mjs --platform=${{ matrix.platform }} --arch=${{ matrix.extra-arch }} --electron-version=43.4.1 --unsigned --distribute | |
| - name: Upload primary app | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: PDFMathReader-${{ matrix.platform }}-${{ matrix.arch }} | |
| path: | | |
| release/PDFMathReader-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz | |
| release/PDFMathReader-${{ matrix.platform }}-${{ matrix.arch }}.zip | |
| release/PDFMathReader-${{ matrix.platform }}-${{ matrix.arch }}.exe | |
| if-no-files-found: error | |
| compression-level: 0 | |
| retention-days: 7 | |
| - name: Upload secondary app | |
| if: matrix.extra-arch != '' | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: PDFMathReader-${{ matrix.platform }}-${{ matrix.extra-arch }} | |
| path: | | |
| release/PDFMathReader-${{ matrix.platform }}-${{ matrix.extra-arch }}.tar.gz | |
| release/PDFMathReader-${{ matrix.platform }}-${{ matrix.extra-arch }}.zip | |
| release/PDFMathReader-${{ matrix.platform }}-${{ matrix.extra-arch }}.exe | |
| if-no-files-found: error | |
| compression-level: 0 | |
| retention-days: 7 |