-
Notifications
You must be signed in to change notification settings - Fork 45
117 lines (103 loc) · 3.81 KB
/
publish_matlab_binaries.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
name: Publish MATLAB binaries
on:
release:
types: [published]
env:
BUILD_FOLDER: build
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-13, windows-latest]
include:
- os: ubuntu-latest
label: linux-64
prefix: /usr/share/miniconda3/envs/ezc3d
# - os: macos-latest
# label: osx-arm64
# prefix: /Users/runner/miniconda3/envs/ezc3d
- os: macos-13
label: osx-intel
prefix: /Users/runner/miniconda3/envs/ezc3d
- os: windows-latest
label: win-64
prefix: C:\Miniconda3\envs\ezc3d
name: ${{ matrix.label }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores
- name: Setup environment
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true
- name: Print mamba info
run: |
mamba info
mamba list
- name: Install dependencies
run: |
mamba install cmake git pkgconfig -cconda-forge
mamba list
git submodule update --init --recursive
- name: Install MATLAB on WINDOWS, LINUX and MACOS-Intel
uses: matlab-actions/setup-matlab@v2
with:
cache: true
if: matrix.label != 'osx-arm64'
- name: Install MATLAB on MACOS-Arm64
uses: matlab-actions/setup-matlab@v2
with:
# The version of MATLAB of R2024a does not contain MX_LIBRARY
release: R2023a
cache: true
if: matrix.label == 'osx-arm64'
- name: Build ezc3d on UNIX
run: |
MAIN_FOLDER=`pwd`
cd
HOME=`pwd`
cd $MAIN_FOLDER
CONDA_ENV_PATH=$CONDA/envs/ezc3d
mkdir -p $MAIN_FOLDER/$BUILD_FOLDER
cd $MAIN_FOLDER/$BUILD_FOLDER
cmake -DCMAKE_INSTALL_PREFIX=$CONDA_ENV_PATH -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=OFF -DBUILD_DOC=OFF -DBUILD_EXAMPLE=OFF -DUSE_MATRIX_FAST_ACCESSOR=OFF -DBINDER_MATLAB=ON -DMatlab_ezc3d_INSTALL_DIR=$HOME -DBINDER_PYTHON3=OFF ..
make install -j${{ steps.cpu-cores.outputs.count }}
cd $MAIN_FOLDER
if: matrix.label != 'win-64'
- name: Build ezc3d on WINDOWS
run: |
MAIN_FOLDER=`pwd`
CONDA_ENV_PATH=$CONDA/envs/ezc3d
mkdir -p $BUILD_FOLDER
cd $BUILD_FOLDER
cmake -G"Visual Studio 17 2022" -Ax64 -DCMAKE_INSTALL_PREFIX=$CONDA_ENV_PATH -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=OFF -DBUILD_DOC=OFF -DBUILD_EXAMPLE=OFF -DUSE_MATRIX_FAST_ACCESSOR=OFF -DBINDER_MATLAB=ON -DMatlab_ezc3d_INSTALL_DIR=$HOME -DBINDER_PYTHON3=OFF ..
cmake --build . --config Release --target install -j${{ steps.cpu-cores.outputs.count }}
cd $MAIN_FOLDER
if: matrix.label == 'win-64'
- name: Build MATLAB archives on UNIX
run: |
cp -r $HOME/ezc3d_matlab .
zip -r ezc3d_matlab_${{ matrix.label }}.zip ezc3d_matlab
if: matrix.label != 'win-64'
- name: Build MATLAB archives on WINDOWS
run: |
7z a ezc3d_matlab_${{ matrix.label }}.zip $HOME/ezc3d_matlab
if: matrix.label == 'win-64'
- name: Upload files to a GitHub release
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "ezc3d_matlab_${{ matrix.label }}.zip"
update_latest_release: true
verbose: true
overwrite: true