Skip to content

Commit

Permalink
infra: Enable publishing with PyPI trusted publishers (#368)
Browse files Browse the repository at this point in the history
  • Loading branch information
provinzkraut committed Sep 16, 2023
1 parent ec177ec commit adccaf0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ on:

jobs:
publish-release:
name: upload release to PyPI
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- name: Check out repository
uses: actions/checkout@v4
Expand All @@ -18,11 +22,11 @@ jobs:
uses: snok/install-poetry@v1
- name: Install dependencies
run: poetry install --no-interaction --no-root --no-dev
- name: publish
- name: build
shell: bash
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry publish --build --no-interaction
run: poetry build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
build-docs:
permissions:
contents: write
Expand Down
5 changes: 3 additions & 2 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ Creating a new release
4. In GitHub go to the `releases tab <https://github.com/litestar-org/polyfactory/releases>`_
5. Pick "`Draft a new release <https://github.com/litestar-org/polyfactory/releases/new>`_"
6. Give it a title and a tag, both ``vX.X.X``
7. Fill in the release description, you can let GitHub do it for you and then edit as needed.
7. Fill in the release description. You can let GitHub do it for you and then edit as needed.
8. Publish the release.
9. Look under the action pane and make sure the release action runs correctly
9. Go to `Actions <https://github.com/litestar-org/polyfactory/actions>`_ and approve the workflow
10. Check that the workflow runs successfully

0 comments on commit adccaf0

Please sign in to comment.