Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
14 changes: 12 additions & 2 deletions scripts/download-pdfium.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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) {
Expand Down