forked from onera/Cassiopee
-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (95 loc) · 3.49 KB
/
publish-pypi.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
name: publish PyPI
on:
push:
tags:
- 'v*'
# branches:
# - 'main'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install twine
- name: Pull manylinux2014 image
run: docker pull quay.io/pypa/manylinux2014_x86_64
- name: Build Cassiopee in a Docker container
run: |
docker run --rm -v $GITHUB_WORKSPACE:/io quay.io/pypa/manylinux2014_x86_64:latest /bin/bash -c "
export PATH=/opt/python/cp312-cp312/bin:\$PATH &&
yum update && yum install -y \
gcc \
gcc-c++ \
gcc-gfortran \
openmpi \
openmpi-devel \
hdf5 \
hdf5-devel \
tk \
mesa-libGL \
mesa-libGL-devel \
mesa-libGLU \
mesa-libGLU-devel \
mesa-libOSMesa \
mesa-libOSMesa-devel \
libX11-devel \
libXext-devel \
libXmu-devel \
libXi-devel \
libXrender-devel \
libpng-devel \
zlib-devel \
xorg-x11-server-devel \
OCE-devel \
OCE-draw \
OCE-foundation \
OCE-modeling \
OCE-ocaf \
OCE-visualization &&
export CPATH=/usr/include/oce:\$CPATH &&
export PATH=/usr/lib64/oce-0.17/bin:\$PATH &&
export LD_LIBRARY_PATH=/usr/lib64/oce-0.17:\$LD_LIBRARY_PATH &&
export OCCT_ROOT=/usr/include/oce &&
export OCCT_INCLUDE_DIR=/usr/include/oce &&
export OCCT_LIBRARY_DIR=/usr/lib64/oce-0.17 &&
pip3 install \
wheel \
auditwheel \
setuptools \
scons \
numpy &&
export PATH=/usr/lib64/openmpi/bin:\$PATH &&
export LD_LIBRARY_PATH=/usr/lib64/openmpi/lib:\$LD_LIBRARY_PATH &&
export CFLAGS="-std=c99" &&
pip3 install mpi4py &&
export CFLAGS="-std=c11" &&
python --version && python -m pip list &&
export CASSIOPEE=/io &&
export MACHINE=azure &&
cd \$CASSIOPEE/Cassiopee &&
. \$CASSIOPEE/Cassiopee/Envs/sh_Cassiopee_r8 &&
sed -i "s/OCC//g" MODULES &&
./install &&
cd \$CASSIOPEE/Dist/bin/\$ELSAPROD &&
find . -type f -name '*-4.0-cp312-cp312-linux_x86_64.whl' -exec mv {} . \;
for wheel in \$(find . -maxdepth 1 -name '*.whl'); do auditwheel repair \$wheel; done
"
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
export CASSIOPEE=$GITHUB_WORKSPACE
export MACHINE=azure
. $CASSIOPEE/Cassiopee/Envs/sh_Cassiopee_r8
ls $CASSIOPEE/Dist/bin/$ELSAPROD/wheelhouse/
cd $CASSIOPEE/Dist/bin/$ELSAPROD/
twine upload --verbose wheelhouse/*.whl