-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from samizdatco/neon-napi
Rewrite bindings using Neon's N-API backend
- Loading branch information
Showing
55 changed files
with
6,264 additions
and
6,541 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
name: Compile binaries | ||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
x86-platform: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- macos-latest | ||
- windows-latest | ||
- ubuntu-18.04 | ||
node: | ||
- 15 | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Use Rust | ||
uses: actions-rs/[email protected] | ||
with: | ||
toolchain: stable | ||
|
||
- name: Build module | ||
run: | | ||
npm ci --ignore-scripts | ||
npm run build -- --release | ||
- name: Bundle ICU data (windows only) | ||
if: startsWith(matrix.os,'windows') | ||
shell: bash | ||
run: | | ||
ICU=$(find . -name icudtl.dat | grep skia-bindings | head -n 1) | ||
cp $ICU lib/v6 | ||
- name: Package module | ||
run: | | ||
npm test | ||
npm run package | ||
- name: Upload to S3 | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
run: | | ||
npm run upload | ||
apple-silicon: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: | ||
- macos-latest | ||
node: | ||
- 15 | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Use Rust | ||
uses: actions-rs/[email protected] | ||
with: | ||
target: aarch64-apple-darwin | ||
toolchain: nightly | ||
override: true | ||
|
||
- name: Inspect xcode paths | ||
run: | | ||
SDK=$(xcodebuild -showsdks -json | jq -r '.[] | .canonicalName' | grep '^macosx' | tail -n 1) | ||
echo "SDKROOT=$(xcrun -sdk $SDK --show-sdk-path)" >> $GITHUB_ENV | ||
echo "MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk $SDK --show-sdk-platform-version)" >> $GITHUB_ENV | ||
- name: Build & package module | ||
run: | | ||
npm ci --ignore-scripts | ||
npm run build -- --release --target aarch64-apple-darwin | ||
sed -i.bak 's/"package_name":.*/"package_name": "{platform}-arm64-{node_napi_label}.tar.gz",/' package.json | ||
npm run package | ||
- name: Upload to S3 | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
run: | | ||
npm run upload |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Publish to NPM | ||
on: | ||
workflow_dispatch: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
publish: | ||
name: Publish to NPM | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 15 | ||
|
||
- name: Publish to NPM | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: npm publish --dry-run |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: New release | ||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
new-release: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Auto-generate release | ||
uses: marvinpinto/[email protected] | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
prerelease: false | ||
draft: true |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Run tests | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
- neon-napi | ||
- gl | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
run-tests: | ||
name: Rebuild & Test | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- macos-latest | ||
- windows-latest | ||
- ubuntu-18.04 | ||
node: | ||
- 10 | ||
- 15 | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Use Rust | ||
uses: actions-rs/[email protected] | ||
with: | ||
toolchain: stable | ||
|
||
- name: Build module | ||
run: | | ||
npm ci --ignore-scripts | ||
npm run build | ||
- name: Bundle ICU data (windows only) | ||
if: startsWith(matrix.os,'windows') | ||
shell: bash | ||
run: | | ||
ICU=$(find . -name icudtl.dat | grep skia-bindings | head -n 1) | ||
cp $ICU lib/v6 | ||
- name: Run tests | ||
run: npm test |
This file contains 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
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[package] | ||
name = "skia-canvas" | ||
version = "0.9.21" | ||
description = "A canvas environment for Node" | ||
authors = ["Christian Swinehart <[email protected]>"] | ||
license = "MIT" | ||
edition = "2018" | ||
exclude = ["index.node"] | ||
|
||
[lib] | ||
crate-type = ["cdylib"] | ||
|
||
[dependencies] | ||
css-color = "0.1.1" | ||
lazy_static = "1.4.0" | ||
|
||
[dependencies.neon] | ||
version = "0.8" | ||
default-features = false | ||
features = ["napi-6"] | ||
|
||
[dependencies.skia-safe] | ||
version = "0.39.1" | ||
features = ["textlayout"] |
Oops, something went wrong.