From 8b2cef3b1812263fb498c2d599d90b72cc8884b5 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Tue, 15 Oct 2024 07:43:10 +0200 Subject: [PATCH] GHA: Update deploy_pypi.yml (#49) Set up for trusted publishing. --- .github/workflows/deploy_pypi.yml | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/workflows/deploy_pypi.yml b/.github/workflows/deploy_pypi.yml index 7e05f02..57d26dd 100644 --- a/.github/workflows/deploy_pypi.yml +++ b/.github/workflows/deploy_pypi.yml @@ -1,4 +1,4 @@ -name: Deploy +name: Deploy package to PyPI on: release: @@ -7,30 +7,29 @@ on: jobs: deploy: runs-on: ubuntu-latest - strategy: - matrix: - python-version: ['3.9'] + environment: + name: pypi + url: https://pypi.org/p/fiddy + permissions: + id-token: write steps: - - name: Check out repository - uses: actions/checkout@v4 - - - name: Prepare python ${{ matrix.python-version }} + - name: Set up Python uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: "3.12" + + - name: Check out repository + uses: actions/checkout@v4 - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel twine + pip install setuptools wheel build - name: Build distribution package run: | - python setup.py sdist bdist_wheel + python -m build -s - name: Publish a Python distribution to PyPI - uses: pypa/gh-action-pypi-publish@master - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} + uses: pypa/gh-action-pypi-publish@release/v1