diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1b31d571..a1c33c62 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,7 +4,44 @@ on: push jobs: - publish: + publish-master: + if: github.event_name == 'merge' + runs-on: ubuntu-latest + strategy: + max-parallel: 1 + matrix: + python-version: [3.8] + + steps: + - uses: actions/checkout@v1 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + # Avoid caching to be 100% confident things are working properly + - name: Init python poetry action + uses: abatilo/actions-poetry@v2.1.0 + + - name: Install dependencies + run: poetry install + + - name: Check that formatting, linting, and tests pass + run: poetry run make ci + + - name: Check docs are up to date + run: poetry run make docs-build-ci + + - name: Build distribution + run: poetry build + + - name: Publish distribution to PyPI + uses: pypa/gh-action-pypi-publish@master + with: + user: ${{ secrets.PYPI_USERNAME }} + password: ${{ secrets.PYPI_PASSWORD }} + # For security porpuses only! + + publish-tag: if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') runs-on: ubuntu-latest strategy: