From 33174565f24876233cb77c0cfb478f4f2122aa26 Mon Sep 17 00:00:00 2001 From: Ryan Soklaski Date: Fri, 21 Apr 2023 16:58:36 -0400 Subject: [PATCH] Use pypa/gh-action-pypi-publish@release/v1 --- .github/workflows/pypi_publish.yml | 32 ++++++++++-------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/.github/workflows/pypi_publish.yml b/.github/workflows/pypi_publish.yml index dddb2b6ff..1fea6a5e5 100644 --- a/.github/workflows/pypi_publish.yml +++ b/.github/workflows/pypi_publish.yml @@ -1,6 +1,4 @@ -# This workflows will upload a Python Package using Twine when a release is created -# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries - +# This workflows will upload a Python Package using PyPI's Trusted Publisher feature: https://docs.pypi.org/trusted-publishers/adding-a-publisher/ name: Upload Python Package on: @@ -8,24 +6,14 @@ on: types: [created] jobs: - deploy: - + pypi-publish: + name: Upload release to PyPI runs-on: ubuntu-latest - + environment: pypi-publish + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install build twine - - name: Build and publish - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} - run: | - python -m build - twine upload dist/* + # retrieve your distributions here + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1