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 827a9da816..15ea2540f2 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 ab0d7ef2f9..5bc73193ba 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 88b886c4b0..b544ea87ae 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 8df4bdc968..34a4f1e8dc 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 363448d5d6..555b38b91f 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 ba37f8df94..7ae7846124 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: @@ -189,7 +193,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 @@ -202,7 +210,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: