Publish #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish | |
on: | |
workflow_dispatch: | |
jobs: | |
release-pypi-x86-64: | |
runs-on: ubuntu-latest | |
env: | |
img: quay.io/pypa/manylinux2014_x86_64:latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build wheels | |
run: | | |
docker run --rm -v ${{ github.workspace }}:/src/pyscf-forge:rw --workdir=/src/pyscf-forge \ | |
${{ env.img }} \ | |
bash -exc '/opt/python/cp39-cp39/bin/pip install --upgrade pip setuptools && \ | |
yum install -y epel-release && \ | |
yum-config-manager --enable epel && \ | |
yum install -y openblas-devel gcc && \ | |
export src=${GITHUB_WORKSPACE:-/src/pyscf-forge} && \ | |
export dst=${GITHUB_WORKSPACE:-/src/pyscf-forge}/linux-wheels && \ | |
mkdir -p /root/wheelhouse $src/linux-wheels && \ | |
sed -i "/if basename(fn) not in needed_libs:/s/basename.*libs/1/" /opt/_internal/pipx/venvs/auditwheel/lib/python*/site-packages/auditwheel/wheel_abi.py && \ | |
sed -i "/if src_path is None/a\ continue" /opt/_internal/pipx/venvs/auditwheel/lib/python*/site-packages/auditwheel/repair.py && \ | |
export PATH=/opt/python/cp39-cp39/bin:$PATH && \ | |
/opt/python/cp39-cp39/bin/pip wheel -v --no-deps --no-clean -w /root/wheelhouse $src && \ | |
export whl=`ls /root/wheelhouse/pyscf_forge-*-linux_*.whl` && \ | |
auditwheel -v repair "$whl" -w $dst' | |
- name: List available wheels | |
run: | | |
ls ${{ github.workspace }}/linux-wheels | |
- name: Publish to PyPI | |
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
#password: ${{ secrets.PYPI_TEST_API_TOKEN }} | |
#repository_url: https://test.pypi.org/legacy/ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
packages-dir: ${{ github.workspace }}/linux-wheels | |
verbose: true | |
release-pypi-aarch64: | |
runs-on: ubuntu-latest | |
env: | |
img: quay.io/pypa/manylinux2014_aarch64:latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
id: qemu | |
uses: docker/setup-qemu-action@v2 | |
- name: Build Wheel | |
run: | | |
docker run --rm -v ${{ github.workspace }}:/src/pyscf-forge:rw --workdir=/src/pyscf-forge \ | |
${{ env.img }} \ | |
bash -exc '/opt/python/cp39-cp39/bin/pip install --upgrade pip setuptools && \ | |
yum install -y epel-release && \ | |
yum-config-manager --enable epel && \ | |
yum install -y openblas-devel gcc && \ | |
export src=${GITHUB_WORKSPACE:-/src/pyscf-forge} && \ | |
export dst=${GITHUB_WORKSPACE:-/src/pyscf-forge}/linux-wheels && \ | |
mkdir -p /root/wheelhouse $src/linux-wheels && \ | |
sed -i "/if basename(fn) not in needed_libs:/s/basename.*libs/1/" /opt/_internal/pipx/venvs/auditwheel/lib/python*/site-packages/auditwheel/wheel_abi.py && \ | |
sed -i "/if src_path is None/a\ continue" /opt/_internal/pipx/venvs/auditwheel/lib/python*/site-packages/auditwheel/repair.py && \ | |
sed -i "s/numpy/h5py==3.10/" $src/pyproject.toml && \ | |
export PATH=/opt/python/cp39-cp39/bin:$PATH && \ | |
/opt/python/cp39-cp39/bin/pip wheel -v --no-deps --no-clean -w /root/wheelhouse $src && \ | |
export whl=`ls /root/wheelhouse/pyscf_forge-*-linux_*.whl` && \ | |
auditwheel -v repair "$whl" -w $dst' | |
- name: List available wheels | |
run: | | |
ls ${{ github.workspace }}/linux-wheels | |
- name: Publish to PyPI | |
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
#password: ${{ secrets.PYPI_TEST_API_TOKEN }} | |
#repository_url: https://test.pypi.org/legacy/ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
packages-dir: ${{ github.workspace }}/linux-wheels | |
verbose: true | |
release-pypi-sdist: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build sdist | |
run: | | |
python3 setup.py sdist | |
- name: List available sdist | |
run: | | |
ls ${{ github.workspace }}/dist | |
- name: Publish to PyPI | |
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
#password: ${{ secrets.PYPI_TEST_API_TOKEN }} | |
#repository_url: https://test.pypi.org/legacy/ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
packages-dir: ${{ github.workspace }}/dist | |
verbose: true | |
# release-pypi-macos-x86: | |
# name: Build wheels for macos | |
# runs-on: macos-12 | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - name: Build wheels | |
# uses: pypa/[email protected] | |
# env: | |
# CIBW_BUILD: cp311-macosx_x86_64 | |
# CIBW_BUILD_VERBOSITY: "1" | |
# with: | |
# output-dir: mac-wheels | |
# - name: List available wheels | |
# run: | | |
# ls mac-wheels | |
# - name: Publish to PyPI | |
# run: | | |
# pip3 install twine | |
# export TWINE_USERNAME=__token__ | |
# export TWINE_PASSWORD="${{ secrets.PYPI_API_TOKEN }}" | |
# twine upload --verbose mac-wheels/* | |
# | |
# release-pypi-macos-arm64: | |
# name: Build wheels for Apple M chips | |
# runs-on: macos-12 | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - name: Build wheels | |
# uses: pypa/[email protected] | |
# env: | |
# CIBW_BUILD: cp311-macosx_arm64 | |
# CIBW_BUILD_VERBOSITY: "1" | |
# # Cross-platform build for arm64 wheels on x86 platform | |
# CIBW_ARCHS_MACOS: "x86_64 universal2 arm64" | |
# CMAKE_OSX_ARCHITECTURES: arm64 | |
# with: | |
# output-dir: mac-wheels | |
# - name: List available wheels | |
# run: | | |
# ls mac-wheels | |
# - name: Publish to PyPI | |
# run: | | |
# pip3 install twine | |
# export TWINE_USERNAME=__token__ | |
# export TWINE_PASSWORD="${{ secrets.PYPI_API_TOKEN }}" | |
# twine upload --verbose mac-wheels/* |