Skip to content

Commit

Permalink
Add a step to publish to PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
mrakitin committed Jun 5, 2024
1 parent 3e6aec4 commit 2f16962
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
pull_request:
workflow_dispatch:
release:
types: [published, created]

jobs:

Expand Down Expand Up @@ -114,3 +116,29 @@ jobs:
with:
name: ${{ env.REPOSITORY_NAME }}-${{ matrix.python-version }}-${{ matrix.host-os }}-docs
path: docs/build/html/


publish-to-pypi:
# Hints from:
# - https://github.com/pypa/gh-action-pypi-publish/discussions/28
# - https://github.com/Lightning-AI/lightning/blob/master/.github/workflows/release-pypi.yml
if: github.event_name == 'release'
name: Publish to PyPI
needs: test
runs-on: ubuntu-latest
permissions:
id-token: write

steps:
- uses: actions/checkout@v3

- name: Download wheels from GitHub artifacts
uses: actions/download-artifact@v3
with:
name: wheels
path: dist/

- name: Publish wheels to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ./dist/

0 comments on commit 2f16962

Please sign in to comment.