diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index 0454a9009..76e0cb349 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -11,14 +11,6 @@ on: description: 'Test the sdist before uploading' type: boolean default: true - upload_to_test_pypi: - description: 'Upload to Test PyPi' - type: boolean - default: true - upload_to_pypi: - description: 'Upload to PyPi' - type: boolean - default: false permissions: read-all @@ -35,42 +27,26 @@ jobs: steps: - name: Checkout Melting Pot - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - name: Set up Python - uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 + uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 with: - python-version: '3.10' + python-version: '3.11' - - name: Install Python dependencies + - name: Build distribution run: | - pip install --upgrade pip - pip install build + pip install build==1.0.3 + python -m build --outdir dist/ - - name: Build source distribution - run: python -m build --sdist --outdir dist/ - - - name: Install from source distribution - if: github.event_name == 'release' || inputs.test_sdist - run: | - pip install setuptools - pip -vvv install dist/*.tar.gz - - - name: Test installation + - name: Test distribution if: github.event_name == 'release' || inputs.test_sdist run: | + VENV="$(mktemp --dry-run)" + python -m venv "${VENV}" + source "${VENV}/bin/activate" + pip install dist/*.whl pip install pytest-xdist pytest -n auto -rax --pyargs meltingpot - - - name: Publish to TestPyPI - if: github.event_name == 'release' || inputs.upload_to_test_pypi - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: https://test.pypi.org/legacy/ - verbose: true - - - name: Publish to PyPI - if: github.event_name == 'release' || inputs.upload_to_pypi - uses: pypa/gh-action-pypi-publish@release/v1 - with: - verbose: true + deactivate + rm -rf "${VENV}"