Skip to content

Various updates

Various updates #1

Workflow file for this run

name: Build
on:
pull_request: {}
push:
tags:
- "*"
jobs:
build:
strategy:
matrix:
os:
- macos-15
- macos-15-arm64
- ubuntu-24.04
- windows-2025
name: "Build ${{ matrix.os }}"
runs-on: "${{ matrix.os }}"
steps:
- name: Checkout
uses: actions/checkout@v4.3.0
with:
submodules: true
- name: Prepare node.js
uses: actions/setup-node@v4.4.0
with:
node-version-file: .nvmrc
# Don't compile anything yet, prebuild will do a clean rebuild anyway so
# compiling anything here is just a waste of time.
- name: Install dependencies only
run: npm ci --ignore-scripts
- name: Check source code formatting
run: npm run chkfmt
- name: Compile native code as a prebuild
run: npm run prebuild
- name: Run tests
run: npm test
- name: Emit artifact
uses: actions/upload-artifact@v4.6.2
with:
name: "prebuild-${{ matrix.os }}"
path: prebuilds
publish:
name: Publish release
needs: build
runs-on: ubuntu-24.04
if: "${{ startsWith(github.ref, 'refs/tags/') }}"
steps:
- name: Checkout
uses: actions/checkout@v4.3.0
with:
submodules: true
- name: Prepare node.js
uses: actions/setup-node@v4.4.0
with:
node-version-file: .nvmrc
registry-url: "https://registry.npmjs.org"
# Skip install scripts so that we do not needlessly compile native code
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Pull Darwin x86 artifact
uses: actions/download-artifact@v5.0.0
with:
name: prebuild-macos-15
path: prebuilds
- name: Pull Darwin ARM64 artifact
uses: actions/download-artifact@v5.0.0
with:
name: prebuild-macos-15-arm64
path: prebuilds
- name: Pull Linux artifact
uses: actions/download-artifact@v5.0.0
with:
name: prebuild-ubuntu-24.04
path: prebuilds
- name: Pull Windows artifact
uses: actions/download-artifact@v5.0.0
with:
name: prebuild-windows-2025
path: prebuilds
- name: Build API documentation
run: npm run docs
- name: Publish API documentation
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
github_token: "${{ github.token }}"
commit_message: "${{ github.event.head_commit.message }}"
publish_dir: ./docs
- name: Publish to NPM
run: npm publish
env:
NODE_AUTH_TOKEN: "${{ secrets.NPM_TOKEN }}"