60 lines
1.5 KiB
YAML
60 lines
1.5 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
tags:
|
|
- v*
|
|
pull_request:
|
|
|
|
jobs:
|
|
build:
|
|
name: ${{ matrix.friendlyName }}
|
|
runs-on: ${{ matrix.os }}
|
|
timeout-minutes: 10
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
node: [20.12.2]
|
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
|
include:
|
|
- os: macos-latest
|
|
friendlyName: macOS
|
|
- os: windows-latest
|
|
friendlyName: Windows
|
|
- os: ubuntu-20.04
|
|
friendlyName: Linux
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
- name: Use Node.js ${{ matrix.node }}
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node }}
|
|
- name: Install Python setup tools
|
|
run: |
|
|
python -m pip install --upgrade setuptools packaging
|
|
- name: Install and build
|
|
run: |
|
|
yarn install
|
|
yarn build
|
|
- name: Lint
|
|
run: yarn lint
|
|
- name: Test
|
|
run: yarn test
|
|
shell: bash
|
|
- name: Prebuild (x64)
|
|
run: npm run prebuild-napi-x64
|
|
- name: Prebuild (arm64)
|
|
run: npm run prebuild-napi-arm64
|
|
if: ${{ matrix.os != 'ubuntu-latest' }}
|
|
- name: Prebuild (Windows x86)
|
|
run: npm run prebuild-napi-ia32
|
|
if: ${{ matrix.os == 'windows-latest' }}
|
|
- name: Publish
|
|
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
|
|
run: yarn prebuild --upload-all ${{ secrets.GITHUB_TOKEN }}
|