build and release #21
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
on: | |
workflow_dispatch: | |
name: build and release | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
# matrix: | |
# os: [macos-latest] | |
# host: [arm64] | |
# target: [arm64] | |
# node: [20] | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
host: [x64] | |
target: [x64] | |
node: [20] | |
include: | |
- os: windows-latest | |
host: x86 | |
target: x86 | |
node: 20 | |
- os: macos-latest | |
host: arm64 | |
target: arm64 | |
node: 20 | |
name: os=${{ matrix.os }} host=${{ matrix.host }}, target=${{ matrix.target }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node }} | |
architecture: ${{ matrix.host }} | |
- name: add setuptools for python 3.12 | |
if: matrix.os != 'macos-m1' | |
run: pip install setuptools | |
- name: Add msbuild to PATH | |
uses: microsoft/[email protected] | |
if: contains(matrix.os, 'windows') | |
with: | |
msbuild-architecture: ${{ matrix.target }} | |
- name: install x11 dev | |
if: contains(matrix.os,'ubuntu') | |
run: sudo apt-get install xorg-dev | |
- name: Install dependencies | |
run: npm install --build-from-source | |
- name: Build | |
run: npm run pack | |
- name: release | |
env: | |
NODE_PRE_GYP_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: npm run release |