Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 25 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish distributions to PyPI
name: Package build

on:
pull_request:
Expand All @@ -9,8 +9,8 @@ on:
- "v*"

jobs:
build-n-publish:
name: Build and publish distributions to PyPI
build:
name: Build wheel and sdist
if: github.repository == 'pvlib/pvlib-python'
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -49,10 +49,28 @@ jobs:
run: du -h pvlib
working-directory: ./tmp

- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

publish:
name: Release dist files to PyPI
# only publish distribution to PyPI for tagged commits
if: startsWith(github.ref, 'refs/tags/v')
needs:
- build
runs-on: ubuntu-latest
permissions:
id-token: write # for PyPI trusted publishing

steps:
- name: Download all dist files
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/

- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}