Skip to content

Merge pull request #22 from seamless-medley/develop #120

Merge pull request #22 from seamless-medley/develop

Merge pull request #22 from seamless-medley/develop #120

Workflow file for this run

name: node-medley native module
on:
push:
branches:
- main
paths:
- .github/workflows/node-medley.yml
- packages/engine/src/**
- packages/node-medley/src/**
- packages/node-medley/scripts/**
- packages/node-medley/binding.gyp
- packages/node-medley/package.json
jobs:
build:
strategy:
matrix:
include:
- runs-on: ubuntu-20.04
node_version: 18
node_arch: x64
build-arch: linux-x64
- runs-on: windows-latest
node_version: 18
node_arch: x64
build-arch: win32-x64
- runs-on: macos-12
node_version: 18
node_arch: x64
build-arch: darwin-x64
- runs-on: [self-hosted, macOS, ARM64]
node_version: 18
node_arch: arm64
build-arch: darwin-arm64
name: Build ${{ matrix.build-arch }}
runs-on: ${{ matrix.runs-on }}
env:
BUILD_ARCH: ${{ matrix.build-arch }}
DEPS_INSTALL: ./packages/node-medley/scripts/install-deps.sh
steps:
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
architecture: ${{ matrix.node_arch }}
- uses: pnpm/action-setup@v2
with:
version: latest
- name: Make sure pnpm fetch Node
shell: bash
run: |
pnpm &>/dev/null || true
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-${{ runner.arch }}-pnpm-store-native-build
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-pnpm-store-native-build
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Dependencies (Linux)
if: contains(matrix.build-arch, 'linux')
run: |
sudo apt -y update && sudo apt -y install g++ make cmake pkg-config libasound2-dev
- name: Dependencies
if: contains(matrix.build-arch, 'darwin') || contains(matrix.build-arch, 'linux')
run: |
mkdir -p ./build/deps
cp ${{ env.DEPS_INSTALL }} ./build/deps/
cd ./build/deps
sh install-deps.sh
- name: Cache vcpkg
if: contains(matrix.build-arch, 'win32')
uses: actions/cache@v3
with:
path: |
C:\vcpkg\packages
C:\vcpkg\installed
key: windows-build-vcpkg-cache
- name: Dependencies (Windows)
if: contains(matrix.build-arch, 'win32')
run: |
vcpkg integrate install
vcpkg install libsamplerate:x64-windows-static taglib:x64-windows-static zlib:x64-windows-static
- name: Prepare
working-directory: ./packages/node-medley
run: |
pnpm install --no-frozen-lockfile --ignore-scripts
- name: Build native
working-directory: ./packages/node-medley
run: |
pnpm run prebuild
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.build-arch }}
path: ./packages/node-medley/prebuilds