|
| 1 | +name: Build and release plugin |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + SDK_branch: |
| 7 | + description: 'MetaModule SDK branch' |
| 8 | + required: true |
| 9 | + type: choice |
| 10 | + options: |
| 11 | + - main |
| 12 | + - v2.0-dev |
| 13 | + do_release: |
| 14 | + description: 'Create Release (must also tag!)' |
| 15 | + required: true |
| 16 | + default: false |
| 17 | + type: boolean |
| 18 | + |
| 19 | +jobs: |
| 20 | + build-lin: |
| 21 | + if: ${{ github.event_name == 'push' }} |
| 22 | + strategy: |
| 23 | + matrix: |
| 24 | + gcc: ['12.3.Rel1'] # can add other versions if needed |
| 25 | + name: "Build firmware on linux" |
| 26 | + runs-on: ubuntu-24.04 |
| 27 | + steps: |
| 28 | + - name: Install Arm GNU Toolchain (arm-none-eabi-gcc) |
| 29 | + uses: carlosperate/arm-none-eabi-gcc-action@v1 |
| 30 | + with: |
| 31 | + release: ${{ matrix.gcc }} |
| 32 | + |
| 33 | + - name: Install cmake |
| 34 | + |
| 35 | + with: |
| 36 | + cmake-version: '3.26.x' |
| 37 | + |
| 38 | + - name: Git setup |
| 39 | + run: git config --global --add safe.directory '*' |
| 40 | + |
| 41 | + - name: Checkout |
| 42 | + uses: actions/checkout@v4 |
| 43 | + with: |
| 44 | + submodules: 'recursive' |
| 45 | + |
| 46 | + - name: Install linux dependencies |
| 47 | + run: | |
| 48 | + sudo apt-get update |
| 49 | + sudo apt-get install ninja-build |
| 50 | +
|
| 51 | + - name: Set Release Version |
| 52 | + if: startsWith(github.ref, 'refs/tags/') |
| 53 | + uses: FranzDiebold/github-env-vars-action@v2 |
| 54 | + |
| 55 | + - name: Build |
| 56 | + run: | |
| 57 | + mkdir -p metamodule-plugins |
| 58 | + git clone -b ${{ inputs.SDK_branch }} https://github.com/4ms/metamodule-plugin-sdk --recursive |
| 59 | + cmake -B build -G Ninja -DMETAMODULE_SDK_DIR=metamodule-plugin-sdk -DINSTALL_DIR=metamodule-plugins |
| 60 | + cmake --build build |
| 61 | + cd metamodule-plugins |
| 62 | + for f in *.mmplugin; do mv $f ${{ env.CI_REF_NAME }}.mmplugin; done; |
| 63 | +
|
| 64 | + - name: Release |
| 65 | + if: startsWith(github.ref, 'refs/tags/') && ${{ inputs.do_release }} |
| 66 | + uses: softprops/action-gh-release@v1 |
| 67 | + with: |
| 68 | + name: "Release: ${{ env.CI_REF_NAME }}" |
| 69 | + files: | |
| 70 | + metamodule-plugins/*.mmplugin |
| 71 | +
|
0 commit comments