-
Notifications
You must be signed in to change notification settings - Fork 7
66 lines (59 loc) · 2.14 KB
/
hqs-build-deploy-rust-pyo3.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: HQS build and deploy for rust pyo3 repos
on:
workflow_dispatch:
release:
types: [created]
jobs:
deploy_cratesio:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# - uses: Swatinem/rust-cache@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
default: true
- name: setup cargo
run: |
# Authentication at crates.io with HQS organizational token
cargo login ${{ secrets.CRATES_IO_API_TOKEN }}
# publishing a specific package to crates.io
cargo publish --manifest-path=qoqo_calculator/Cargo.toml
# Wait to publish next package (e.g. the Python interface)
# that depends on previous package so that crates.io is
# updated and accepts the upload
sleep 60
# publish second package
cargo publish --manifest-path=qoqo_calculator_pyo3/Cargo.toml
# Build linux wheels and upload them to PyPi
build_maturin_builds_linux:
name: maturin_build-linux
needs: deploy_cratesio
uses: HQSquantumsimulations/reusable_workflows/.github/workflows/reusable_build_maturin_linux.yml@main
with:
py_interface_folder: "qoqo_calculator_pyo3"
deploy: true
# Whether to build for aarch64. Can fail if there are C/C++ dependencies
build_for_arm: true
secrets: inherit
# Build macos wheels and upload them to PyPi
build_maturin_builds_macos:
name: maturin_build-macos
needs: deploy_cratesio
uses: HQSquantumsimulations/reusable_workflows/.github/workflows/reusable_build_maturin_macos.yml@main
with:
py_interface_folder: "qoqo_calculator_pyo3"
# Universal2 builds do not work with LTO at the moment and would cause inacceptable slowdown
universal2: true
deploy: true
secrets: inherit
# Build windows wheels and upload them to PyPi
build_maturin_builds_windows:
name: maturin_build-windows
needs: deploy_cratesio
uses: HQSquantumsimulations/reusable_workflows/.github/workflows/reusable_build_maturin_windows.yml@main
with:
py_interface_folder: "qoqo_calculator_pyo3"
deploy: true
secrets: inherit