-
Notifications
You must be signed in to change notification settings - Fork 0
173 lines (152 loc) · 4.75 KB
/
build_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
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
- Venom
- "./"
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
- 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