3 Commits
15 changed files with 188 additions and 83 deletions
+12 -53
View File
@@ -1,4 +1,4 @@
name: Publish to npm
name: Build native binaries
on:
push:
@@ -12,10 +12,6 @@ jobs:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
- os: macos-latest
target: aarch64-apple-darwin
- os: macos-latest
@@ -68,62 +64,25 @@ jobs:
name: bindings-${{ matrix.target }}
path: gelectron_core.*.node
publish:
name: Publish to npm
release:
name: Attach binaries to GitHub Release
needs: build
runs-on: ubuntu-latest
environment: npm-publish
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- name: Download all platform packages
- name: Download all binaries
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: bindings-*
merge-multiple: true
- name: Install dependencies
run: npm ci
- name: List binaries
run: ls -la artifacts/
- name: Assemble platform packages
shell: bash
run: |
for node in artifacts/*.node; do
base="$(basename "$node")"
case "$base" in
*.darwin-x64.node) dir="npm/darwin-x64" ;;
*.darwin-arm64.node) dir="npm/darwin-arm64" ;;
*.win32-x64-msvc.node) dir="npm/win32-x64-msvc" ;;
*.win32-arm64-msvc.node) dir="npm/win32-arm64-msvc" ;;
*.linux-x64-gnu.node) dir="npm/linux-x64-gnu" ;;
*.linux-arm64-gnu.node) dir="npm/linux-arm64-gnu" ;;
esac
cp "$node" "$dir/$base"
done
echo "Assembled platform packages:"
ls -la npm/*/
- name: Publish platform packages
shell: bash
run: |
for dir in npm/*/; do
cd "$dir"
npm publish --access public
cd ../../
done
- name: Publish main package
run: |
npm run prepublishOnly
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Upload binaries to GitHub Release
uses: softprops/action-gh-release@v2
with:
files: artifacts/*.node
+1
View File
@@ -7,6 +7,7 @@ node_modules/
npm-debug.log*
package-lock.json
al/
# Build artifacts
*.node
*.dylib
+20 -2
View File
@@ -22,13 +22,31 @@ Electron bundles Chromium — ~300 MB per app with 500+ MB RSS. Gelectron uses t
## Quick Start
### Prerequisites
### Install from npm (recommended)
The built native binary and the Electron compatibility layer are published to npm. This is the main and easiest way to get Gelectron — no Rust toolchain required:
```bash
npm install -g gelectron-core
```
This installs the `gelectron-core` package, which bundles the pre-built native binary and the JS compatibility layer, and automatically pulls in the platform-specific addon for your operating system and CPU architecture (see the [package on npm](https://www.npmjs.com/package/gelectron-core)).
Once installed, run any Electron app with:
```bash
gelectron-core /path/to/electron-app
```
> The `gelectron-core` npm package is the recommended distribution channel. Building from source (below) is only needed if you're developing Gelectron itself or want the bleeding-edge version.
### Prerequisites (for building from source)
- Rust 1.75+ (`rustup.rs`)
- Node.js 18+
- npm
### Build & Run
### Build & Run (from source)
```bash
git clone https://github.com/mileswolfallen2/gelectron.git
+10 -4
View File
@@ -3,9 +3,15 @@
"version": "0.1.1",
"description": "Gelectron native addon for macOS ARM64",
"main": "gelectron_core.darwin-arm64.node",
"files": ["gelectron_core.darwin-arm64.node"],
"os": ["darwin"],
"cpu": ["arm64"],
"files": [
"gelectron_core.darwin-arm64.node"
],
"os": [
"darwin"
],
"cpu": [
"arm64"
],
"license": "MIT",
"author": "mileswa1q22"
}
}
+17
View File
@@ -0,0 +1,17 @@
# Gelectron (macOS x64)
Gelectron native addon for **macOS on x64 (Intel)**.
This package provides the native `gelectron_core` binary for macOS x64. It is an internal dependency of [`gelectron`](https://www.npmjs.com/package/gelectron) and is installed automatically — you should not need to install it directly.
> Gelectron is a drop-in replacement for Electron using native web views (WKWebView / WebView2 / WebKitGTK) instead of Chromium.
## Usage
Install the platform-specific addon for your system:
```bash
npm install gelectron
```
The correct platform binary is selected automatically via `optionalDependencies`.
+10 -4
View File
@@ -3,9 +3,15 @@
"version": "0.1.1",
"description": "Gelectron native addon for macOS x64",
"main": "gelectron_core.darwin-x64.node",
"files": ["gelectron_core.darwin-x64.node"],
"os": ["darwin"],
"cpu": ["x64"],
"files": [
"gelectron_core.darwin-x64.node"
],
"os": [
"darwin"
],
"cpu": [
"x64"
],
"license": "MIT",
"author": "mileswa1q22"
}
}
+17
View File
@@ -0,0 +1,17 @@
# Gelectron (Linux ARM64)
Gelectron native addon for **Linux on ARM64 (GNU)**.
This package provides the native `gelectron_core` binary for Linux ARM64. It is an internal dependency of [`gelectron`](https://www.npmjs.com/package/gelectron) and is installed automatically — you should not need to install it directly.
> Gelectron is a drop-in replacement for Electron using native web views (WKWebView / WebView2 / WebKitGTK) instead of Chromium.
## Usage
Install the platform-specific addon for your system:
```bash
npm install gelectron
```
The correct platform binary is selected automatically via `optionalDependencies`.
+10 -4
View File
@@ -3,9 +3,15 @@
"version": "0.1.1",
"description": "Gelectron native addon for Linux ARM64 (GNU)",
"main": "gelectron_core.linux-arm64-gnu.node",
"files": ["gelectron_core.linux-arm64-gnu.node"],
"os": ["linux"],
"cpu": ["arm64"],
"files": [
"gelectron_core.linux-arm64-gnu.node"
],
"os": [
"linux"
],
"cpu": [
"arm64"
],
"license": "MIT",
"author": "mileswa1q22"
}
}
+17
View File
@@ -0,0 +1,17 @@
# Gelectron (Linux x64)
Gelectron native addon for **Linux on x64 (GNU)**.
This package provides the native `gelectron_core` binary for Linux x64. It is an internal dependency of [`gelectron`](https://www.npmjs.com/package/gelectron) and is installed automatically — you should not need to install it directly.
> Gelectron is a drop-in replacement for Electron using native web views (WKWebView / WebView2 / WebKitGTK) instead of Chromium.
## Usage
Install the platform-specific addon for your system:
```bash
npm install gelectron
```
The correct platform binary is selected automatically via `optionalDependencies`.
+10 -4
View File
@@ -3,9 +3,15 @@
"version": "0.1.1",
"description": "Gelectron native addon for Linux x64 (GNU)",
"main": "gelectron_core.linux-x64-gnu.node",
"files": ["gelectron_core.linux-x64-gnu.node"],
"os": ["linux"],
"cpu": ["x64"],
"files": [
"gelectron_core.linux-x64-gnu.node"
],
"os": [
"linux"
],
"cpu": [
"x64"
],
"license": "MIT",
"author": "mileswa1q22"
}
}
+17
View File
@@ -0,0 +1,17 @@
# Gelectron (Windows ARM64)
Gelectron native addon for **Windows on ARM64**.
This package provides the native `gelectron_core` binary for Windows ARM64. It is an internal dependency of [`gelectron`](https://www.npmjs.com/package/gelectron) and is installed automatically — you should not need to install it directly.
> Gelectron is a drop-in replacement for Electron using native web views (WKWebView / WebView2 / WebKitGTK) instead of Chromium.
## Usage
Install the platform-specific addon for your system:
```bash
npm install gelectron
```
The correct platform binary is selected automatically via `optionalDependencies`.
+10 -4
View File
@@ -3,9 +3,15 @@
"version": "0.1.1",
"description": "Gelectron native addon for Windows ARM64",
"main": "gelectron_core.win32-arm64-msvc.node",
"files": ["gelectron_core.win32-arm64-msvc.node"],
"os": ["win32"],
"cpu": ["arm64"],
"files": [
"gelectron_core.win32-arm64-msvc.node"
],
"os": [
"win32"
],
"cpu": [
"arm64"
],
"license": "MIT",
"author": "mileswa1q22"
}
}
+17
View File
@@ -0,0 +1,17 @@
# Gelectron (Windows x64)
Gelectron native addon for **Windows on x64**.
This package provides the native `gelectron_core` binary for Windows x64. It is an internal dependency of [`gelectron`](https://www.npmjs.com/package/gelectron) and is installed automatically — you should not need to install it directly.
> Gelectron is a drop-in replacement for Electron using native web views (WKWebView / WebView2 / WebKitGTK) instead of Chromium.
## Usage
Install the platform-specific addon for your system:
```bash
npm install gelectron
```
The correct platform binary is selected automatically via `optionalDependencies`.
+10 -4
View File
@@ -3,9 +3,15 @@
"version": "0.1.1",
"description": "Gelectron native addon for Windows x64",
"main": "gelectron_core.win32-x64-msvc.node",
"files": ["gelectron_core.win32-x64-msvc.node"],
"os": ["win32"],
"cpu": ["x64"],
"files": [
"gelectron_core.win32-x64-msvc.node"
],
"os": [
"win32"
],
"cpu": [
"x64"
],
"license": "MIT",
"author": "mileswa1q22"
}
}
+10 -4
View File
@@ -1,10 +1,10 @@
{
"name": "gelectron",
"name": "gelectron-core",
"version": "0.1.1",
"description": "Firefox-engine alternative to Electron, powered by Servo",
"main": "src/electron/index.js",
"bin": {
"gelectron": "./cli/gelectron.js"
"gelectron-core": "./cli/gelectron.js"
},
"scripts": {
"build": "napi build --platform --release --package gelectron-core",
@@ -63,6 +63,12 @@
"gelectron-linux-arm64-gnu": "0.1.1",
"gelectron-linux-x64-gnu": "0.1.1",
"gelectron-win32-arm64-msvc": "0.1.1",
"gelectron-win32-x64-msvc": "0.1.1"
"gelectron-win32-x64-msvc": "0.1.1",
"gelectron-core-darwin-x64": "0.1.1",
"gelectron-core-darwin-arm64": "0.1.1",
"gelectron-core-win32-x64-msvc": "0.1.1",
"gelectron-core-win32-arm64-msvc": "0.1.1",
"gelectron-core-linux-x64-gnu": "0.1.1",
"gelectron-core-linux-arm64-gnu": "0.1.1"
}
}
}