Skip to content

Commit

Permalink
Update pypi-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jagapiou authored Jan 4, 2024
1 parent add47bf commit dce0e61
Showing 1 changed file with 13 additions and 37 deletions.
50 changes: 13 additions & 37 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand 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}"

0 comments on commit dce0e61

Please sign in to comment.