From 5c37c22457af23868aa790f03aa5b26243991227 Mon Sep 17 00:00:00 2001 From: vincentcasseau Date: Tue, 15 Oct 2024 13:21:58 +0200 Subject: [PATCH] PyPI: fix install on azure with prodmode 2 --- .github/workflows/publish-pypi.yml | 91 ++++++++++++++++++++++++++++++ Cassiopee/KCore/install | 2 +- Cassiopee/XCore/install | 2 +- 3 files changed, 93 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/publish-pypi.yml diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml new file mode 100644 index 000000000..a47860786 --- /dev/null +++ b/.github/workflows/publish-pypi.yml @@ -0,0 +1,91 @@ +name: publish PyPI + +on: + push: + tags: + - 'v*' + branches: + - 'main' + +jobs: + build: + runs-on: ubuntu-20.04 +# strategy: +# matrix: +# python-version: ["3.8", "3.12"] + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.8" +# python-version: ${{ matrix.python-version }} + + - name: Install system dependencies + run: | + sudo apt-get update && sudo apt-get install -y \ + gcc \ + g++ \ + gfortran \ + libopenmpi-dev \ + libhdf5-openmpi-dev \ + python3-tk \ + mesa-common-dev \ + libgl1-mesa-dev \ + libglu1-mesa-dev \ + libosmesa6-dev \ + xorg-dev + + - name: Install Python dependencies + run: | + python -m pip install --upgrade pip + pip install wheel twine auditwheel setuptools scons numpy mpi4py + + - name: Verify Python and Installed Packages + run: | + python --version + python -m pip list + + - name: Build Cassiopee package + run: | + export CASSIOPEE=$GITHUB_WORKSPACE + export MACHINE=azure + . $CASSIOPEE/Cassiopee/Envs/sh_Cassiopee_r8 + cd $CASSIOPEE/Cassiopee + echo -e "FREEMODULES='KCore XCore Converter Geom Transform Generator Post Initiator Connector Distributor2 Dist2Walls RigidMotion Compressor Modeler Intersector Apps CPlot'\nexport FREEMODULES\nFULLMODULES='KCore XCore Converter Geom Transform Generator Post Initiator Connector Distributor2 Dist2Walls RigidMotion Compressor Modeler Intersector Apps CPlot'\nexport FULLMODULES\nOTHERS=''" > $CASSIOPEE/Cassiopee/MODULES + ./install + + - 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 + for wheel in $(find $CASSIOPEE/Dist/bin/$ELSAPROD/pip-ephem-wheel-cache-* -type f -name "*.whl"); do + echo "$wheel" + auditwheel -v repair "$wheel" + done + find $CASSIOPEE/Dist/bin/$ELSAPROD/pip-ephem-wheel-cache-* -type f -name "*manylinux*.whl" -exec twine upload {} + + +# publish: +# runs-on: ubuntu-latest +# needs: build +# steps: +# - name: Checkout repository +# uses: actions/checkout@v3 +# +# - name: Set up Python +# uses: actions/setup-python@v4 +# with: +# python-version: "3.12" +# +# - name: Publish to PyPI +# env: +# TWINE_USERNAME: __token__ +# TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} +# run: find -name "*.whl" -exec twine upload {} + diff --git a/Cassiopee/KCore/install b/Cassiopee/KCore/install index 12f3a8f26..dbd3f9805 100755 --- a/Cassiopee/KCore/install +++ b/Cassiopee/KCore/install @@ -41,7 +41,7 @@ if [ "$PRODMODE" = "" ]; then fi # Compilation et installation -if [ $PRODMODE -le 1 ]; then +if [ $PRODMODE -le 2 ]; then sconsf=`which scons` if [ "$OMP_NUM_THREADS" != "" ]; then export SCONSOPT="-j $OMP_NUM_THREADS" diff --git a/Cassiopee/XCore/install b/Cassiopee/XCore/install index 54c1907d7..46f35b6a8 100755 --- a/Cassiopee/XCore/install +++ b/Cassiopee/XCore/install @@ -43,7 +43,7 @@ fi #python createLinks.py # Compilation et installation -if [ $PRODMODE -le 1 ]; then +if [ $PRODMODE -le 2 ]; then sconsf=`which scons` if [ "$OMP_NUM_THREADS" != "" ]; then export SCONSOPT="-j $OMP_NUM_THREADS"