chore(node-medley): update action version #160
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: | |
# This job builds on each platform directly | |
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@v4 | |
with: | |
node-version: ${{ matrix.node_version }} | |
architecture: ${{ matrix.node_arch }} | |
- uses: pnpm/action-setup@v4 | |
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@v4 | |
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@v4 | |
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@v4 | |
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: Test prebuilt module | |
working-directory: ./packages/node-medley | |
run: | | |
pnpm test | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.build-arch }} | |
path: ./packages/node-medley/prebuilds | |
# This job builds with Docker multi-platform on a self-hosted Apple Silicon machine | |
build-linux-arm64: | |
name: Build linux-arm64 | |
runs-on: [self-hosted, macOS, ARM64, docker] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Build native | |
working-directory: ./packages/node-medley | |
env: | |
ephemeral_container_id: node-medley-prebuild-${{ github.run_id }}-${{ github.run_attempt }} | |
run: | | |
docker build \ | |
--platform=linux/arm64 \ | |
-f ./builder/linux/Dockerfile \ | |
--progress=plain \ | |
-t node-medley-prebuild ../.. && \ | |
docker container create \ | |
--name ${{ env.ephemeral_container_id }} node-medley-prebuild && \ | |
docker cp \ | |
${{ env.ephemeral_container_id }}:/src/packages/node-medley/prebuilds ./ && \ | |
docker rm ${{ env.ephemeral_container_id }} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: linux-arm64 | |
path: ./packages/node-medley/prebuilds |