📦 PyPI #31
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "📦 PyPI " | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| # loop_common/loop_interpolation (ROADMAP.md Stage 2) are workspace-local | |
| # deps of LoopStructural (see [tool.uv.sources] in pyproject.toml). They | |
| # must land on PyPI before the LoopStructural sdist below is uploaded, or | |
| # `pip install LoopStructural` breaks for anyone not using uv. | |
| make_sdist_packages: | |
| name: Make SDist (${{ matrix.package }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| package: [loop_common, loop_interpolation] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build SDist | |
| working-directory: packages/${{ matrix.package }} | |
| run: | | |
| pip install build | |
| python -m build | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist-${{ matrix.package }} | |
| path: packages/${{ matrix.package }}/dist/ | |
| upload_packages_to_pypi: | |
| name: Upload ${{ matrix.package }} to PyPI | |
| needs: ["make_sdist_packages"] | |
| runs-on: "ubuntu-latest" | |
| strategy: | |
| matrix: | |
| package: [loop_common, loop_interpolation] | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: dist-${{ matrix.package }} | |
| path: dist | |
| - uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| skip_existing: true | |
| verbose: true | |
| user: ${{ secrets.PYPI_USERNAME }} | |
| password: ${{ secrets.PYPI_PASSWORD }} | |
| make_sdist: | |
| name: Make SDist | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build SDist | |
| run: | | |
| pip install build | |
| python -m build | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/ | |
| upload_to_pypi: | |
| needs: ["make_sdist", "upload_packages_to_pypi"] | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist | |
| - uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| skip_existing: true | |
| verbose: true | |
| user: ${{ secrets.PYPI_USERNAME }} | |
| password: ${{ secrets.PYPI_PASSWORD }} |