Skip to content

Merge pull request #1301 from rd4398/fix/cargo-target-dir-parallel-bu… #1073

Merge pull request #1301 from rd4398/fix/cargo-target-dir-parallel-bu…

Merge pull request #1301 from rd4398/fix/cargo-target-dir-parallel-bu… #1073

Workflow file for this run

# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: Upload Python Package
on:
- push
permissions:
contents: read
jobs:
build-n-publish:
name: Build and publish Python distributions to PyPI
if: ${{ github.repository_owner == 'python-wheel-build' }}
runs-on: ubuntu-latest
environment: release
permissions:
contents: read
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# with:
# fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[build]
- name: Build sdist and wheel
run: |
python -m build
- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2