Skip to content

ui(macOS): unify rounded settings controls and compact panel layout #32

ui(macOS): unify rounded settings controls and compact panel layout

ui(macOS): unify rounded settings controls and compact panel layout #32

name: Electron compile
on:
push:
branches:
- '**'
paths-ignore:
- '**/*.md'
- 'doc/**'
- '!doc/icon.png'
workflow_dispatch:
permissions:
contents: read
concurrency:
group: electron-compile-${{ github.ref }}
cancel-in-progress: true
jobs:
compile:
# For multi-commit pushes, evaluate the newest commit's message.
if: github.event_name == 'workflow_dispatch' || startsWith(github.event.head_commit.message, 'fix') || startsWith(github.event.head_commit.message, 'feat')
name: Compile ${{ matrix.platform }} ${{ matrix.arch }} ${{ matrix.extra-arch }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 30
env:
# Packaging downloads the target binary; npm 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
- uses: actions/setup-node@v5
id: node
with:
node-version: '22'
cache: npm
# Native dependencies require the same host OS, CPU and exact Node version.
# No partial restores: changed lockfiles always require npm ci.
- name: Restore installed dependencies
uses: actions/cache@v5
id: dependencies
with:
path: node_modules
key: modules-v1-${{ matrix.runner }}-${{ runner.arch }}-${{ steps.node.outputs.node-version }}-${{ hashFiles('package.json', 'package-lock.json') }}
- name: Install dependencies
if: steps.dependencies.outputs.cache-hit != 'true'
run: npm ci --prefer-offline --no-audit --no-fund
- 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('package-lock.json', '.github/workflows/electron-build.yml') }}
restore-keys: |
electron-v1-${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.extra-arch }}-
- name: Test PDF extraction without native architecture bindings
if: matrix.extra-arch != '' || (matrix.platform == 'darwin' && matrix.arch == 'x64')
run: node --test server/pdf-extractor.test.mjs
- 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: npm run icons:mac
# Both architectures share this host installation and frontend build.
- name: Test secure credential persistence
run: node --test server/credentials.test.mjs
- name: Build frontend
run: npm run build
- name: Package primary architecture
run: node electron/package.mjs --platform=${{ matrix.platform }} --arch=${{ matrix.arch }} --unsigned --distribute
- 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