Skip to content

Commit 2ed797d

Browse files
committed
create a second toolbox without gRPC exporter
1 parent 9bb6d4a commit 2ed797d

File tree

3 files changed

+131
-273
lines changed

3 files changed

+131
-273
lines changed

.github/workflows/create_release.yml

Lines changed: 130 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,98 @@ jobs:
9696
with:
9797
name: otel-matlab-${{ matrix.os }}.tar.gz
9898
path: ${{ github.workspace }}/otel-matlab-${{ matrix.os }}.tar.gz
99+
nogrpc-ubuntu: # without gRPC exporter
100+
runs-on: ubuntu-22.04
101+
env:
102+
OPENTELEMETRY_MATLAB_INSTALL: "${{ github.workspace }}/otel_matlab_install"
103+
steps:
104+
- name: Download OpenTelemetry-Matlab source
105+
uses: actions/checkout@v3
106+
with:
107+
path: opentelemetry-matlab
108+
- name: Install ninja-build
109+
run: sudo apt-get install ninja-build
110+
- name: Install MATLAB
111+
uses: matlab-actions/setup-matlab@v2
112+
with:
113+
release: R2025a
114+
products: MATLAB_Compiler
115+
- name: Build OpenTelemetry-Matlab
116+
working-directory: opentelemetry-matlab
117+
run: |
118+
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DWITH_OTLP_GRPC=OFF -DWITH_OTLP_FILE=ON -DCMAKE_INSTALL_PREFIX=${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
119+
cmake --build build --config Release --target install
120+
- name: Compress into single artifact
121+
working-directory: ${{ github.workspace }}
122+
run: tar -czf otel-matlab-nogrpc-ubuntu.tar.gz otel_matlab_install
123+
- name: Upload artifacts
124+
uses: actions/upload-artifact@v4
125+
with:
126+
name: otel-matlab-nogrpc-ubuntu.tar.gz
127+
path: ${{ github.workspace }}/otel-matlab-nogrpc-ubuntu.tar.gz
128+
nogrpc-windows: # without gRPC exporter
129+
runs-on: windows-latest
130+
env:
131+
OPENTELEMETRY_MATLAB_INSTALL: "${{ github.workspace }}/otel_matlab_install"
132+
steps:
133+
- name: Download OpenTelemetry-Matlab source
134+
uses: actions/checkout@v3
135+
with:
136+
path: opentelemetry-matlab
137+
- name: Install ninja-build
138+
run: choco install ninja
139+
- name: Install MATLAB
140+
uses: matlab-actions/setup-matlab@v2
141+
with:
142+
release: R2025a
143+
products: MATLAB_Compiler
144+
- name: Build OpenTelemetry-Matlab
145+
working-directory: opentelemetry-matlab
146+
shell: cmd
147+
run: |
148+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
149+
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 -DCMAKE_INSTALL_PREFIX=${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
150+
cmake --build build --config Release --target install
151+
- name: Compress into single artifact
152+
working-directory: ${{ github.workspace }}
153+
run: tar -czf otel-matlab-nogrpc-windows.tar.gz otel_matlab_install
154+
- name: Upload artifacts
155+
uses: actions/upload-artifact@v4
156+
with:
157+
name: otel-matlab-nogrpc-windows.tar.gz
158+
path: ${{ github.workspace }}/otel-matlab-nogrpc-windows.tar.gz
159+
nogrpc-macos: # without gRPC exporter
160+
runs-on: ${{ matrix.os }}
161+
strategy:
162+
matrix:
163+
os: [macos-13, macos-14] # runs on Mac with both Intel (macos-13) and Apple Silicon (macos-14) processors
164+
env:
165+
OPENTELEMETRY_MATLAB_INSTALL: "${{ github.workspace }}/otel_matlab_install"
166+
steps:
167+
- name: Download OpenTelemetry-Matlab source
168+
uses: actions/checkout@v3
169+
with:
170+
path: opentelemetry-matlab
171+
- name: Install ninja-build
172+
run: brew install ninja
173+
- name: Install MATLAB
174+
uses: matlab-actions/setup-matlab@v2
175+
with:
176+
release: R2025a
177+
products: MATLAB_Compiler
178+
- name: Build OpenTelemetry-Matlab
179+
working-directory: opentelemetry-matlab
180+
run: |
181+
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DWITH_OTLP_GRPC=OFF -DWITH_OTLP_FILE=ON -DCMAKE_INSTALL_PREFIX=${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
182+
cmake --build build --config Release --target install
183+
- name: Compress into single artifact
184+
working-directory: ${{ github.workspace }}
185+
run: tar -czf otel-matlab-nogrpc-${{ matrix.os }}.tar.gz otel_matlab_install
186+
- name: Upload artifacts
187+
uses: actions/upload-artifact@v4
188+
with:
189+
name: otel-matlab-nogrpc-${{ matrix.os }}.tar.gz
190+
path: ${{ github.workspace }}/otel-matlab-nogrpc-${{ matrix.os }}.tar.gz
99191
package-mltbx:
100192
name: Package MATLAB Toolbox (MLTBX) Files
101193
runs-on: ubuntu-22.04
@@ -105,6 +197,9 @@ jobs:
105197
- build-ubuntu
106198
- build-windows
107199
- build-macos
200+
- nogrpc-ubuntu
201+
- nogrpc-windows
202+
- nogrpc-macos
108203
env:
109204
OPENTELEMETRY_MATLAB_INSTALL: "${{ github.workspace }}/otel_matlab_install"
110205
steps:
@@ -118,28 +213,60 @@ jobs:
118213
path: artifacts-downloaded
119214
- name: Decompress Artifacts
120215
run: |
121-
mv artifacts-downloaded/*/*.tar.gz .
216+
mkdir withgrpc
217+
cd withgrpc
218+
mv ../artifacts-downloaded/*/otel-matlab-ubuntu.tar.gz .
219+
mv ../artifacts-downloaded/*/otel-matlab-macos*.tar.gz .
220+
mv ../artifacts-downloaded/*/otel-matlab-windows.tar.gz .
122221
tar -xzvf otel-matlab-ubuntu.tar.gz
123222
tar -xzvf otel-matlab-macos-13.tar.gz
124223
tar -xzvf otel-matlab-macos-14.tar.gz
125224
tar -xzvf otel-matlab-windows.tar.gz
225+
- name: Decompress Artifacts without gRPC exporter
226+
run: |
227+
mkdir nogrpc
228+
cd nogrpc
229+
mv ../artifacts-downloaded/*/*nogrpc*.tar.gz .
230+
tar -xzvf otel-matlab-nogrpc-ubuntu.tar.gz
231+
tar -xzvf otel-matlab-nogrpc-macos-13.tar.gz
232+
tar -xzvf otel-matlab-nogrpc-macos-14.tar.gz
233+
tar -xzvf otel-matlab-nogrpc-windows.tar.gz
126234
- name: Install MATLAB
127235
uses: matlab-actions/setup-matlab@v2
128236
with:
129237
release: R2025a
130-
- name: Run commands
238+
- name: Package Toolbox
239+
env:
240+
MATLABPATH: OpenTelemetry-Matlab/tools
241+
WORKING_FOLDER: withgrpc
242+
OTEL_MATLAB_TOOLBOX_FOLDER: otel_matlab_install
243+
OTEL_MATLAB_TOOLBOX_OUTPUT_FOLDER:
244+
OTEL_MATLAB_TOOLBOX_VERSION: ${{ github.ref_name }}
245+
OTEL_MATLAB_TOOLBOX_NAME: otel-matlab
246+
uses: matlab-actions/run-command@v1
247+
with:
248+
command: packageMatlabInterface
249+
- name: Package Toolbox without gRPC exporter
131250
env:
132251
MATLABPATH: OpenTelemetry-Matlab/tools
252+
WORKING_FOLDER: nogrpc
133253
OTEL_MATLAB_TOOLBOX_FOLDER: otel_matlab_install
134254
OTEL_MATLAB_TOOLBOX_OUTPUT_FOLDER:
135255
OTEL_MATLAB_TOOLBOX_VERSION: ${{ github.ref_name }}
256+
OTEL_MATLAB_TOOLBOX_NAME: otel-matlab-nogrpc
136257
uses: matlab-actions/run-command@v1
137258
with:
138259
command: packageMatlabInterface
260+
- name: Compress Toolbox without gRPC exporter
261+
run: tar -czf otel-matlab-nogrpc.mltbx.tar.gz otel-matlab-nogrpc.mltbx
139262
- name: Create release
140263
uses: softprops/action-gh-release@v2
264+
# Upload toolbox without gRPC exporter in compressed format
265+
# This is to avoid multiple .mltbx files, which will cause issues in MATLAB File Exchange
141266
with:
142-
files: ./otel-matlab.mltbx
267+
files: |
268+
./otel-matlab.mltbx
269+
./otel-matlab-nogrpc.mltbx.tar.gz
143270
name: "Version ${{ github.ref_name }}"
144271
fail_on_unmatched_files: true
145272
generate_release_notes: false

0 commit comments

Comments
 (0)