Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
vittee committed May 23, 2024
2 parents ec167eb + a2f7dc2 commit 5558221
Show file tree
Hide file tree
Showing 36 changed files with 702 additions and 254 deletions.
63 changes: 50 additions & 13 deletions .github/workflows/node-medley.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
- packages/node-medley/binding.gyp
- packages/node-medley/package.json
jobs:
# This job builds on each platform directly
build:
strategy:
matrix:
Expand All @@ -25,29 +26,30 @@ jobs:
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]
- 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
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
architecture: ${{ matrix.node_arch }}

- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
with:
version: 8.15.5

Expand All @@ -62,7 +64,7 @@ jobs:
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
Expand All @@ -71,7 +73,7 @@ jobs:
${{ runner.os }}-${{ runner.arch }}-pnpm-store-native-build
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive

Expand All @@ -90,7 +92,7 @@ jobs:
- name: Cache vcpkg
if: contains(matrix.build-arch, 'win32')
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
C:\vcpkg\packages
Expand All @@ -111,12 +113,47 @@ jobs:
- name: Build native
working-directory: ./packages/node-medley
run: |
pnpm run prebuild
pnpm prebuild
- name: Test prebuilt module
working-directory: ./packages/node-medley
run: |
pnpm test
- name: Upload artifacts
uses: actions/upload-artifact@v3
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
8 changes: 4 additions & 4 deletions .github/workflows/publish-node-medley.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Install Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
architecture: x64
registry-url: https://registry.npmjs.org

- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
with:
version: 8.15.5

Expand All @@ -37,7 +37,7 @@ jobs:
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
- uses: actions/cache@v4
name: Setup pnpm cache
# if: ${{ !github.event.act }}
with:
Expand All @@ -47,7 +47,7 @@ jobs:
${{ runner.os }}-${{ runner.arch }}-pnpm-store-native-build
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive

Expand Down
Loading

0 comments on commit 5558221

Please sign in to comment.