build_and_store_wheels: &BUILD_AND_STORE_WHEELS
  install_cibuildwheel_script:
    - python -m pip install cibuildwheel==2.16.2
  run_cibuildwheel_script:
    - cibuildwheel
  wheels_artifacts:
    path: "wheelhouse/*"

  # Upload only for tagged commit
  only_if: $CIRRUS_TAG != ''
  publish_script:
    - python -m pip install twine
    - python -m twine upload --repository-url https://upload.pypi.org/legacy/ --username __token__ wheelhouse/*.whl


linux_aarch64_task:
  name: Build Linux aarch64 wheels.
  compute_engine_instance:
    image_project: cirrus-images
    image: family/docker-builder-arm64
    architecture: arm64
    platform: linux
    cpu: 4
    memory: 4G
  environment:
    TWINE_PASSWORD: ENCRYPTED[ade2037764e68fea251152f7585f3f77cdd748af06dc0f06942c45a8a8770fff19032c985f8dc193229c8adb2c0fecb9]

  install_pre_requirements_script:
    - apt install -y python3-venv python-is-python3
  <<: *BUILD_AND_STORE_WHEELS
