chore: clean up #141
Workflow file for this run
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
name: node-medley native module | |
on: | |
push: | |
branches: | |
- main | |
- feature/node-medley-arm64 | |
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-14 | |
node_version: 18 | |
node_arch: arm64 | |
build-arch: darwin-arm64 | |
# macos-14 runner is arm64, use macos-13 instead | |
- runs-on: macos-13 | |
node_version: 18 | |
node_arch: x64 | |
build-arch: darwin-x64 | |
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: 8.15.5 | |
- 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 prebuild | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.build-arch }} | |
path: ./packages/node-medley/prebuilds | |
build-linux-arm64: | |
name: Build linux-arm64 | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build native | |
working-directory: ./packages/node-medley | |
run: | | |
docker build --platform=linux/arm64 -f ./builder/linux/Dockerfile --progress=plain -t node-medley-prebuild ../.. && docker container create --name node-medley-prebuild-cp node-medley-prebuild && docker cp node-medley-prebuild-cp:/src/packages/node-medley/prebuilds ./ && docker rm node-medley-prebuild-cp | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: linux-arm64 | |
path: ./packages/node-medley/prebuilds |