Skip to content

PyPI

PyPI #602

Workflow file for this run

name: PyPI
on: push
jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v2
with:
python-version: '3.11'
- uses: actions/setup-java@v2
with:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '15'
- name: "Install pep517 and twine"
run: "python -m pip install --upgrade pip setuptools wheel pytest twine"
- name: "Build package"
run: "python setup.py sdist bdist_wheel"
- name: "Check long_description"
run: "python -m twine check dist/*"
- name: Publish distribution 📦 to Test PyPI
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypitesttoken }}
repository_url: https://test.pypi.org/legacy/
- name: "Run all tests"
run: |
set -xe
ulimit -n 50000
python -VV
python -m site
python -m pip install --upgrade pip setuptools wheel pytest
python -m pip install --upgrade virtualenv
python -m pip install -r requirements.txt
python -m pip install -r requirements-dev.txt
python -m ipykernel install --user --name=negmas
python -m pip install -e .
export NEGMAS_IGNORE_TEST_NOTEBOOKS=False; python -W ignore -m pytest negmas tests
- name: Publish distribution 📦 to PyPI
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypiapitoken }}