Merge develop into main for release. (#283) #18
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 ipie | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install pypa/build | |
run: >- | |
python3 -m | |
pip install | |
build | |
--user | |
- name: Build a binary wheel and a source tarball | |
run: python3 -m build | |
- name: Store the distribution packages | |
uses: actions/upload-artifact@v3 | |
with: | |
name: python-package-distributions | |
path: dist/ | |
- name: Download the artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: python-package-distributions | |
path: dist/ | |
- name: Test the wheel | |
run: | | |
ls dist | |
wheel=$(find dist/*whl) | |
echo $wheel | |
pip install $wheel | |
pip install pyscf | |
python -c "from ipie.config import MPI; assert \"FakeComm\" in str(MPI.COMM_WORLD)" | |
python3 examples/03-custom_observable/run_afqmc.py | |
- name: Setup MPI | |
uses: mpi4py/setup-mpi@v1 | |
with: | |
mpi: openmpi | |
- name: Test the wheel | |
run: | | |
pip install mpi4py | |
python -c "import mpi4py" | |
python -c "from ipie.config import MPI; assert \"mpi4py\" in str(MPI.COMM_WORLD)" | |
python3 examples/03-custom_observable/run_afqmc.py | |
publish-to-pypi: | |
name: >- | |
Publish Python distribution to PyPI | |
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes | |
needs: | |
- build | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/p/ipie | |
permissions: | |
id-token: write # IMPORTANT: mandatory for trusted publishing | |
steps: | |
- name: Download all the dists | |
uses: actions/download-artifact@v3 | |
with: | |
name: python-package-distributions | |
path: dist/ | |
- name: Publish distribution to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |