GitHub actions for ARM mac cross compile

My diff didn’t do that! Not quite sure why it is happening. It is certainly not on purpose.

Wonder if something changed in 2.2.0 with the make dist rule and we need to adjust?

Is your plugin on gh somewhere that I can look?

And thanks for the try-an-actions link. useful!

Sorry, my plugin is closed source, for, er hrm… reasons

But I literally just copied your yaml, removed the parts I didn’t want and ended up with this:

name: Build VCV Rack Plugin
on: [push]

env:
  rack-sdk-version: 2.2.0
  rack-plugin-toolchain-dir: /home/build/rack-plugin-toolchain

defaults:
  run:
    shell: bash

jobs:

  build:
    name: ${{ matrix.platform }}
    runs-on: ubuntu-latest
    container:
      image: ghcr.io/qno/rack-plugin-toolchain-win-linux
      options: --user root
    strategy:
      fail-fast: false
      matrix:
        platform: [win, linux]
    steps:
      - uses: actions/checkout@v3
        with:
          submodules: recursive
      - uses: actions/cache@v3
        id: plugin-version-cache
        with:
          path: plugin.json
          key: ${{ github.sha }}-${{ github.run_id }}
      - name: Build plugin
        run: |
          export PLUGIN_DIR=$GITHUB_WORKSPACE
          pushd ${{ env.rack-plugin-toolchain-dir }}
          make plugin-build-${{ matrix.platform }}
      - name: Upload artifact
        uses: actions/upload-artifact@v3
        with:
          path: ${{ env.rack-plugin-toolchain-dir }}/plugin-build
          name: ${{ matrix.platform }}

  build-mac:
    name: mac
    needs: modify-plugin-version
    runs-on: macos-12
    strategy:
      fail-fast: false
      matrix:
        platform: [x64, arm64]
    steps:
      - uses: actions/checkout@v3
        with:
          submodules: recursive
      - uses: actions/cache@v3
        id: plugin-version-cache
        with:
          path: plugin.json
          key: ${{ github.sha }}-${{ github.run_id }}
      - name: Get Rack-SDK
        run: |
          pushd $HOME
          curl -o Rack-SDK.zip https://vcvrack.com/downloads/Rack-SDK-${{ env.rack-sdk-version }}-mac-${{ matrix.platform }}.zip
          unzip Rack-SDK.zip
      - name: Patch Rack-SDK for arm64
        if: ${{ matrix.platform == 'arm64' }}
        run: |
          patch -ruN -d $HOME/Rack-SDK < ./scripts/rack-sdk-220-cross.patch
      - name: Build plugin
        run: |
          export RACK_DIR=$HOME/Rack-SDK
          export CROSS_COMPILE=${{ matrix.platform }}
          make -j dep
          make -j dist
          lipo -archs plugin.dylib
      - name: Upload artifact
        uses: actions/upload-artifact@v3
        with:
          path: dist
          name: mac-${{ matrix.platform }}

Is something in my Makefile an issue? It does have some detritus from when I was trying to test the plugin previosuly

# If RACK_DIR is not defined when calling the Makefile, default to two directories above
RACK_DIR ?= ../..

# FLAGS will be passed to both the C and C++ compiler
FLAGS +=
CFLAGS +=
CXXFLAGS +=

# Careful about linking to shared libraries, since you can't assume much about the user's environment and library search path.
# Static libraries are fine, but they should be added to this plugin's build system.
LDFLAGS +=

# Add .cpp files to the build
SOURCES += $(wildcard src/*.cpp)
SOURCES += $(wildcard src/common/*.cpp)

# Add files to the ZIP package when running `make dist`
# The compiled plugin and "plugin.json" are automatically added.
DISTRIBUTABLES += res
DISTRIBUTABLES += font
DISTRIBUTABLES += presets
DISTRIBUTABLES += $(wildcard LICENSE*)

# Include the Rack plugin Makefile framework
include $(RACK_DIR)/plugin.mk

mytests: build/test/runtests
	./build/test/runtests

mytestsall: build/test/runtests
	./build/test/runtests --success

build/test/runtests: testsuite
	g++ -o $@ $(wildcard build/test/*.cpp.o)

testsuite:
	mkdir -p build/test
	g++ -c -std=c++11 -Wall -Wextra -I./ -MMD -MP -o ./build/test/defcatch.cpp.o         ./src/tests/defcatch.cpp
	g++ -c -std=c++11 -Wall -Wextra -I./ -MMD -MP -o ./build/test/common.cpp.o           ./src/common.cpp
	g++ -c -std=c++11 -Wall -Wextra -I./ -MMD -MP -o ./build/test/common_test.cpp.o      ./src/tests/common_test.cpp
	g++ -c -std=c++11 -Wall -Wextra -I./ -MMD -MP -o ./build/test/5splice_imp.cpp.o      ./src/5splice_imp.cpp
	g++ -c -std=c++11 -Wall -Wextra -I./ -MMD -MP -o ./build/test/5splice_imp_test.cpp.o ./src/tests/5splice_imp_test.cpp

that all looks fine to me. odd.

if you build on a mac do you get the inflated vcv also?

i should of course see if th esmae thing happens for our builds :slight_smile:

haven’t tried that recently, might be a little while before I can get around to it (my imac has been gathering dust for about a year)…

incidentally, I copied the same yaml over to my new experimental plugin and the same thing happened there, so I don’t think the Makefile is the cause

maybe this would help as well

Thanks for another pointer… I will check that out!