Skip to content

Build and release plugins #83

Build and release plugins

Build and release plugins #83

Workflow file for this run

name: Build and release plugins
on:
workflow_dispatch:
inputs:
plugin:
description: 'Plugin to build'
required: true
type: choice
options:
- Airwindows
- Bogaudio
- ChowDSP
- CountModula
- CVfunk
- DrumKit
- Geodesics
- kocmoc
- NANOModules
- OrangeLine
- RebelTech
- CosineKitty-Sapphire
- Fundamental
- Valley
- "./"
do_release:
description: 'Create Release (must also tag!)'
required: true
default: false
type: boolean
linux_x64:
description: 'Build on Linux'
required: true
default: true
type: boolean
# win_x64:
# description: 'build on Windows (no releases)'
# required: true
# default: false
# type: boolean
macos:
description: 'build on Mac (no releases)'
required: true
default: false
type: boolean
jobs:
build-lin:
if: ${{ github.event_name == 'push' || inputs.linux_x64 }}
strategy:
matrix:
gcc: ['12.3.Rel1'] # can add other versions if needed
name: "Build firmware on linux"
runs-on: ubuntu-24.04
steps:
- name: Install Arm GNU Toolchain (arm-none-eabi-gcc)
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: ${{ matrix.gcc }}
- name: Install cmake
uses: jwlawson/actions-setup-cmake@v1.13
with:
cmake-version: '3.26.x'
- name: Git setup
run: git config --global --add safe.directory '*'
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Install linux dependencies
run: |
sudo apt-get update
sudo apt-get install ninja-build
- name: Set Release Version
if: startsWith(github.ref, 'refs/tags/')
uses: FranzDiebold/github-env-vars-action@v2
# Convert $CI_REF_NAME to $PLUGIN_NAME
# CI_REF_NAME = CVfunk-v1.5.3
# $f = CVfunk.mmplugin
# if input.plugin == "./"
- name: Build
run: |
mkdir -p metamodule-plugins
cd ${{ inputs.plugin }}
cmake -B build -G Ninja -DMETAMODULE_SDK_DIR=../metamodule-plugin-sdk -DINSTALL_DIR=${{ github.workspace }}/metamodule-plugins
cmake --build build
cd ${{ github.workspace }}/metamodule-plugins/
if [ "${{ inputs.plugin }}" == "./" ]; then for f in *.mmplugin; do mv $f ${f%.mmplugin}-${{ env.CI_REF_NAME }}.mmplugin; done; else for f in *.mmplugin; do mv $f ${{ env.CI_REF_NAME }}.mmplugin; done; fi
- name: Release
if: startsWith(github.ref, 'refs/tags/') && ${{ inputs.do_release }}
uses: softprops/action-gh-release@v1
with:
name: "Release: ${{ env.CI_REF_NAME }}"
files: |
metamodule-plugins/*.mmplugin
build-win:
if: ${{ inputs.win_x64 }}
name: "Build firmware on windows"
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: Install windows dependencies
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: git make mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja
path-type: inherit
- name: Install Arm GNU Toolchain (arm-none-eabi-gcc)
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: '12.3.Rel1'
- name: Git setup
run: |
git config --global --add safe.directory '*'
git config --global core.longpaths true
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Build
run: |
cd ${{ inputs.plugin }}
cmake -B build -G Ninja
cmake --build build
build-mac-x64:
if: ${{ github.event_name == 'push' || inputs.macos }}
strategy:
matrix:
gcc: ['12.3.Rel1'] # can add other versions if needed
name: "Build firmware on mac x64"
runs-on: macos-latest
steps:
- name: Install Arm GNU Toolchain (arm-none-eabi-gcc)
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: ${{ matrix.gcc }}
- name: Install cmake
uses: jwlawson/actions-setup-cmake@v1.13
with:
cmake-version: '3.26.x'
- name: Git setup
run: git config --global --add safe.directory '*'
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Install mac dependencies
run: |
brew install ninja
- name: Build
run: |
cd ${{ inputs.plugin }}
cmake -B build -G Ninja
cmake --build build