From 51d281c4ed106f9439e4b475cf5170bc5c8b9619 Mon Sep 17 00:00:00 2001 From: cdjellen Date: Sat, 27 Jul 2024 21:39:16 -0700 Subject: [PATCH] update publishing for poetry building --- .github/workflows/publish.yml | 44 ++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5cc9b14..83b0fe2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,17 +1,13 @@ -# 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 - -name: Upload Python Package +name: Publish ndbc-api Python Package on: release: types: [created] jobs: - deploy: - + build: + name: build runs-on: ubuntu-latest - steps: - uses: actions/checkout@v2 - name: Set up Python @@ -21,11 +17,31 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel twine - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + pip install build + - name: Build run: | - python setup.py sdist - twine upload dist/* + python3 -m build + - name: Store + uses: actions/upload-artifact@v3 + with: + name: python-package-distributions + path: dist/ + retention-days: 1 + publish-to-pypi: + name: publish + needs: + - build + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/aq-utilities + permissions: + id-token: write + steps: + - name: Download distributions + uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1