From cf2176769cf4308c446c8fdfea94d3532a572539 Mon Sep 17 00:00:00 2001 From: Alan Fuentes Date: Thu, 25 Jul 2024 09:51:06 -0600 Subject: [PATCH] Updated publish.yaml --- .github/workflows/publish.yaml | 46 ++++++++++++++++------------------ 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index ec84186..95f89a5 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -1,32 +1,30 @@ -name: Publish Python Package +name: Upload Python Package to PyPI when a Release is Created on: release: types: [published] jobs: - publish: + pypi-publish: + name: Publish release to PyPI runs-on: ubuntu-latest - + environment: + name: pypi + url: https://pypi.org/p/dnaStreaming + permissions: + id-token: write steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v3 - with: - python-version: '3.8' - - - name: Install dependencies - run: pip install -r requirements.txt - - - name: Build package - run: python setup.py sdist bdist_wheel - - - name: Publish package to PyPI - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} - run: | - pip install twine - twine upload dist/* \ No newline at end of file + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.8" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel + - name: Build package + run: | + python -m build + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file