|
| 1 | +build_and_store_wheels: &BUILD_AND_STORE_WHEELS |
| 2 | + install_cibuildwheel_script: |
| 3 | + - python -m pip install cibuildwheel==2.11.2 |
| 4 | + run_cibuildwheel_script: |
| 5 | + - cibuildwheel |
| 6 | + wheels_artifacts: |
| 7 | + path: "wheelhouse/*" |
| 8 | + |
| 9 | +.clone_script: &clone | |
| 10 | + if [ -z "$CIRRUS_PR" ]; then |
| 11 | + git clone --recursive --branch=$CIRRUS_BRANCH https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git $CIRRUS_WORKING_DIR |
| 12 | + git reset --hard $CIRRUS_CHANGE_IN_REPO |
| 13 | + else |
| 14 | + git clone --recursive https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git $CIRRUS_WORKING_DIR |
| 15 | + git fetch origin pull/$CIRRUS_PR/head:pull/$CIRRUS_PR |
| 16 | + git reset --hard $CIRRUS_CHANGE_IN_REPO |
| 17 | + fi |
| 18 | + |
| 19 | +linux_aarch64_task: |
| 20 | + name: Build Linux aarch64 wheels. |
| 21 | + clone_script: *clone |
| 22 | + compute_engine_instance: |
| 23 | + image_project: cirrus-images |
| 24 | + image: family/docker-builder-arm64 |
| 25 | + architecture: arm64 |
| 26 | + platform: linux |
| 27 | + cpu: 4 |
| 28 | + env: |
| 29 | + CIBW_SKIP: "*-musllinux_*" |
| 30 | + |
| 31 | + install_pre_requirements_script: |
| 32 | + - apt install -y python3-venv python-is-python3 |
| 33 | + <<: *BUILD_AND_STORE_WHEELS |
| 34 | + |
| 35 | +macos_arm64_task: |
| 36 | + name: Build macOS arm64 wheels. |
| 37 | + clone_script: *clone |
| 38 | + macos_instance: |
| 39 | + image: ghcr.io/cirruslabs/macos-monterey-xcode |
| 40 | + |
| 41 | + env: |
| 42 | + PATH: /opt/homebrew/opt/[email protected]/bin:$PATH |
| 43 | + install_pre_requirements_script: |
| 44 | + |
| 45 | + - ln -s python3 /opt/homebrew/opt/[email protected]/bin/python |
| 46 | + <<: *BUILD_AND_STORE_WHEELS |
| 47 | + |
| 48 | +publish_task: |
| 49 | + name: Upload to PyPI |
| 50 | + container: { image: "python:3.10-bullseye" } |
| 51 | + depends_on: [linux_aarch64, macos_arm64] |
| 52 | + only_if: "$CIRRUS_RELEASE != ''" |
| 53 | + env: |
| 54 | + TWINE_REPOSITORY: pypi |
| 55 | + TWINE_USERNAME: __token__ |
| 56 | + TWINE_PASSWORD: ENCRYPTED[963630b0d5f7e9ad0aba1e51f63d69ecc36ea550ccce3a382cee179da6b286ccc644aebd482f97a919f1f6a1810a0d25] |
| 57 | + install_script: pip install twine |
| 58 | + publish_script: |
| 59 | + - curl -L https://api.cirrus-ci.com/v1/artifact/build/$CIRRUS_BUILD_ID/wheels.zip | tar xvz -C dist |
| 60 | + - python -m twine check dist/* |
| 61 | + - python -m twine upload dist/* |
0 commit comments