Skip to content

Build and release MetaModule plugin #4

Build and release MetaModule plugin

Build and release MetaModule plugin #4

name: Build and release MetaModule plugin
on:
workflow_dispatch:
inputs:
SDK_branch:
description: 'MetaModule SDK branch'
required: true
type: choice
options:
- main
- v2.0-dev
do_release:
description: 'Create Release (must also select Tag above!")'
required: true
default: false
type: boolean
jobs:
build-lin:
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/[email protected]
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
- name: Build
run: |
mkdir -p metamodule-plugins
git clone -b ${{ inputs.SDK_branch }} https://github.com/4ms/metamodule-plugin-sdk --recursive
cmake -B build -G Ninja -DMETAMODULE_SDK_DIR=metamodule-plugin-sdk -DINSTALL_DIR=metamodule-plugins
cmake --build build
# Optional: add version tag to the plugin file name:
# cd metamodule-plugins && for f in *.mmplugin; do mv $f ${f%.mmplugin}-${{ env.CI_REF_NAME }}.mmplugin; done;
- 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