MQT SyReC Synthesizer 1.2.0 Release #974
Workflow file for this run
This file contains 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: Deploy to PyPI | |
on: | |
release: | |
types: [published] | |
push: | |
branches: [main] | |
pull_request: | |
merge_group: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
env: | |
BOOST_VERSION_MAJOR: 1 | |
BOOST_VERSION_MINOR: 76 | |
BOOST_VERSION_PATCH: 0 | |
jobs: | |
build_ubuntu_wheels: | |
name: Build wheels on Ubuntu | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: Build wheels | |
uses: pypa/[email protected] | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ github.event_name == 'pull_request' && 'dev-' || '' }}cibw-wheels-ubuntu-latest-${{ strategy.job-index }} | |
path: wheelhouse/*.whl | |
build_macos_wheels: | |
name: Build wheels on macOS | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: Install boost | |
run: brew install boost | |
- name: Install the latest version of uv | |
uses: astral-sh/setup-uv@v5 | |
- name: Build wheels | |
uses: pypa/[email protected] | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ github.event_name == 'pull_request' && 'dev-' || '' }}cibw-wheels-macos-latest-${{ strategy.job-index }} | |
path: wheelhouse/*.whl | |
build_windows_wheels: | |
name: Build wheels on Windows | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- uses: ilammy/msvc-dev-cmd@v1 | |
- name: Install boost | |
uses: MarkusJx/[email protected] | |
id: install-boost | |
with: | |
boost_version: ${{ env.BOOST_VERSION_MAJOR }}.${{ env.BOOST_VERSION_MINOR }}.${{ env.BOOST_VERSION_PATCH }} | |
platform_version: 2019 | |
- name: Install the latest version of uv | |
uses: astral-sh/setup-uv@v5 | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ github.event_name == 'pull_request' && 'dev-' || '' }}cibw-wheels-windows-latest-${{ strategy.job-index }} | |
path: wheelhouse/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: Install boost | |
run: sudo apt-get update && sudo apt-get -y install libboost-all-dev | |
# set up uv for faster Python package management | |
- name: Install the latest version of uv | |
uses: astral-sh/setup-uv@v5 | |
# build the source distribution | |
- name: Build SDist | |
run: uv build --sdist | |
# check the metadata of the source distribution | |
- name: Check metadata | |
run: uvx twine check dist/* | |
# upload the source distribution as an artifact (adds a `dev-` prefix for PRs) | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ github.event_name == 'pull_request' && 'dev-' || '' }}cibw-sdist | |
path: dist/*.tar.gz | |
upload_pypi: | |
needs: | |
[ | |
build_ubuntu_wheels, | |
build_macos_wheels, | |
build_windows_wheels, | |
build_sdist, | |
] | |
runs-on: ubuntu-latest | |
if: github.event_name == 'release' && github.event.action == 'published' | |
name: 🚀 Deploy to PyPI | |
environment: | |
name: pypi | |
url: https://pypi.org/p/mqt.syrec | |
permissions: | |
attestations: write | |
contents: read | |
id-token: write | |
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@v2 | |
with: | |
subject-path: "dist/*" | |
- uses: pypa/gh-action-pypi-publish@release/v1 |