-
Notifications
You must be signed in to change notification settings - Fork 2
/
.cirrus.yml
89 lines (84 loc) · 3.06 KB
/
.cirrus.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
.clone_script: &clone |
if [ -z "$CIRRUS_PR" ]; then
git clone --recursive --branch=$CIRRUS_BRANCH https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git $CIRRUS_WORKING_DIR
git reset --hard $CIRRUS_CHANGE_IN_REPO
else
git clone https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git $CIRRUS_WORKING_DIR
git fetch origin pull/$CIRRUS_PR/head:pull/$CIRRUS_PR
git checkout $CIRRUS_BASE_BRANCH
git -c user.email="[email protected]" merge --no-commit pull/$CIRRUS_PR
git submodule update --init --recursive
fi
.statistics_script: &statistics |
ccache -s -v
echo $(python -m pip cache dir)
echo $(python -m pip cache list)
build_and_store_wheels: &BUILD_AND_STORE_WHEELS
install_cibuildwheel_script:
- python -m pip install cibuildwheel~=2.15.0
run_cibuildwheel_script:
- cibuildwheel
wheels_artifacts:
path: "wheelhouse/*"
linux_aarch64_wheels_task:
only_if: "$CIRRUS_RELEASE != ''"
name: 🐍 Packaging / 🎡 🐧 arm64
alias: linux_aarch64_wheels
clone_script: *clone
compute_engine_instance:
image_project: cirrus-images
image: family/docker-builder-arm64
architecture: arm64
platform: linux
cpu: 8
env:
CIBW_BEFORE_ALL_LINUX: /opt/python/cp311-cp311/bin/pip install z3-solver==4.11.2
setup_pyhton_script:
- apt-get install -y python3-venv python-is-python3
<<: *BUILD_AND_STORE_WHEELS
macos_arm64_wheels_task:
only_if: "$CIRRUS_RELEASE != ''"
name: 🐍 Packaging / 🎡 🍎 arm64
alias: macos_arm64_wheels
clone_script: *clone
macos_instance:
image: ghcr.io/cirruslabs/macos-monterey-xcode:latest
ccache_cache:
folder: .ccache
populate_script:
- mkdir -p .ccache
fingerprint_key: ccache-macosx_arm64-wheels
pip_cache:
folder: /Users/admin/Library/Caches/pip
prepare_env_script: |
brew install [email protected] ccache pipx ninja nox z3
ln -s $(which python3.10) python
export PATH=/opt/homebrew/opt/[email protected]/libexec/bin:$PATH
export PATH=/opt/homebrew/opt/ccache/libexec:$PATH
export PATH=/opt/homebrew/opt/pipx/libexec:$PATH
export PATH=/opt/homebrew/opt/ninja/libexec:$PATH
export PATH=/opt/homebrew/opt/nox/libexec:$PATH
echo "PATH=$PATH" >> $CIRRUS_ENV
echo "CCACHE_DIR=$PWD/.ccache" >> $CIRRUS_ENV
echo "Z3_ROOT=/opt/homebrew/opt/z3" >> $CIRRUS_ENV
<<: *BUILD_AND_STORE_WHEELS
statistics_script: *statistics
publish_task:
name: 🚀 Deploy to PyPI
container: { image: "python:3.10-bullseye" }
depends_on:
- linux_aarch64_wheels
- macos_arm64_wheels
only_if: "$CIRRUS_RELEASE != ''"
env:
TWINE_REPOSITORY: pypi
TWINE_USERNAME: __token__
TWINE_PASSWORD: "ENCRYPTED\
[1c1eaa77a8b153f380723c78e20a21b09efb4926fadca6eb\
e2202650f4d57a7d496f9068dbc2c41f9da1e7858b8840b6]"
install_script: pip install twine
publish_script:
- curl -L https://api.cirrus-ci.com/v1/artifact/build/$CIRRUS_BUILD_ID/wheels.zip -o wheels.zip
- unzip wheels.zip
- python -m twine check wheelhouse/*
- python -m twine upload wheelhouse/*