diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 28e28bc..ffb9733 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,7 @@ on: pull_request: branches: [ master ] + jobs: ci: strategy: @@ -30,11 +31,3 @@ jobs: - name: Codecov uses: codecov/codecov-action@v1 if: ${{ matrix.python-version == '3.9' }} # to run only once - - name: Publish on PyPI - if: ${{ startsWith('refs/tags/v', github.ref) && matrix.python-version == '3.9' }} - run: > - poetry config pypi-token.pypi $PYPI_TOKEN - poetry build - poetry publish - env: - PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d1f628e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,37 @@ +name: Release +on: + push: + branches: [ master ] + tags: + - '*' + pull_request: + branches: [ master ] + + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Install Poetry + run: pip install poetry + - name: Setup environment + run: poetry install + - name: Style + run: make style + - name: Test + run: make test + - name: Codecov + uses: codecov/codecov-action@v1 + - name: Publish on PyPI + run: | + poetry config pypi-token.pypi $PYPI_TOKEN + poetry build + poetry publish + env: + PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}