-
Notifications
You must be signed in to change notification settings - Fork 3
300 lines (300 loc) · 14.7 KB
/
create_release.yml
File metadata and controls
300 lines (300 loc) · 14.7 KB
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
name: "Create Release"
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
build-ubuntu:
runs-on: ubuntu-latest
container:
image: ubuntu:20.04
env:
OPENTELEMETRY_MATLAB_INSTALL_FOLDER: "otel_matlab_install" # not including the context github.workspace since it doesn't work inside a container due to a bug
steps:
- name: Download OpenTelemetry-Matlab source
uses: actions/checkout@v3
with:
path: opentelemetry-matlab
- name: Install compiler and other tools
env:
DEBIAN_FRONTEND: "noninteractive"
run: apt update && apt install -y build-essential git curl pkg-config zip python3 ninja-build
- name: Install CMake
env:
MY_CMAKE_VERSION: 4.1.2
run: |
curl -LO https://github.com/Kitware/CMake/releases/download/v$MY_CMAKE_VERSION/cmake-$MY_CMAKE_VERSION-linux-x86_64.tar.gz
tar -xvzf cmake-$MY_CMAKE_VERSION-linux-x86_64.tar.gz
echo "$GITHUB_WORKSPACE/cmake-$MY_CMAKE_VERSION-linux-x86_64/bin" >> "$GITHUB_PATH"
- name: Install MATLAB
uses: matlab-actions/setup-matlab@v2
with:
release: R2025a
products: MATLAB_Compiler
- name: Build OpenTelemetry-Matlab
working-directory: opentelemetry-matlab
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DWITH_OTLP_GRPC=ON -DWITH_OTLP_FILE=ON -DOTEL_MATLAB_VERSION=${{ github.ref_name }} -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/$OPENTELEMETRY_MATLAB_INSTALL_FOLDER
cmake --build build --config Release --target install
- name: Compress into single artifact
run: tar -czf otel-matlab-ubuntu.tar.gz otel_matlab_install
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: otel-matlab-ubuntu.tar.gz
path: ./otel-matlab-ubuntu.tar.gz
build-windows:
runs-on: windows-latest
env:
OPENTELEMETRY_MATLAB_INSTALL: "${{ github.workspace }}/otel_matlab_install"
steps:
- name: Download OpenTelemetry-Matlab source
uses: actions/checkout@v3
with:
path: opentelemetry-matlab
- name: Install ninja-build
run: choco install ninja
- name: Install MATLAB
uses: matlab-actions/setup-matlab@v2
with:
release: R2025a
products: MATLAB_Compiler
- name: Build OpenTelemetry-Matlab
working-directory: opentelemetry-matlab
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
cmake -S . -B build -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE=Release -DWITH_OTLP_GRPC=ON -DWITH_OTLP_FILE=ON -DFETCH_VCPKG=ON -DOTEL_MATLAB_VERSION=${{ github.ref_name }} -DCMAKE_INSTALL_PREFIX=${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
cmake --build build --config Release --target install
- name: Compress into single artifact
working-directory: ${{ github.workspace }}
run: tar -czf otel-matlab-windows.tar.gz otel_matlab_install
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: otel-matlab-windows.tar.gz
path: ${{ github.workspace }}/otel-matlab-windows.tar.gz
build-macos:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-15-intel, macos-14] # runs on Mac with both Intel (macos-15-intel) and Apple Silicon (macos-14) processors
env:
OPENTELEMETRY_MATLAB_INSTALL: "${{ github.workspace }}/otel_matlab_install"
steps:
- name: Download OpenTelemetry-Matlab source
uses: actions/checkout@v3
with:
path: opentelemetry-matlab
- name: Install ninja-build
run: brew install ninja
- name: Install MATLAB
uses: matlab-actions/setup-matlab@v2
with:
release: R2025a
products: MATLAB_Compiler
- name: Build OpenTelemetry-Matlab
working-directory: opentelemetry-matlab
env:
CMAKE_POLICY_VERSION_MINIMUM: 3.5 # required by upb because its cmake requirement is not compatible with cmake 4
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DWITH_OTLP_GRPC=ON -DWITH_OTLP_FILE=ON -DOTEL_MATLAB_VERSION=${{ github.ref_name }} -DCMAKE_INSTALL_PREFIX=${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
cmake --build build --config Release --target install
- name: Compress into single artifact
working-directory: ${{ github.workspace }}
run: tar -czf otel-matlab-${{ matrix.os }}.tar.gz otel_matlab_install
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: otel-matlab-${{ matrix.os }}.tar.gz
path: ${{ github.workspace }}/otel-matlab-${{ matrix.os }}.tar.gz
nogrpc-ubuntu: # without gRPC exporter
runs-on: ubuntu-latest
container:
image: ubuntu:20.04
env:
OPENTELEMETRY_MATLAB_INSTALL_FOLDER: "otel_matlab_install" # not including the context github.workspace since it doesn't work inside a container due to a bug
steps:
- name: Download OpenTelemetry-Matlab source
uses: actions/checkout@v3
with:
path: opentelemetry-matlab
- name: Install compiler and other tools
env:
DEBIAN_FRONTEND: "noninteractive"
run: apt update && apt install -y build-essential git curl pkg-config zip python3 ninja-build
- name: Install CMake
env:
MY_CMAKE_VERSION: 4.1.2
run: |
curl -LO https://github.com/Kitware/CMake/releases/download/v$MY_CMAKE_VERSION/cmake-$MY_CMAKE_VERSION-linux-x86_64.tar.gz
tar -xvzf cmake-$MY_CMAKE_VERSION-linux-x86_64.tar.gz
echo "$GITHUB_WORKSPACE/cmake-$MY_CMAKE_VERSION-linux-x86_64/bin" >> "$GITHUB_PATH"
- name: Install MATLAB
uses: matlab-actions/setup-matlab@v2
with:
release: R2025a
products: MATLAB_Compiler
- name: Build OpenTelemetry-Matlab
working-directory: opentelemetry-matlab
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DWITH_OTLP_GRPC=OFF -DWITH_OTLP_FILE=ON -DOTEL_MATLAB_VERSION=${{ github.ref_name }} -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/$OPENTELEMETRY_MATLAB_INSTALL_FOLDER
cmake --build build --config Release --target install
- name: Compress into single artifact
run: tar -czf otel-matlab-nogrpc-ubuntu.tar.gz otel_matlab_install
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: otel-matlab-nogrpc-ubuntu.tar.gz
path: ./otel-matlab-nogrpc-ubuntu.tar.gz
nogrpc-windows: # without gRPC exporter
runs-on: windows-latest
env:
OPENTELEMETRY_MATLAB_INSTALL: "${{ github.workspace }}/otel_matlab_install"
steps:
- name: Download OpenTelemetry-Matlab source
uses: actions/checkout@v3
with:
path: opentelemetry-matlab
- name: Install ninja-build
run: choco install ninja
- name: Install MATLAB
uses: matlab-actions/setup-matlab@v2
with:
release: R2025a
products: MATLAB_Compiler
- name: Build OpenTelemetry-Matlab
working-directory: opentelemetry-matlab
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
cmake -S . -B build -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE=Release -DWITH_OTLP_GRPC=OFF -DWITH_OTLP_FILE=ON -DFETCH_VCPKG=ON -DOTEL_MATLAB_VERSION=${{ github.ref_name }} -DCMAKE_INSTALL_PREFIX=${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
cmake --build build --config Release --target install
- name: Compress into single artifact
working-directory: ${{ github.workspace }}
run: tar -czf otel-matlab-nogrpc-windows.tar.gz otel_matlab_install
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: otel-matlab-nogrpc-windows.tar.gz
path: ${{ github.workspace }}/otel-matlab-nogrpc-windows.tar.gz
nogrpc-macos: # without gRPC exporter
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-15-intel, macos-14] # runs on Mac with both Intel (macos-15-intel) and Apple Silicon (macos-14) processors
env:
OPENTELEMETRY_MATLAB_INSTALL: "${{ github.workspace }}/otel_matlab_install"
steps:
- name: Download OpenTelemetry-Matlab source
uses: actions/checkout@v3
with:
path: opentelemetry-matlab
- name: Install ninja-build
run: brew install ninja
- name: Install MATLAB
uses: matlab-actions/setup-matlab@v2
with:
release: R2025a
products: MATLAB_Compiler
- name: Build OpenTelemetry-Matlab
working-directory: opentelemetry-matlab
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DWITH_OTLP_GRPC=OFF -DWITH_OTLP_FILE=ON -DOTEL_MATLAB_VERSION=${{ github.ref_name }} -DCMAKE_INSTALL_PREFIX=${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
cmake --build build --config Release --target install
- name: Compress into single artifact
working-directory: ${{ github.workspace }}
run: tar -czf otel-matlab-nogrpc-${{ matrix.os }}.tar.gz otel_matlab_install
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: otel-matlab-nogrpc-${{ matrix.os }}.tar.gz
path: ${{ github.workspace }}/otel-matlab-nogrpc-${{ matrix.os }}.tar.gz
package-mltbx:
name: Package MATLAB Toolbox (MLTBX) Files
runs-on: ubuntu-22.04
permissions:
contents: write
needs:
- build-ubuntu
- build-windows
- build-macos
- nogrpc-ubuntu
- nogrpc-windows
- nogrpc-macos
env:
OPENTELEMETRY_MATLAB_INSTALL: "${{ github.workspace }}/otel_matlab_install"
WITHGRPC_FOLDER: "${{ github.workspace }}/withgrpc"
NOGRPC_FOLDER: "${{ github.workspace }}/nogrpc"
steps:
- name: Checkout OpenTelemetry-Matlab
uses: actions/checkout@v3
with:
path: OpenTelemetry-Matlab
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts-downloaded
- name: Decompress Artifacts
run: |
mkdir $WITHGRPC_FOLDER
cd $WITHGRPC_FOLDER
mv ../artifacts-downloaded/*/otel-matlab-ubuntu.tar.gz .
mv ../artifacts-downloaded/*/otel-matlab-macos*.tar.gz .
mv ../artifacts-downloaded/*/otel-matlab-windows.tar.gz .
tar -xzvf otel-matlab-ubuntu.tar.gz
tar -xzvf otel-matlab-macos-15-intel.tar.gz
tar -xzvf otel-matlab-macos-14.tar.gz
tar -xzvf otel-matlab-windows.tar.gz
- name: Decompress Artifacts without gRPC exporter
run: |
mkdir $NOGRPC_FOLDER
cd $NOGRPC_FOLDER
mv ../artifacts-downloaded/*/*nogrpc*.tar.gz .
tar -xzvf otel-matlab-nogrpc-ubuntu.tar.gz
tar -xzvf otel-matlab-nogrpc-macos-15-intel.tar.gz
tar -xzvf otel-matlab-nogrpc-macos-14.tar.gz
tar -xzvf otel-matlab-nogrpc-windows.tar.gz
- name: Install MATLAB
uses: matlab-actions/setup-matlab@v2
with:
release: R2025a
- name: Package Toolbox
env:
MATLABPATH: OpenTelemetry-Matlab/tools
WORKING_FOLDER: ${{ env.WITHGRPC_FOLDER }}
OTEL_MATLAB_TOOLBOX_FOLDER: otel_matlab_install
OTEL_MATLAB_TOOLBOX_OUTPUT_FOLDER: ${{ env.WITHGRPC_FOLDER }}
OTEL_MATLAB_TOOLBOX_VERSION: ${{ github.ref_name }}
OTEL_MATLAB_TOOLBOX_NAME: otel-matlab
uses: matlab-actions/run-command@v1
with:
command: packageMatlabInterface
- name: Package Toolbox without gRPC exporter
env:
MATLABPATH: OpenTelemetry-Matlab/tools
WORKING_FOLDER: ${{ env.NOGRPC_FOLDER }}
OTEL_MATLAB_TOOLBOX_FOLDER: otel_matlab_install
OTEL_MATLAB_TOOLBOX_OUTPUT_FOLDER: ${{ env.NOGRPC_FOLDER }}
OTEL_MATLAB_TOOLBOX_VERSION: ${{ github.ref_name }}
OTEL_MATLAB_TOOLBOX_NAME: otel-matlab-nogrpc
uses: matlab-actions/run-command@v1
with:
command: packageMatlabInterface
- name: Compress Toolbox without gRPC exporter
working-directory: ${{ env.NOGRPC_FOLDER }}
run: tar -czf otel-matlab-nogrpc.mltbx.tar.gz otel-matlab-nogrpc.mltbx
- name: Create release
uses: softprops/action-gh-release@v2
# Upload toolbox without gRPC exporter in compressed format
# This is to avoid multiple .mltbx files, which will cause issues in MATLAB File Exchange
with:
files: |
${{ env.WITHGRPC_FOLDER }}/otel-matlab.mltbx
${{ env.NOGRPC_FOLDER }}/otel-matlab-nogrpc.mltbx.tar.gz
name: "Version ${{ github.ref_name }}"
fail_on_unmatched_files: true
generate_release_notes: false
prerelease: false
make_latest: false
draft: true