-
Notifications
You must be signed in to change notification settings - Fork 15
48 lines (46 loc) · 1.74 KB
/
pypi.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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@v1
with:
python-version: '3.10'
- 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
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 -e .
python -m pip install jupyter
python3 -m ipykernel install --user
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 }}