-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
55 lines (51 loc) · 1.3 KB
/
.gitlab-ci.yml
File metadata and controls
55 lines (51 loc) · 1.3 KB
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
default:
before_script:
- cd ./pyreccaster/
cache:
paths:
- .venv
- .cargo/bin
- .cargo/registry/index
- .cargo/registry/cache
- target/debug/deps
- target/debug/build
variables:
CARGO_HOME: "$CI_PROJECT_DIR/.cargo"
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
stages:
- build
- publish
build:
stage: build
image:
name: ghcr.io/pyo3/maturin:latest
entrypoint: [""]
environment:
name: $TARGET
parallel:
matrix:
- TARGET: ["x86_64-pc-windows-gnu", "x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu", "x86_64-apple-darwin", "aarch64-apple-darwin"]
script:
- python -m venv venv
- source venv/bin/activate
- pip install ziglang
- rustup target add $TARGET
- maturin build --release --interpreter python3.9 --target $TARGET --zig
artifacts:
when: on_success
paths:
- target/wheels/*.whl
publish:
stage: publish
needs: ["build"]
image:
name: ghcr.io/pyo3/maturin:main
entrypoint: [""]
variables:
TWINE_USERNAME: gitlab-ci-token
TWINE_PASSWORD: $CI_JOB_TOKEN
script:
- python -m venv venv
- source venv/bin/activate
- pip install twine
- python -m twine upload --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi ../target/wheels/*.whl