From eefc3cc6db8114614846c01c7bd3968a41f8139e Mon Sep 17 00:00:00 2001 From: burgholzer Date: Sun, 29 Sep 2024 00:45:26 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=94=A7=F0=9F=9A=A8=20override=20deplo?= =?UTF-8?q?yment=20target=20to=20silence=20cibuildwheel=20warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: burgholzer --- pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 704b6558..c29670aa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -301,6 +301,10 @@ before-build = "pip install delvewheel>=1.7.3" repair-wheel-command = "delvewheel repair -v -w {dest_dir} {wheel} --namespace-pkg mqt" environment = { CMAKE_ARGS = "-T ClangCL", SKBUILD_CMAKE_ARGS="--fresh" } +[[tool.cibuildwheel.overrides]] +select = "*-macosx_arm64" +environment = { MACOSX_DEPLOYMENT_TARGET = "11.0" } + [tool.uv] reinstall-package = ["mqt.qcec"] From 0bd41c5f23e56e45d72215a96a05088e87ba4869 Mon Sep 17 00:00:00 2001 From: burgholzer Date: Sun, 29 Sep 2024 00:45:53 +0200 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=9A=80=20upload=20to=20Test=20PyPI=20?= =?UTF-8?q?when=20running=20CD=20workflow=20on=20pushes=20to=20main?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: burgholzer --- .github/workflows/cd.yml | 45 +++++++++++++++++++++++++++++++--------- .github/workflows/ci.yml | 11 ++++++++++ 2 files changed, 46 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 2d646829..116930b0 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -1,21 +1,50 @@ name: CD on: + push: + branches: [main] release: types: [published] workflow_dispatch: - pull_request: - paths: - - .github/workflows/cd.yml -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true +permissions: + attestations: write + contents: read + id-token: write jobs: + # Builds the sdist and wheels on all supported platforms and uploads the resulting + # wheels as GitHub artifacts `dev-cibw-*`, `test-cibw-*`, or `cibw-*`, depending on + # whether the workflow is triggered from a PR, a push to main, or a release, respectively. python-packaging: name: 🐍 Packaging uses: cda-tum/mqt-workflows/.github/workflows/reusable-python-packaging.yml@v1.4 + with: + # Do not include local version information on pushes to main to facilitate TestPyPI uploads. + no-local-version: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }} + # Do not build emulated wheels on pushes to main to reduce runner load for CD. + build-emulated-wheels: ${{ github.ref != 'refs/heads/main' || github.event_name != 'push' }} + # Downloads the previously generated artifacts and deploys to TestPyPI on pushes to main + deploy-test-pypi: + name: 🚀 Deploy to Test PyPI + runs-on: ubuntu-latest + environment: + name: test-pypi + url: https://test.pypi.org/p/mqt.qcec + needs: [python-packaging] + if: github.ref == 'refs/heads/main' && github.event_name == 'push' + steps: + - uses: actions/download-artifact@v4 + with: + pattern: test-cibw-* + path: dist + merge-multiple: true + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + attestations: true + + # Downloads the previously generated artifacts and deploys to PyPI on published releases. deploy: if: github.event_name == 'release' && github.event.action == 'published' name: 🚀 Deploy to PyPI @@ -23,10 +52,6 @@ jobs: environment: name: pypi url: https://pypi.org/p/mqt.qcec - permissions: - id-token: write - attestations: write - contents: read needs: [python-packaging] steps: - uses: actions/download-artifact@v4 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 15bc86a2..69378d66 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,6 +45,12 @@ jobs: if: fromJSON(needs.change-detection.outputs.run-code-ql) uses: cda-tum/mqt-workflows/.github/workflows/reusable-code-ql.yml@v1.4 + cd: + name: 🚀 CD + needs: change-detection + if: fromJSON(needs.change-detection.outputs.run-cd) + uses: cda-tum/mqt-workflows/.github/workflows/reusable-python-packaging.yml@v1.4 + required-checks-pass: # This job does nothing and is only used for branch protection name: 🚦 Check if: always() @@ -54,6 +60,7 @@ jobs: - cpp-linter - python-tests - code-ql + - cd runs-on: ubuntu-latest steps: - name: Decide whether the needed jobs succeeded or failed @@ -76,4 +83,8 @@ jobs: fromJSON(needs.change-detection.outputs.run-code-ql) && '' || 'code-ql,' }} + ${{ + fromJSON(needs.change-detection.outputs.run-cd) + && '' || 'cd,' + }} jobs: ${{ toJSON(needs) }}