-
Notifications
You must be signed in to change notification settings - Fork 3
128 lines (128 loc) · 5.3 KB
/
publish.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
name: "Publish"
on:
workflow_dispatch:
push:
branches:
- package
jobs:
build-ubuntu:
runs-on: ubuntu-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 MATLAB
uses: matlab-actions/setup-matlab@v2
with:
products: MATLAB_Compiler
- name: Build OpenTelemetry-Matlab
run: |
cd opentelemetry-matlab
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DWITH_EXAMPLES=ON -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-ubuntu.tar.gz otel_matlab_install
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: otel-matlab-ubuntu.tar.gz
path: ${{ github.workspace }}/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 MATLAB
uses: matlab-actions/setup-matlab@v2
with:
products: MATLAB_Compiler
- name: Build OpenTelemetry-Matlab
run: |
cd opentelemetry-matlab
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -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@v2
with:
name: otel-matlab-windows.tar.gz
path: ${{ github.workspace }}/otel-matlab-windows.tar.gz
build-macos:
runs-on: macos-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 MATLAB
uses: matlab-actions/setup-matlab@v2
with:
products: MATLAB_Compiler
- name: Build OpenTelemetry-Matlab
run: |
cd opentelemetry-matlab
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DWITH_EXAMPLES=ON -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-macos.tar.gz otel_matlab_install
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: otel-matlab-macos.tar.gz
path: ${{ github.workspace }}/otel-matlab-macos.tar.gz
package-mltbx:
name: Package MATLAB Toolbox (MLTBX) Files
runs-on: ubuntu-latest
needs:
- build-ubuntu
- build-windows
- build-macos
env:
OPENTELEMETRY_MATLAB_INSTALL: "${{ github.workspace }}/otel_matlab_install"
steps:
- name: Checkout OpenTelemetry-Matlab
uses: actions/checkout@v3
with:
path: OpenTelemetry-Matlab
- name: Read version
id: getversion
run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
path: artifacts-downloaded
- name: Decompress Artifacts
run: |
mv artifacts-downloaded/*/*.tar.gz .
tar -xzvf otel-matlab-ubuntu.tar.gz
tar -xzvf otel-matlab-macos.tar.gz
tar -xzvf otel-matlab-windows.tar.gz
- name: Install MATLAB
uses: matlab-actions/setup-matlab@v1
- name: Run commands
env:
MATLABPATH: OpenTelemetry-Matlab/tools
OTEL_MATLAB_TOOLBOX_FOLDER: otel_matlab_install
OTEL_MATLAB_TOOLBOX_OUTPUT_FOLDER:
OTEL_MATLAB_TOOLBOX_VERSION: ${{ steps.getversion.outputs.version }}
uses: matlab-actions/run-command@v1
with:
command: packageMatlabInterface
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: otel-matlab.mltbx
path: otel-matlab.mltbx