Add publish action

This commit is contained in:
Andras Schmelczer 2022-06-25 18:31:35 +02:00
parent 0c4c3d9803
commit af6eed2714

View file

@ -2,22 +2,25 @@ name: Publish package
on:
workflow_run:
workflows: Run tests
workflows: Check library
branches: main
types: completed
jobs:
build:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
if: |
github.event.workflow_run.conclusion == 'success'
&& github.event_name == 'push'
&& startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
- name: Set up Python 3.9.2
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: 3.9.2
- name: Install pypa/build
run: python -m pip install build --user
@ -28,4 +31,5 @@ jobs:
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}