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 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
|
# See pyproject.toml for more cibuildwheel configuration. Putting it here is a
# problem due to GitLab CI interpreting env variables as someting it should
# render itself...
stages:
- test
- release
# For tagged versions, upload to PyPI
release:
stage: release
image: python:3.11
dependencies:
- linux
- macos
- windows
only:
- tags
script:
- python -m pip install --upgrade pip
- pip install maturin
# Create sdist (maturin needs cargo to do an sdist, sigh):
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable -y
- PATH=~/.cargo/bin:$PATH maturin sdist
- mkdir -p wheelhouse
- mv target/wheels/*.tar.gz wheelhouse/
# Upload:
- maturin upload --username "__token__" wheelhouse/*
linux:
image: python:3.11
only:
- main
- merge_requests
- tags
stage: test
# Run Docker, so cibuildwheel can use it.
services:
- name: docker:dind
# Tell Docker client where to find it.
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
script:
- curl -sSL https://get.docker.com/ | sh
- python -m pip install cibuildwheel==2.20
- cibuildwheel --output-dir wheelhouse
artifacts:
paths:
- wheelhouse/
# https://docs.gitlab.com/ee/ci/runners/saas/macos_saas_runner.html
macos:
only:
- main
- merge_requests
- tags
stage: test
tags:
- saas-macos-medium-m1
image: macos-14-xcode-15
variables:
MACOSX_DEPLOYMENT_TARGET: "11.0"
ARCHFLAGS: " -arch x86_64 -arch arm64"
# Can't be set in pyproject.toml, alas
CIBW_ARCHS_MACOS: "universal2"
script:
- python -m pip install --upgrade pip
- python -m pip install cibuildwheel==2.20
- python -m cibuildwheel --output-dir wheelhouse
artifacts:
paths:
- wheelhouse/
windows:
only:
- main
- merge_requests
- tags
stage: test
tags:
- saas-windows-medium-amd64
script:
- Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
- choco install -y rustup.install
- refreshenv
- rustup toolchain install --no-self-update stable-msvc
- refreshenv
- cargo --version
- py -m pip install cibuildwheel==2.20
- py -m cibuildwheel --output-dir wheelhouse --prerelease-pythons
artifacts:
paths:
- wheelhouse/
|