Skip to content

Commit

Permalink
feat: Update the release GH action to publish the package to PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
nijanthanvijayakumar committed Sep 27, 2024
1 parent 1403347 commit cb74e63
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,41 @@ jobs:
with:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json

# Following GH step is created based on the following article and the credits to the same
# https://johnfraney.ca/blog/how-to-publish-a-python-package-with-poetry-and-github-actions/
publish-to-pypi:
needs: release-please
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/quinn/
permissions:
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ">=3.9,<4.0"

- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python - -y
- name: Update PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Update Poetry configuration
run: poetry config virtualenvs.create false

- name: Install dependencies
run: poetry install --sync --no-interaction

- name: Package project
run: poetry build

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit cb74e63

Please sign in to comment.