diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 75a247e..86d24d0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,6 +22,11 @@ jobs: artifact: release/*.AppImage - os: macos-latest platform: mac + arch: x64 + artifact: release/*.dmg + - os: macos-14 + platform: mac + arch: arm64 artifact: release/*.dmg runs-on: ${{ matrix.os }} @@ -40,7 +45,7 @@ jobs: run: npm ci - name: Download PDFium binaries - run: node scripts/download-pdfium.js + run: node scripts/download-pdfium.js ${{ matrix.arch && format('--{0}', matrix.arch) || '' }} - name: Build native addon run: npm run build:native @@ -49,14 +54,14 @@ jobs: run: npm run build - name: Build installer - run: npm run dist:${{ matrix.platform }} + run: npm run dist:${{ matrix.platform }} ${{ matrix.platform == 'mac' && format('-- --{0}', matrix.arch) || '' }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: installer-${{ matrix.platform }} + name: installer-${{ matrix.platform }}${{ matrix.arch && format('-{0}', matrix.arch) || '' }} path: | release/*.exe release/*.dmg diff --git a/package.json b/package.json index 61f93e9..d5988d1 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "dist:linux": "electron-builder --linux", "build:msi": "node scripts/build-msi.js" }, - "author": "", + "author": "Carme99", "license": "MIT", "devDependencies": { "@playwright/test": "^1.58.2", diff --git a/scripts/download-pdfium.js b/scripts/download-pdfium.js index 9328a15..3c05083 100644 --- a/scripts/download-pdfium.js +++ b/scripts/download-pdfium.js @@ -3,7 +3,7 @@ * Download prebuilt PDFium shared library from bblanchon/pdfium-binaries. * Extracts to native/pdfium/vendor/{include,lib,bin}. * - * Usage: node scripts/download-pdfium.js + * Usage: node scripts/download-pdfium.js [--x64|--arm64] */ 'use strict'; @@ -90,7 +90,17 @@ function download(url, destPath) { } async function main() { - const key = `${process.platform}-${process.arch}`; + // Parse command-line flags for cross-compilation support + const args = process.argv.slice(2); + let arch = process.arch; // Default to current system arch + + if (args.includes('--x64')) { + arch = 'x64'; + } else if (args.includes('--arm64')) { + arch = 'arm64'; + } + + const key = `${process.platform}-${arch}`; const name = PLATFORM_MAP[key]; if (!name) {