diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 97df165..5fe50c4 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -13,9 +13,16 @@ name: Continuous Integration on: push: - branches: [ main, develop ] + branches: + - main + - develop pull_request: - branches: [ main, develop ] + branches: + - main + - develop + release: + types: + - published jobs: build: @@ -23,7 +30,9 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.7', '3.10' ] + python-version: + - '3.7' + - '3.10' steps: - uses: actions/checkout@v2 @@ -65,5 +74,5 @@ jobs: # If this commit is the result of a Git tag, push the wheel and tar packages # to the PyPi registry - name: Publish to PyPI - if: startsWith(github.ref, 'refs/tags') + if: github.event_name == 'release' && github.event.action == 'published' run: twine upload --repository-url https://upload.pypi.org/legacy/ -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} --skip-existing --verbose dist/*