diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index d7f64d20..3b869492 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -36,3 +36,34 @@ jobs: NBEXEC="jupyter nbconvert --to notebook --execute --inplace" $NBEXEC ./scripts/example_basics.ipynb $NBEXEC ./scripts/example_ecflux.ipynb + + + release_pypi: + name: PyPI Build and publish Python distributions (PEP 621, Trusted Publishing) + runs-on: ubuntu-latest + needs: ["build"] + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && !contains(github.ref_name, '-') && contains(github.ref_name, '.') + environment: + name: pypi + url: https://pypi.org/p/fluxie + permissions: + id-token: write # Required for Trusted Publishing + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: "3.12" + + - name: Install uv + uses: astral-sh/setup-uv@v7 + with: + version: "latest" + + - name: Build distributions with uv + run: uv build + + - name: Publish + run: uv publish --trusted-publishing always \ No newline at end of file