From 8199c5c119f55b390ae8f3afb9f33f7abe255435 Mon Sep 17 00:00:00 2001 From: corey Date: Sat, 20 Jan 2024 15:12:02 -0600 Subject: [PATCH] WiP: Publishing manylinux --- .github/workflows/publish.yml | 78 +++++++++++++++++++++++++++-------- 1 file changed, 60 insertions(+), 18 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 84571c99..f2ee82a1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -116,7 +116,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ${{ fromJSON(vars.PYTHON_VERSIONS) }} + python-version: ${{ fromJSON(vars.PYTHON_VERSIONS_FOR_RELEASE) }} needs: [lock_master] runs-on: ubuntu-latest container: @@ -140,27 +140,69 @@ jobs: rustc --version cargo --version - # TODO: For now use pre-installed python version. - # In future, will probably want to download latest version - - name: Set Python Version (3.7 Path) - if: ${{ matrix.python-version == 3.7 }} + - name: Install Newer OpenSSL run: | - PYVER=$(echo ${{ matrix.python-version }} | sed -e "s/\.//g") - echo $PYVER - PATH_TO_PY=/opt/python/cp$PYVER-cp$PYVER\m/bin - echo $PATH_TO_PY - echo "$PATH_TO_PY" >> $GITHUB_PATH - - name: Set Python Version - if: ${{ matrix.python-version != 3.7 }} + curl -O https://www.openssl.org/source/openssl-1.1.1l.tar.gz + tar zxf openssl-1.1.1l.tar.gz + cd openssl-1.1.1l + ./config + make + make install + + - name: Install Python run: | - PYVER=$(echo ${{ matrix.python-version }} | sed -e "s/\.//g") - echo $PYVER - PATH_TO_PY=/opt/python/cp$PYVER-cp$PYVER/bin - echo $PATH_TO_PY - echo "$PATH_TO_PY" >> $GITHUB_PATH + curl -O https://www.python.org/ftp/python/${{ matrix.python-version }}/Python-$PY_VER.tgz + tar zxf Python-${{ matrix.python-version }}.tgz + cd Python-${{ matrix.python-version }} + ./configure --with-openssl=/openssl-1.1.1l --prefix=/root/python --enable-optimizations --enable-shared + make altinstall + + - name: Update LD_LIBRARY_PATH + run: | + echo $LD_LIBRARY_PATH + echo "LD_LIBRARY_PATH=/Python-${{ matrix.python-version }}:$LD_LIBRARY_PATH" >> $GITHUB_ENV + + - name: Check LD_LIBRARY_PATH + run: | + echo $LD_LIBRARY_PATH + + - name: Alias Python and Pip binaries + run: | + IFS='.' read -r -a SPLIT_VER <<< ${{ matrix.python-version }} + M_VER=${SPLIT_VER[0]}.${SPLIT_VER[1]} + echo $M_VER + ls /root/python/bin + ln -s /root/python/bin/python$M_VER /root/python/bin/python + ln -s /root/python/bin/pip$M_VER /root/python/bin/pip + ls /root/python/bin + + - name: Update $PATH + run: | + echo /root/python/bin >> $GITHUB_PATH + + # # TODO: For now use pre-installed python version. + # # In future, will probably want to download latest version + # - name: Set Python Version (3.7 Path) + # if: ${{ matrix.python-version == 3.7 }} + # run: | + # PYVER=$(echo ${{ matrix.python-version }} | sed -e "s/\.//g") + # echo $PYVER + # PATH_TO_PY=/opt/python/cp$PYVER-cp$PYVER\m/bin + # echo $PATH_TO_PY + # echo "$PATH_TO_PY" >> $GITHUB_PATH + # - name: Set Python Version + # if: ${{ matrix.python-version != 3.7 }} + # run: | + # PYVER=$(echo ${{ matrix.python-version }} | sed -e "s/\.//g") + # echo $PYVER + # PATH_TO_PY=/opt/python/cp$PYVER-cp$PYVER/bin + # echo $PATH_TO_PY + # echo "$PATH_TO_PY" >> $GITHUB_PATH - name: Display Python Version run: + which python + which pip python --version pip --version @@ -246,7 +288,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ${{ fromJSON(vars.PYTHON_VERSIONS) }} + python-version: ${{ fromJSON(vars.PYTHON_VERSIONS_FOR_RELEASE) }} needs: [lock_master] runs-on: windows-latest