Skip to content

Commit

Permalink
refactor GitHub Actions workflow to build and publish package to PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
tgoelles committed Dec 3, 2024
1 parent 3f1e122 commit 0eb611e
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions .github/workflows/publish_on_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,26 @@ on:
workflow_dispatch:

jobs:
publish:
uses: microsoft/action-python/.github/workflows/[email protected]
secrets:
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
TEST_PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Install dependencies for building
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: python -m build

- name: Publish package to PyPI
uses: pypa/[email protected]
with:
password: ${{ secrets.PYPI_TOKEN }}

0 comments on commit 0eb611e

Please sign in to comment.