diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index 6dec728..6559e3d 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -1,11 +1,15 @@ name: Packaging on: - push: + pull_request: + types: [opened, synchronize] release: # "released" events are emitted either when directly be released or be edited from pre-released. types: [prereleased, released] +env: + python_version: 3.11 + jobs: deploy: runs-on: ubuntu-latest @@ -16,7 +20,7 @@ jobs: id: setup-python uses: actions/setup-python@v4 with: - python-version: "3.11" + python-version: ${{ env.python_version }} - name: Set up poetry uses: abatilo/actions-poetry@v2 @@ -25,10 +29,10 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pypoetry/virtualenvs - key: ${{ runner.os }}-build-${{ matrix.python }}-${{ hashFiles('**/poetry.lock') }} + key: ${{ runner.os }}-build-${{ env.python_version }}-${{ hashFiles('**/poetry.lock') }} restore-keys: | - ${{ runner.os }}-build-${{ matrix.python }}-${{ hashFiles('**/poetry.lock') }} - ${{ runner.os }}-build-${{ matrix.python }}- + ${{ runner.os }}-build-${{ env.python_version }}-${{ hashFiles('**/poetry.lock') }} + ${{ runner.os }}-build-${{ env.python_version }}- ${{ runner.os }}- - run: poetry install @@ -43,7 +47,7 @@ jobs: with: user: __token__ password: ${{ secrets.TEST_PYPI_API_TOKEN }} - repository_url: https://test.pypi.org/legacy/ + repository-url: https://test.pypi.org/legacy/ - name: Publish distribution to PyPI if: github.event_name == 'release' && !github.event.release.prerelease diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index 49c9043..8f052a8 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -1,6 +1,5 @@ name: Test on: - - push - pull_request jobs: diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml index c5c7c88..d155291 100644 --- a/.github/workflows/spellcheck.yml +++ b/.github/workflows/spellcheck.yml @@ -1,6 +1,5 @@ name: Spellcheck on: - - push - pull_request permissions: contents: read