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: ${{ github.event.inputs.index }} Build 🛠️ & Publish 📦 | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| index: | ||
| required: true | ||
| default: 'testpypi' | ||
| type: string | ||
| jobs: | ||
| build_and_publish_distribution: | ||
| name: Build and publish distribution 📦 | ||
| runs-on: ubuntu-latest | ||
| environment: | ||
| name: ${{ inputs.index }} | ||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
| steps: | ||
| - name: Check out a copy of the repository | ||
| uses: actions/checkout@v6 | ||
| - name: Set up uv | ||
| uses: astral-sh/setup-uv@v7 | ||
| - name: Build a binary wheel and a source tarball | ||
| run: uv build | ||
| - name: Run smoke tests (wheel) | ||
| uses: ./.github/actions/smoke-tests | ||
| with: | ||
| command: uv run --isolated --no-project --with dist/*.whl | ||
| - name: Run smoke tests (sdist) | ||
| uses: ./.github/actions/smoke-tests | ||
| with: | ||
| command: uv run --isolated --no-project --with dist/*.tar.gz | ||
| - name: Store the distribution packages | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: python-package-distributions | ||
| path: dist/ | ||
| - name: Publish distribution to ${{ inputs.index }} | ||
| run: uv publish --index ${{ inputs.index }} | ||