Repository navigation
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: Publish Python π distribution π¦ to TestPyPI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| release: | |
| types: [published] | |
| jobs: | |
| build_wheels: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| python-version: ["3.9", "3.11", "3.12"] | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - run: pip install cibuildwheel | |
| - run: cibuildwheel --output-dir wheelhouse | |
| - uses: actions/upload-artifact@v5 | |
| with: | |
| name: wheels-${{ matrix.os }}-py${{ matrix.python-version }} | |
| path: wheelhouse/*.whl | |
| build_sdist: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - run: pip install build | |
| - run: python -m build --sdist | |
| - uses: actions/upload-artifact@v5 | |
| with: | |
| name: sdist | |
| path: dist/*.tar.gz | |
| publish: | |
| name: >- | |
| Publish Python π distribution π¦ to TestPyPI | |
| needs: [build_wheels, build_sdist] | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'release' | |
| environment: | |
| name: testpypi | |
| url: https://test.pypi.org/project/farms-foo/ | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Download all the dists | |
| uses: actions/download-artifact@v6 | |
| with: | |
| path: dist/ | |
| merge-multiple: true | |
| - name: Publish distribution π¦ to TestPyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| repository-url: https://test.pypi.org/legacy/ |