Skip to content

Commit

Permalink
Update publish-to-pypi.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
VarunUllanat authored Nov 1, 2024
1 parent 6ce87f6 commit 980b6db
Showing 1 changed file with 28 additions and 31 deletions.
59 changes: 28 additions & 31 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit 980b6db

Please sign in to comment.