| name: spatialbench-cli-publish-pypi |
| |
| on: |
| release: |
| types: [created] |
| workflow_dispatch: |
| |
| permissions: |
| contents: read |
| |
| jobs: |
| build: |
| uses: ./.github/workflows/build-py-packages.yml |
| with: |
| upload-artifacts: true |
| |
| release: |
| name: Release |
| runs-on: ubuntu-latest |
| environment: pypi |
| needs: [build] |
| permissions: |
| id-token: write # Use to sign the release artifacts and for pypi trusted publishing |
| attestations: write # Used to generate artifact attestation |
| steps: |
| - name: Download all build artifacts |
| uses: actions/download-artifact@v8 |
| with: |
| pattern: '*' |
| merge-multiple: true |
| path: dist |
| |
| - name: Install twine |
| run: python -m pip install --upgrade twine |
| |
| - name: Check distributions |
| run: python -m twine check --strict dist/* |
| |
| - name: Generate artifact attestation |
| uses: actions/attest-build-provenance@v4.1.0 |
| with: |
| subject-path: 'dist/*' |
| |
| - name: Publish to PyPI |
| uses: PyO3/maturin-action@v1 |
| with: |
| command: upload |
| args: --non-interactive --skip-existing dist/* |