Skip to content

Publish Tansu Python #4

Publish Tansu Python

Publish Tansu Python #4

name: Publish Tansu Python
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
publish:
name: Publish Python distribution to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write
attestations: write
environment:
name: publish-python
steps:
- uses: actions/checkout@v4
- name: Setup Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
architecture: 'x64'
- name: Install hatch
run: pip install hatch
- name: Build
run: cd tansu && hatch build
- name: Generate artifact attestation for sdist and wheels
uses: actions/attest-build-provenance@5e9cb68e95676991667494a6a4e59b8a2f13e1d0
with:
subject-path: "tansu/dist/tansu*"
- name: Verify artifact attestation
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
for artifact in tansu/dist/*; do
echo "# ${artifact}"
gh attestation verify "${artifact}" --repo ${{ github.repository }}
done
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0
with:
print-hash: true