Skip to content

Commit 1f1efa2

Browse files
committed
test packaging
1 parent ccdd0b9 commit 1f1efa2

File tree

2 files changed

+164
-0
lines changed

2 files changed

+164
-0
lines changed

.github/workflows/build_and_test_simple.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
branches-ignore:
77
- 'main'
88
- '[0-9]+.[0-9]+.[0-9]+'
9+
- 'missing_symlinks'
910
env:
1011
MLM_LICENSE_TOKEN: ${{ secrets.MLM_LICENSE_TOKEN }}
1112
jobs:
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
name: "Create Release"
2+
on:
3+
push:
4+
branches:
5+
- 'missing_symlinks'
6+
jobs:
7+
build-ubuntu:
8+
runs-on: ubuntu-latest
9+
container:
10+
image: ubuntu:20.04
11+
env:
12+
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
13+
steps:
14+
- name: Download OpenTelemetry-Matlab source
15+
uses: actions/checkout@v3
16+
with:
17+
path: opentelemetry-matlab
18+
- name: Install compiler and other tools
19+
env:
20+
DEBIAN_FRONTEND: "noninteractive"
21+
run: apt update && apt install -y build-essential git curl pkg-config zip python3 ninja-build
22+
- name: Install CMake
23+
env:
24+
MY_CMAKE_VERSION: 4.1.2
25+
run: |
26+
curl -LO https://github.com/Kitware/CMake/releases/download/v$MY_CMAKE_VERSION/cmake-$MY_CMAKE_VERSION-linux-x86_64.tar.gz
27+
tar -xvzf cmake-$MY_CMAKE_VERSION-linux-x86_64.tar.gz
28+
echo "$GITHUB_WORKSPACE/cmake-$MY_CMAKE_VERSION-linux-x86_64/bin" >> "$GITHUB_PATH"
29+
- name: Install MATLAB
30+
uses: matlab-actions/setup-matlab@v2
31+
with:
32+
release: R2025a
33+
products: MATLAB_Compiler
34+
- name: Build OpenTelemetry-Matlab
35+
working-directory: opentelemetry-matlab
36+
run: |
37+
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DWITH_OTLP_GRPC=ON -DWITH_OTLP_FILE=ON -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/$OPENTELEMETRY_MATLAB_INSTALL_FOLDER
38+
cmake --build build --config Release --target install
39+
- name: Compress into single artifact
40+
run: tar -czf otel-matlab-ubuntu.tar.gz otel_matlab_install
41+
- name: Upload artifacts
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: otel-matlab-ubuntu.tar.gz
45+
path: ./otel-matlab-ubuntu.tar.gz
46+
build-windows:
47+
runs-on: windows-latest
48+
env:
49+
OPENTELEMETRY_MATLAB_INSTALL: "${{ github.workspace }}/otel_matlab_install"
50+
steps:
51+
- name: Download OpenTelemetry-Matlab source
52+
uses: actions/checkout@v3
53+
with:
54+
path: opentelemetry-matlab
55+
- name: Install ninja-build
56+
run: choco install ninja
57+
- name: Install MATLAB
58+
uses: matlab-actions/setup-matlab@v2
59+
with:
60+
release: R2025a
61+
products: MATLAB_Compiler
62+
- name: Build OpenTelemetry-Matlab
63+
working-directory: opentelemetry-matlab
64+
shell: cmd
65+
run: |
66+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
67+
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 -DCMAKE_INSTALL_PREFIX=${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
68+
cmake --build build --config Release --target install
69+
- name: Compress into single artifact
70+
working-directory: ${{ github.workspace }}
71+
run: tar -czf otel-matlab-windows.tar.gz otel_matlab_install
72+
- name: Upload artifacts
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: otel-matlab-windows.tar.gz
76+
path: ${{ github.workspace }}/otel-matlab-windows.tar.gz
77+
build-macos:
78+
runs-on: ${{ matrix.os }}
79+
strategy:
80+
matrix:
81+
os: [macos-13, macos-14] # runs on Mac with both Intel (macos-13) and Apple Silicon (macos-14) processors
82+
env:
83+
OPENTELEMETRY_MATLAB_INSTALL: "${{ github.workspace }}/otel_matlab_install"
84+
steps:
85+
- name: Download OpenTelemetry-Matlab source
86+
uses: actions/checkout@v3
87+
with:
88+
path: opentelemetry-matlab
89+
- name: Install ninja-build
90+
run: brew install ninja
91+
- name: Install MATLAB
92+
uses: matlab-actions/setup-matlab@v2
93+
with:
94+
release: R2025a
95+
products: MATLAB_Compiler
96+
- name: Build OpenTelemetry-Matlab
97+
working-directory: opentelemetry-matlab
98+
env:
99+
CMAKE_POLICY_VERSION_MINIMUM: 3.5 # required by upb because its cmake requirement is not compatible with cmake 4
100+
run: |
101+
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DWITH_OTLP_GRPC=ON -DWITH_OTLP_FILE=ON -DCMAKE_INSTALL_PREFIX=${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
102+
cmake --build build --config Release --target install
103+
- name: Compress into single artifact
104+
working-directory: ${{ github.workspace }}
105+
run: tar -czf otel-matlab-${{ matrix.os }}.tar.gz otel_matlab_install
106+
- name: Upload artifacts
107+
uses: actions/upload-artifact@v4
108+
with:
109+
name: otel-matlab-${{ matrix.os }}.tar.gz
110+
path: ${{ github.workspace }}/otel-matlab-${{ matrix.os }}.tar.gz
111+
package-mltbx:
112+
name: Package MATLAB Toolbox (MLTBX) Files
113+
runs-on: windows-latest
114+
permissions:
115+
contents: write
116+
needs:
117+
- build-ubuntu
118+
- build-windows
119+
- build-macos
120+
env:
121+
OPENTELEMETRY_MATLAB_INSTALL: "${{ github.workspace }}/otel_matlab_install"
122+
WITHGRPC_FOLDER: "${{ github.workspace }}/withgrpc"
123+
NOGRPC_FOLDER: "${{ github.workspace }}/nogrpc"
124+
steps:
125+
- name: Checkout OpenTelemetry-Matlab
126+
uses: actions/checkout@v3
127+
with:
128+
path: OpenTelemetry-Matlab
129+
- name: Download Artifacts
130+
uses: actions/download-artifact@v4
131+
with:
132+
path: artifacts-downloaded
133+
- name: Decompress Artifacts
134+
run: |
135+
mkdir $WITHGRPC_FOLDER
136+
cd $WITHGRPC_FOLDER
137+
move ../artifacts-downloaded/*/otel-matlab-ubuntu.tar.gz .
138+
move ../artifacts-downloaded/*/otel-matlab-macos*.tar.gz .
139+
move ../artifacts-downloaded/*/otel-matlab-windows.tar.gz .
140+
tar -xzvf otel-matlab-ubuntu.tar.gz
141+
tar -xzvf otel-matlab-macos-13.tar.gz
142+
tar -xzvf otel-matlab-macos-14.tar.gz
143+
tar -xzvf otel-matlab-windows.tar.gz
144+
- name: Install MATLAB
145+
uses: matlab-actions/setup-matlab@v2
146+
with:
147+
release: R2025a
148+
- name: Package Toolbox
149+
env:
150+
MATLABPATH: OpenTelemetry-Matlab/tools
151+
WORKING_FOLDER: ${{ env.WITHGRPC_FOLDER }}
152+
OTEL_MATLAB_TOOLBOX_FOLDER: otel_matlab_install
153+
OTEL_MATLAB_TOOLBOX_OUTPUT_FOLDER: ${{ env.WITHGRPC_FOLDER }}
154+
OTEL_MATLAB_TOOLBOX_VERSION: ${{ github.ref_name }}
155+
OTEL_MATLAB_TOOLBOX_NAME: otel-matlab
156+
uses: matlab-actions/run-command@v1
157+
with:
158+
command: packageMatlabInterface
159+
- name: Upload artifacts
160+
uses: actions/upload-artifact@v4
161+
with:
162+
name: otel-matlab.mltbx.tar.gz
163+
path: ${{ github.workspace }}/otel-matlab.mltbx

0 commit comments

Comments
 (0)