From 980b6db781b09e83c20079cff05920c318758bf0 Mon Sep 17 00:00:00 2001 From: Varun Ullanat <87467265+VarunUllanat@users.noreply.github.com> Date: Fri, 1 Nov 2024 16:23:39 -0400 Subject: [PATCH] Update publish-to-pypi.yml --- .github/workflows/publish-to-pypi.yml | 59 +++++++++++++-------------- 1 file changed, 28 insertions(+), 31 deletions(-) diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index ad759638..83df3c6d 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -1,39 +1,36 @@ -name: Publish PathML distribution to PyPI and TestPyPI +name: Publish PathML Distribution to PyPI and TestPyPI on: workflow_dispatch: release: types: [published] - + jobs: - build-n-publish: - name: Build and publish PathML distribution to PyPI and TestPyPI + build-and-publish: + name: Build and Publish PathML Distribution to PyPI and TestPyPI runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - name: Set up Python 3.9 - uses: actions/setup-python@v1 - with: - python-version: 3.9 - - name: Install pypa/build - run: >- - python -m - pip install - build - --user - - name: Build a binary wheel and a source tarball - run: >- - python -m - build - --sdist - --wheel - --outdir dist/ - - name: Publish distribution to Test PyPI - uses: pypa/gh-action-pypi-publish@master - with: - password: ${{ secrets.TEST_PYPI_API_TOKEN }} - repository_url: https://test.pypi.org/legacy/ - - name: Publish distribution to PyPI - uses: pypa/gh-action-pypi-publish@master - with: - password: ${{ secrets.PYPI_API_TOKEN }} + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Set Up Python 3.9 + uses: actions/setup-python@v5 + with: + python-version: '3.9' + + - name: Install Build Tool + run: pip install --upgrade build + + - name: Build Distribution + run: python -m build --sdist --wheel --outdir dist/ + + - name: Publish to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }}