diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index b188cb5..eb22f51 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -13,10 +13,8 @@ permissions: contents: read jobs: - build: - + test: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 - name: Set up Python 3.10 @@ -27,14 +25,33 @@ jobs: run: | python setup.py install pip install six -# pip install flake8 pytest -# - name: Lint with flake8 -# run: | -# # stop the build if there are Python syntax errors or undefined names -# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics -# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide -# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Unittest run: | python -m unittest ocldev/tests/*.py + pypi-publish: + needs: [test] + name: Publish to PyPi + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/ocldev + permissions: + id-token: write + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install dependencies + run: | + pip install --upgrade pip --user + pip install setuptools==44.1.0 --user + pip install twine==1.15.0 --user + - name: Build Wheel + run: | + python setup.py sdist bdist_wheel --universal + twine check dist/* + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1