Skip to content

Build VCV Rack Plugin #82

Build VCV Rack Plugin

Build VCV Rack Plugin #82

name: Build VCV Rack Plugin
on:
workflow_dispatch:
inputs:
linux_x64:
description: 'Build Linux x64 plugin'
required: true
default: false
type: boolean
win_x64:
description: 'Build Windows x64 plugin'
required: true
default: false
type: boolean
mac_x64:
description: 'Build Mac x64 plugin'
required: true
default: false
type: boolean
mac_arm64:
description: 'Build Mac arm64 plugin'
required: true
default: false
type: boolean
push:
tags:
- 'vcv-v[0-9]+.[0-9]+.[0-9]+'
- 'debug-*'
branches:
- main
paths:
- '!**.json'
- '!**.md'
- '!**.svg'
env:
rack-sdk-version: latest
rack-plugin-toolchain-dir: /home/build/rack-plugin-toolchain
defaults:
run:
shell: bash
jobs:
build-lin-x64:
if: ${{ github.event_name == 'push' || inputs.linux_x64 || startsWith(github.ref, 'refs/tags/vcv-v') }}
name: lin-x64
runs-on: ubuntu-latest
container:
image: ghcr.io/4ms/rack-plugin-toolchain-win-linux
options: --user root
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build plugin
run: |
export PLUGIN_DIR=$GITHUB_WORKSPACE
pushd ${{ env.rack-plugin-toolchain-dir }}
curl -sL https://github.com/Kitware/CMake/releases/download/v3.24.3/cmake-3.24.3-linux-x86_64.sh -o cmakeinstall.sh
chmod +x cmakeinstall.sh
./cmakeinstall.sh --prefix=/usr/local --exclude-subdir
rm cmakeinstall.sh
make plugin-build-lin-x64
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: ${{ env.rack-plugin-toolchain-dir }}/plugin-build
name: lin-x64
build-win-x64:
if: ${{ inputs.win_x64 || startsWith(github.ref, 'refs/tags/vcv-v') }}
name: win-x64
runs-on: ubuntu-latest
container:
image: ghcr.io/4ms/rack-plugin-toolchain-win-linux
options: --user root
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build plugin
run: |
export PLUGIN_DIR=$GITHUB_WORKSPACE
pushd ${{ env.rack-plugin-toolchain-dir }}
curl -sL https://github.com/Kitware/CMake/releases/download/v3.24.3/cmake-3.24.3-linux-x86_64.sh -o cmakeinstall.sh
chmod +x cmakeinstall.sh
./cmakeinstall.sh --prefix=/usr/local --exclude-subdir
rm cmakeinstall.sh
make plugin-build-win-x64
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: ${{ env.rack-plugin-toolchain-dir }}/plugin-build
name: win-x64
build-mac-x64:
if: ${{ inputs.mac_x64 || startsWith(github.ref, 'refs/tags/vcv-v') }}
name: mac_x64
runs-on: macos-13
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Get Rack-SDK
run: |
pushd $HOME
wget -O Rack-SDK.zip https://vcvrack.com/downloads/Rack-SDK-${{ env.rack-sdk-version }}-mac-x64+arm64.zip
unzip Rack-SDK.zip
- name: Build plugin
run: |
export RACK_DIR=$HOME/Rack-SDK
export CROSS_COMPILE=x86_64-apple-darwin
make dep
make dist
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: dist/*.vcvplugin
name: mac-x64
build-mac-arm64:
if: ${{ inputs.mac_arm64 || startsWith(github.ref, 'refs/tags/vcv-v') }}
name: mac_arm64
runs-on: macos-13
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Get Rack-SDK
run: |
pushd $HOME
wget -O Rack-SDK.zip https://vcvrack.com/downloads/Rack-SDK-${{ env.rack-sdk-version }}-mac-x64+arm64.zip
unzip Rack-SDK.zip
- name: Build plugin
run: |
export RACK_DIR=$HOME/Rack-SDK
export CROSS_COMPILE=arm64-apple-darwin
make dep
make dist
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: dist/*.vcvplugin
name: mac-arm64
publish:
if: startsWith(github.ref, 'refs/tags/vcv-v')
name: Publish plugin
runs-on: ubuntu-24.04
needs: [build-lin-x64, build-win-x64, build-mac-x64, build-mac-arm64]
steps:
- uses: actions/download-artifact@v4
with:
path: _artifacts
- uses: FranzDiebold/github-env-vars-action@v2
- uses: softprops/action-gh-release@v1
with:
name: "Development Build: ${{ env.CI_REF_NAME }}"
body: "VCV plugin version as of tag ${{ env.CI_REF_NAME }}"
files: |
_artifacts/**/*.vcvplugin