From 43bed8473996a246a76c8d3f51ad2a411d3894c9 Mon Sep 17 00:00:00 2001 From: Ali Asadi <10773383+maliasadi@users.noreply.github.com> Date: Mon, 22 Apr 2024 16:30:43 -0400 Subject: [PATCH] Add workflow_dispatch to wheels recipes (#679) * Add workflow_dispatch to wheels recipes * Auto update version * trigger ci * Update * Auto update version * trigger ci * Auto update version * trigger ci * trigger ci * trigger ci * Auto update version * trigger ci * Upload artifacts on workflow_dispatch * Auto update version * trigger ci * Auto update version * trigger ci * Fix the cuda recipe * Auto update version from '0.36.0-dev34' to '0.36.0-dev35' --------- Co-authored-by: ringo-but-quantum --- .github/CHANGELOG.md | 3 +++ .github/workflows/wheel_linux_aarch64.yml | 10 ++++++++-- .github/workflows/wheel_linux_ppc64le.yml | 11 +++++++++-- .github/workflows/wheel_linux_x86_64.yml | 16 +++++++++++++--- .github/workflows/wheel_linux_x86_64_cuda.yml | 16 +++++++++++++--- .github/workflows/wheel_macos_arm64.yml | 15 ++++++++++++--- .github/workflows/wheel_macos_x86_64.yml | 16 +++++++++++++--- .github/workflows/wheel_noarch.yml | 14 +++++++++++--- .github/workflows/wheel_win_x86_64.yml | 16 +++++++++++++--- pennylane_lightning/core/_version.py | 2 +- 10 files changed, 96 insertions(+), 23 deletions(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index edf9ea0080..eea553de19 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -79,6 +79,9 @@ * Improve support for new operator arithmetic with `QuantumScriptSerializer.serialize_observables`. [(#670)](https://github.com/PennyLaneAI/pennylane-lightning/pull/670) +* Add `workflow_dispatch` to wheels recipes; allowing developers to build wheels manually on a branch instead of temporarily changing the headers. + [(#679)](https://github.com/PennyLaneAI/pennylane-lightning/pull/679) + ### Documentation ### Bug fixes diff --git a/.github/workflows/wheel_linux_aarch64.yml b/.github/workflows/wheel_linux_aarch64.yml index c5ffa90489..84b59f0539 100644 --- a/.github/workflows/wheel_linux_aarch64.yml +++ b/.github/workflows/wheel_linux_aarch64.yml @@ -11,6 +11,7 @@ on: - master release: types: [published] + workflow_dispatch: concurrency: group: wheel_linux_aarch64-${{ github.ref }} @@ -161,7 +162,10 @@ jobs: regex: '.*[0-9]+.[0-9]+.[0-9]+[-_]?rc[0-9]+' - uses: actions/upload-artifact@v3 - if: ${{ github.event_name == 'release' || github.ref == 'refs/heads/master' }} + if: | + github.event_name == 'release' || + github.event_name == 'workflow_dispatch' || + github.ref == 'refs/heads/master' with: name: ${{ runner.os }}-wheels-${{ matrix.pl_backend }}-${{ matrix.arch }}.zip path: ./wheelhouse/*.whl @@ -174,7 +178,9 @@ jobs: pl_backend: ["lightning_qubit"] runs-on: ubuntu-latest - if: ${{ github.event_name == 'release' || github.ref == 'refs/heads/master'}} + if: | + github.event_name == 'release' || + github.ref == 'refs/heads/master' steps: - uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/wheel_linux_ppc64le.yml b/.github/workflows/wheel_linux_ppc64le.yml index f76f5e67e0..20d1a44de2 100644 --- a/.github/workflows/wheel_linux_ppc64le.yml +++ b/.github/workflows/wheel_linux_ppc64le.yml @@ -11,6 +11,7 @@ on: - master release: types: [published] + workflow_dispatch: concurrency: group: wheel_linux_ppc64le-${{ github.ref }} @@ -152,7 +153,11 @@ jobs: regex: '.*[0-9]+.[0-9]+.[0-9]+[-_]?rc[0-9]+' - uses: actions/upload-artifact@v3 - if: ${{ github.event_name == 'release' || github.ref == 'refs/heads/master' || steps.rc_build.outputs.match != ''}} + if: | + github.event_name == 'release' || + github.event_name == 'workflow_dispatch' || + github.ref == 'refs/heads/master' || + steps.rc_build.outputs.match != '' with: name: ${{ runner.os }}-wheels-${{ matrix.pl_backend }}-${{ matrix.arch }}.zip path: ./wheelhouse/*.whl @@ -165,7 +170,9 @@ jobs: pl_backend: ["lightning_qubit"] runs-on: ubuntu-latest - if: ${{ github.event_name == 'release' || github.ref == 'refs/heads/master'}} + if: | + github.event_name == 'release' || + github.ref == 'refs/heads/master' steps: - uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/wheel_linux_x86_64.yml b/.github/workflows/wheel_linux_x86_64.yml index 888ae4a5fa..221ecf0806 100644 --- a/.github/workflows/wheel_linux_x86_64.yml +++ b/.github/workflows/wheel_linux_x86_64.yml @@ -15,6 +15,7 @@ on: - master release: types: [published] + workflow_dispatch: concurrency: group: wheel_linux_x86_64-${{ github.ref }} @@ -22,7 +23,10 @@ concurrency: jobs: set_wheel_build_matrix: - if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'ci:build_wheels') + if: | + github.event_name != 'pull_request' || + contains(github.event.pull_request.labels.*.name, 'ci:build_wheels') || + github.event_name == 'workflow_dispatch' name: "Set wheel build matrix" uses: ./.github/workflows/set_wheel_build_matrix.yml with: @@ -176,7 +180,11 @@ jobs: regex: '.*[0-9]+.[0-9]+.[0-9]+[-_]?rc[0-9]+' - uses: actions/upload-artifact@v3 - if: ${{ github.event_name == 'release' || github.ref == 'refs/heads/master' || steps.rc_build.outputs.match != ''}} + if: | + github.event_name == 'release' || + github.event_name == 'workflow_dispatch' || + github.ref == 'refs/heads/master' || + steps.rc_build.outputs.match != '' with: name: ${{ runner.os }}-wheels-${{ matrix.pl_backend }}-${{ matrix.arch }}.zip path: ./wheelhouse/*.whl @@ -189,7 +197,9 @@ jobs: pl_backend: ["lightning_qubit"] runs-on: ubuntu-latest - if: ${{ github.event_name == 'release' || github.ref == 'refs/heads/master'}} + if: | + github.event_name == 'release' || + github.ref == 'refs/heads/master' steps: - uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/wheel_linux_x86_64_cuda.yml b/.github/workflows/wheel_linux_x86_64_cuda.yml index f92916842e..98e14db4d3 100644 --- a/.github/workflows/wheel_linux_x86_64_cuda.yml +++ b/.github/workflows/wheel_linux_x86_64_cuda.yml @@ -15,6 +15,7 @@ on: - master release: types: [published] + workflow_dispatch: concurrency: group: wheel_linux_x86_64_cu12-${{ github.ref }} @@ -22,7 +23,10 @@ concurrency: jobs: set_wheel_build_matrix: - if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'ci:build_wheels') + if: | + github.event_name != 'pull_request' || + contains(github.event.pull_request.labels.*.name, 'ci:build_wheels') || + github.event_name == 'workflow_dispatch' name: "Set wheel build matrix" uses: ./.github/workflows/set_wheel_build_matrix.yml with: @@ -106,7 +110,11 @@ jobs: regex: '.*[0-9]+.[0-9]+.[0-9]+[-_]?rc[0-9]+' - uses: actions/upload-artifact@v3 - if: ${{ github.event_name == 'release' || github.ref == 'refs/heads/master' || steps.rc_build.outputs.match != ''}} + if: | + github.event_name == 'release' || + github.event_name == 'workflow_dispatch' || + github.ref == 'refs/heads/master' || + steps.rc_build.outputs.match != '' with: name: ${{ runner.os }}-wheels-${{ matrix.pl_backend }}-${{ matrix.arch }}-cu${{ matrix.cuda_version }} path: ./wheelhouse/*.whl @@ -120,7 +128,9 @@ jobs: cuda_version: ["12"] runs-on: ubuntu-latest - if: ${{ github.event_name == 'release' || github.ref == 'refs/heads/master'}} + if: | + github.event_name == 'release' || + github.ref == 'refs/heads/master' steps: - uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/wheel_macos_arm64.yml b/.github/workflows/wheel_macos_arm64.yml index 8126a5064e..3314f64ddf 100644 --- a/.github/workflows/wheel_macos_arm64.yml +++ b/.github/workflows/wheel_macos_arm64.yml @@ -12,6 +12,7 @@ on: - master release: types: [published] + workflow_dispatch: env: ARCHS: 'arm64' @@ -24,7 +25,10 @@ concurrency: jobs: mac-set-matrix-arm: - if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'ci:build_wheels') + if: | + github.event_name != 'pull_request' || + contains(github.event.pull_request.labels.*.name, 'ci:build_wheels') || + github.event_name == 'workflow_dispatch' timeout-minutes: 30 name: Set builder matrix runs-on: ubuntu-latest @@ -111,7 +115,10 @@ jobs: python -m twine check ./wheelhouse/*.whl - uses: actions/upload-artifact@v3 - if: ${{ github.event_name == 'release' || github.ref == 'refs/heads/master' }} + if: | + github.event_name == 'release' || + github.event_name == 'workflow_dispatch' || + github.ref == 'refs/heads/master' with: name: ${{ runner.os }}-wheels-${{ matrix.pl_backend }}-${{ matrix.arch }}.zip path: ./wheelhouse/*.whl @@ -124,7 +131,9 @@ jobs: pl_backend: ["lightning_qubit"] runs-on: ubuntu-latest - if: ${{ github.event_name == 'release' || github.ref == 'refs/heads/master'}} + if: | + github.event_name == 'release' || + github.ref == 'refs/heads/master' steps: - uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/wheel_macos_x86_64.yml b/.github/workflows/wheel_macos_x86_64.yml index 1aeede6581..bb097f9f30 100644 --- a/.github/workflows/wheel_macos_x86_64.yml +++ b/.github/workflows/wheel_macos_x86_64.yml @@ -12,6 +12,7 @@ on: - master release: types: [published] + workflow_dispatch: env: MACOSX_DEPLOYMENT_TARGET: 10.15 @@ -22,7 +23,10 @@ concurrency: jobs: set_wheel_build_matrix: - if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'ci:build_wheels') + if: | + github.event_name != 'pull_request' || + contains(github.event.pull_request.labels.*.name, 'ci:build_wheels') || + github.event_name == 'workflow_dispatch' name: "Set wheel build matrix" uses: ./.github/workflows/set_wheel_build_matrix.yml with: @@ -165,7 +169,11 @@ jobs: regex: '.*[0-9]+.[0-9]+.[0-9]+[-_]?rc[0-9]+' - uses: actions/upload-artifact@v3 - if: ${{ github.event_name == 'release' || github.ref == 'refs/heads/master' || steps.rc_build.outputs.match != ''}} + if: | + github.event_name == 'release' || + github.event_name == 'workflow_dispatch' || + github.ref == 'refs/heads/master' || + steps.rc_build.outputs.match != '' with: name: ${{ runner.os }}-wheels-${{ matrix.pl_backend }}-${{ matrix.arch }}.zip path: ./wheelhouse/*.whl @@ -178,7 +186,9 @@ jobs: pl_backend: ["lightning_qubit"] runs-on: ubuntu-latest - if: ${{ github.event_name == 'release' || github.ref == 'refs/heads/master'}} + if: | + github.event_name == 'release' || + github.ref == 'refs/heads/master' steps: - uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/wheel_noarch.yml b/.github/workflows/wheel_noarch.yml index 79b063f95b..871a4710f9 100644 --- a/.github/workflows/wheel_noarch.yml +++ b/.github/workflows/wheel_noarch.yml @@ -12,6 +12,7 @@ on: - master release: types: [published] + workflow_dispatch: concurrency: group: wheel_noarch-${{ github.ref }} @@ -19,7 +20,10 @@ concurrency: jobs: build-pure-python-wheel: - if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'ci:build_wheels') + if: | + github.event_name != 'pull_request' || + contains(github.event.pull_request.labels.*.name, 'ci:build_wheels') || + github.event_name == 'workflow_dispatch' strategy: matrix: os: [ubuntu-latest] @@ -62,7 +66,9 @@ jobs: python -m twine check main/dist/*.whl - uses: actions/upload-artifact@v3 - if: ${{ matrix.pl_backend == 'lightning_qubit' && (github.event_name == 'release' || github.ref == 'refs/heads/master') }} + if: | + matrix.pl_backend == 'lightning_qubit' && + (github.event_name == 'release' || github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/master') with: name: pure-python-wheels-${{ matrix.pl_backend }}.zip path: main/dist/*.whl @@ -91,7 +97,9 @@ jobs: steps: - uses: actions/download-artifact@v3 - if: ${{ matrix.pl_backend == 'lightning_qubit' && github.event_name == 'release' }} + if: | + matrix.pl_backend == 'lightning_qubit' && + github.event_name == 'release' with: name: pure-python-wheels-${{ matrix.pl_backend }}.zip path: dist diff --git a/.github/workflows/wheel_win_x86_64.yml b/.github/workflows/wheel_win_x86_64.yml index fc01eb32da..eb4a0c1bf8 100644 --- a/.github/workflows/wheel_win_x86_64.yml +++ b/.github/workflows/wheel_win_x86_64.yml @@ -12,6 +12,7 @@ on: - master release: types: [published] + workflow_dispatch: env: DISTUTILS_USE_SDK: 1 @@ -23,7 +24,10 @@ concurrency: jobs: set_wheel_build_matrix: - if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'ci:build_wheels') + if: | + github.event_name != 'pull_request' || + contains(github.event.pull_request.labels.*.name, 'ci:build_wheels') || + github.event_name == 'workflow_dispatch' name: "Set wheel build matrix" uses: ./.github/workflows/set_wheel_build_matrix.yml with: @@ -172,7 +176,11 @@ jobs: regex: '.*[0-9]+.[0-9]+.[0-9]+[-_]?rc[0-9]+' - uses: actions/upload-artifact@v3 - if: ${{ github.event_name == 'release' || github.ref == 'refs/heads/master' || steps.rc_build.outputs.match != ''}} + if: | + github.event_name == 'release' || + github.event_name == 'workflow_dispatch' || + github.ref == 'refs/heads/master' || + steps.rc_build.outputs.match != '' with: name: ${{ runner.os }}-wheels-${{ matrix.pl_backend }}-${{ matrix.arch }}.zip path: ./wheelhouse/*.whl @@ -185,7 +193,9 @@ jobs: pl_backend: ["lightning_kokkos", "lightning_qubit"] runs-on: ubuntu-latest - if: ${{ github.event_name == 'release' || github.ref == 'refs/heads/master'}} + if: | + github.event_name == 'release' || + github.ref == 'refs/heads/master' steps: - uses: actions/download-artifact@v3 with: diff --git a/pennylane_lightning/core/_version.py b/pennylane_lightning/core/_version.py index 01c5ebb276..32534cfb8a 100644 --- a/pennylane_lightning/core/_version.py +++ b/pennylane_lightning/core/_version.py @@ -16,4 +16,4 @@ Version number (major.minor.patch[-label]) """ -__version__ = "0.36.0-dev34" +__version__ = "0.36.0-dev35"