Add publish action

This commit is contained in:
Andras Schmelczer 2022-06-25 18:31:35 +02:00
parent c81c22eef5
commit f423cd716f
No known key found for this signature in database
GPG key ID: 0EA1BC97D0AB076E

View file

@ -2,22 +2,25 @@ name: Publish package
on: on:
workflow_run: workflow_run:
workflows: Run tests workflows: Check library
branches: main branches: main
types: completed types: completed
jobs: jobs:
build: 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 runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up Python 3.9 - name: Set up Python 3.9.2
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: 3.9 python-version: 3.9.2
- name: Install pypa/build - name: Install pypa/build
run: python -m pip install build --user run: python -m pip install build --user
@ -28,4 +31,5 @@ jobs:
- name: Publish distribution to PyPI - name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@master uses: pypa/gh-action-pypi-publish@master
with: with:
password: ${{ secrets.PYPI_API_TOKEN }} user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}