Skip to content

⚗️ upload to Test PyPI for pushes on main #99

⚗️ upload to Test PyPI for pushes on main

⚗️ upload to Test PyPI for pushes on main #99

Workflow file for this run

name: CD
on:
push:
branches: [main]
release:
types: [published]
workflow_dispatch:
pull_request:
paths:
- .github/workflows/cd.yml
permissions:
attestations: write
contents: read
id-token: write
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
python-packaging:
name: 🐍 Packaging
uses: cda-tum/mqt-workflows/.github/workflows/reusable-python-packaging.yml@no-local-version
with:
no-local-version: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }}
deploy-test-pypi:
name: 🚀 Deploy to Test PyPI
runs-on: ubuntu-latest
environment:
name: test-pypi
url: https://test.pypi.org/p/mqt.core
needs: [python-packaging]
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
steps:
- uses: actions/download-artifact@v4
with:
pattern: cibw-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
attestations: true
deploy:
if: github.event_name == 'release' && github.event.action == 'published'
name: 🚀 Deploy to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/mqt.core
needs: [python-packaging]
steps:
- uses: actions/download-artifact@v4
with:
pattern: cibw-*
path: dist
merge-multiple: true
- name: Generate artifact attestation for sdist and wheel(s)
uses: actions/attest-build-provenance@v1.4.3
with:
subject-path: "dist/*"
- uses: pypa/gh-action-pypi-publish@release/v1
with:
attestations: true