Skip to content

Add github action to publish to pypi on new tag #4

Add github action to publish to pypi on new tag

Add github action to publish to pypi on new tag #4

Workflow file for this run

name: Check test and code linting
on: [push]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pre-commit/[email protected]
test:
runs-on: ubuntu-20.04
needs: lint
strategy:
matrix:
include:
- python-version: "3.8"
tox: min
- python-version: "3.9"
- python-version: "3.10"
- python-version: "3.11"
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox codecov
- name: Run tests
run: tox -e ${{ matrix.tox || 'py' }}
publish:

Check failure on line 36 in .github/workflows/main.yml

View workflow run for this annotation

GitHub Actions / Check test and code linting

Invalid workflow file

The workflow is not valid. .github/workflows/main.yml (Line: 36, Col: 5): Unexpected value 'publish'
needs: test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@master
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*