From 19db3653c5778bc9286c2cd38f8cdf2b40e9fa6a Mon Sep 17 00:00:00 2001 From: Kayson Fakhar Date: Tue, 19 Mar 2024 15:44:04 +0100 Subject: [PATCH] Update publish_pypi.yml going for a better pypipyyypoiypy --- .github/workflows/publish_pypi.yml | 43 ++++++++++++++++-------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml index b5cafaa..0569754 100644 --- a/.github/workflows/publish_pypi.yml +++ b/.github/workflows/publish_pypi.yml @@ -1,26 +1,29 @@ name: Upload Python Package -'on': + +on: push: branches: main -permissions: - contents: read + jobs: - deploy: + pypi-publish: + name: Upload release to PyPI runs-on: ubuntu-latest + environment: + name: release + 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@v3 - with: - python-version: '3.11' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install build - - name: Build package - run: python -m build - - name: Publish package to PyPI - uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 - with: - user: __token__ - password: '${{ secrets.PYPI_API_TOKEN }}' + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.11' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + - name: Build package + run: python -m build + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1