Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: alphacep/ref-napi
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: latest
Choose a base ref
...
head repository: larriereguichet/alphacep-ref-napi
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: latest
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 4 commits
  • 5 files changed
  • 1 contributor

Commits on Dec 2, 2021

  1. Fix docs compiling

    lutangar committed Dec 2, 2021
    Copy the full SHA
    84c3085 View commit details
  2. Setup CI via Github actions

    lutangar committed Dec 2, 2021
    Copy the full SHA
    631d275 View commit details
  3. Change package name

    lutangar committed Dec 2, 2021
    Copy the full SHA
    71efad1 View commit details
  4. Bump package version

    lutangar committed Dec 2, 2021
    Copy the full SHA
    4eef76b View commit details
Showing with 131 additions and 6 deletions.
  1. +92 −0 .github/workflows/release.yml
  2. +31 −0 .github/workflows/test.yml
  3. +2 −0 .gitignore
  4. +3 −3 docs/compile.js
  5. +3 −3 package.json
92 changes: 92 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Release

on:
push:
tags: ['*']

jobs:
prebuilds:
strategy:
matrix:
include:
- os: ubuntu-latest
arch: x64
- os: macos-latest
arch: x64
- os: windows-latest
arch: x86
- os: windows-latest
arch: x64
runs-on: ${{ matrix.os }}
name: Build ${{ matrix.os }} ${{ matrix.arch }}
env:
NODE_VERSION: 16
VERSION_NAME: ${{ github.ref_name }}-${{ matrix.os }}-${{ matrix.arch }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Set up node ${{ env.NODE_VERSION }}
uses: actions/setup-node@v2
with:
registry-url: 'https://registry.npmjs.org'
node-version: ${{ env.NODE_VERSION }}
architecture: ${{ matrix.arch }}
- name: Install dependencies
shell: bash
run: npm install --build-from-source
- name: Build the docs
run: npm run docs
- name: Prebuild ${{ env.VERSION_NAME }}
shell: bash
run: npm run prebuild --v8_enable_pointer_compression=false --v8_enable_31bit_smis_on_64bit_arch=false
- name: Create artifact
shell: bash
run: |
tar -zcvf $ARCHIVE_NAME -C prebuilds .
stat "$ARCHIVE_NAME"
env:
ARCHIVE_NAME: ${{ env.VERSION_NAME }}.tar.gz
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ${{ env.VERSION_NAME }}
path: ${{ env.VERSION_NAME }}.tar.gz
retention-days: 1

release_and_publish:
runs-on: ubuntu-latest
needs: prebuilds
permissions:
contents: write
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Set up node ${{ env.NODE_VERSION }}
uses: actions/setup-node@v2
with:
registry-url: 'https://registry.npmjs.org'
- run: npm install --build-from-source
- name: Build the docs
run: npm run docs
- name: Download artifacts
uses: actions/download-artifact@v2
with:
path: prebuilds
- name: Create ${{ github.ref }} release
uses: softprops/action-gh-release@v1
with:
files: prebuilds/*/*.tar.gz
env:
ARCHIVE_NAME: ${{ github.ref_name }}-${{ runner.os }}-${{ runner.arch }}.tar
- run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test

on: [push, pull_request]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
node-version: [10.x, 12.x, 14.x, 15.x, 16.x]
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Install dependencies and test
shell: bash
run: |
npm install --build-from-source
npm test
- name: Test build
shell: bash
run: npm run prebuild
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -19,3 +19,5 @@ build
node-addon-api

prebuilds/

docs/index.html
6 changes: 3 additions & 3 deletions docs/compile.js
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@

var fs = require('fs')
var dox = require('dox')
var jade = require('jade')
var jade = require('pug')
var marked = require('marked')
var hljs = require('highlight.js')
var assert = require('assert')
@@ -146,8 +146,8 @@ function markdown (code) {
*/

function highlight (code, lang) {
if (!hljs.LANGUAGES.hasOwnProperty(lang)) {
if (!hljs.listLanguages().hasOwnProperty(lang)) {
lang = 'javascript'
}
return hljs.highlight(lang, code).value
return hljs.highlight(code, { language: lang }).value
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "ref-napi",
"name": "@larriereguichet/ref-napi",
"description": "Turn Buffer instances into \"pointers\"",
"engines": {
"node": ">= 10.0"
@@ -21,7 +21,7 @@
"64",
"napi"
],
"version": "4.0.0",
"version": "4.0.1",
"license": "MIT",
"author": "Anna Henningsen <anna@addaleax.net>",
"repository": {
@@ -34,7 +34,7 @@
"test": "nyc mocha --expose-gc",
"install": "node-gyp-build",
"prebuild": "prebuildify --napi --tag-armv",
"prepack": "prebuildify-ci download && ([ $(ls prebuilds | wc -l) = '5' ] || (echo 'Some prebuilds are missing'; exit 1))"
"prepack": "npm run prebuild && ([ $(ls prebuilds | wc -l) = '5' ] || (echo 'Some prebuilds are missing'; exit 1))"
},
"dependencies": {
"debug": "^4.3.1"