Skip to content

Commit

Permalink
Using pypi-publish github action to publish to PyPi
Browse files Browse the repository at this point in the history
  • Loading branch information
james03160927 authored May 2, 2024
1 parent 8ab9e80 commit 9ca40ba
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions .github/workflows/publish_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,19 @@ on:
types: [ created ]

jobs:
upload-to-pypi:
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/<your-pypi-project-name>
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: Checkout code
uses: actions/checkout@v3
# retrieve your distributions here

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install Dependencies
run: |
python3 -m pip install --upgrade twine build
- name: Build and upload to PyPI
run: |
python -m build
twine upload dist/*
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

update-homebrew-formula:
needs: upload-to-pypi
Expand Down

0 comments on commit 9ca40ba

Please sign in to comment.