-
Notifications
You must be signed in to change notification settings - Fork 1
142 lines (134 loc) · 5.85 KB
/
deploy.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: publish-wheels
on:
push:
tags:
- v*
workflow_dispatch:
jobs:
# Linux is specific: because of manylinux, we have to use a docker file
build-linux64-wheels:
runs-on: ubuntu-latest
# CentOS 7 64 bits Docker Hub image that 'build-linux-wheels' executes in.
# See https://github.com/pypa/manylinux for this particular container:
# * CPython 3.5, 3.6, 3.7, 3.8, 3.9 and 3.10, installed in /opt/python/<python tag>-<abi tag>
container: quay.io/pypa/manylinux_2_28_x86_64:latest
steps:
- name: "Checkout the full project"
uses: actions/checkout@v1
- name: "Install Rust"
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
- name: "Build and publish wheels"
shell: bash
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN_FXP }}
run: |
source $HOME/.cargo/env
cd crates/cli
for PYBIN in /opt/python/cp312-*/bin; do
"${PYBIN}/pip" install maturin
"${PYBIN}/maturin" publish -b bin -i "${PYBIN}/python" --skip-existing --compatibility manylinux_2_28
done
# Decomment if 32 bit asked one day...
build-linux32-wheels:
runs-on: ubuntu-latest
# CentOS 7 32 bits Docker Hub image that 'build-linux-wheels' executes in.
# See https://github.com/pypa/manylinux for this particular container:
# * CPython 3.5, 3.6, 3.7, 3.8, 3.9 and 3.10, installed in /opt/python/<python tag>-<abi tag>
container: quay.io/pypa/manylinux2014_i686
steps:
- name: "Checkout the full project"
uses: actions/checkout@v1
- name: "Install Rust"
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-host i686-unknown-linux-gnu -y
- name: "Build and publish wheels"
shell: bash
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN_FXP }}
run: |
source $HOME/.cargo/env
cd crates/cli
for PYBIN in /opt/python/cp312-*/bin; do
"${PYBIN}/pip" install maturin
"${PYBIN}/maturin" publish -b bin -i "${PYBIN}/python" --skip-existing --compatibility manylinux2014
done
build-aarch64-wheels:
runs-on: ubuntu-latest
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN_FXP }}
img: quay.io/pypa/manylinux2014_aarch64
steps:
- name: Checkout
uses: actions/checkout@v1
- name: "Set up QEMU"
id: qemu
uses: docker/setup-qemu-action@v1
- name: Install dependencies
run: |
docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
-e MATURIN_PYPI_TOKEN=${{ secrets.PYPI_API_TOKEN_FXP }} \
${{ env.img }} \
bash -exc 'curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-host aarch64-unknown-linux-gnu -y && \
source $HOME/.cargo/env && \
cd crates/cli && \
for PYBIN in /opt/python/cp312-*/bin; do
"${PYBIN}/pip" install maturin
"${PYBIN}/maturin" publish -b bin -i "${PYBIN}/python" --skip-existing --compatibility manylinux2014 --config "net.git-fetch-with-cli = true"
done'
# Deploy for Windows 64 bits.
# If Windows 32 bits needed, check e.g. https://github.com/marketplace/actions/setup-msys2
build-windows-wheels:
runs-on: ${{ matrix.os }}
strategy:
# Run all matrix jobs even if one is failling (default behaviour is to stop all jobs)
# To be changed when option --skip-existing will be available in maturin
fail-fast: false
matrix:
os: [windows-latest]
python-version: ['3.12']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Build and publish wheel for Python ${{ matrix.python-version }} on ${{ matrix.os }}
# We do not use environement variable for user, because it seems that the way of providing it in the command
# line is not the same for macos and for windows. We should create 2 different actions (see
# https://docs.github.com/en/actions/reference/encrypted-secrets )
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN_FXP }}
run: |
pip install maturin
cd crates/cli
maturin publish -b bin -i python${{matrix.python_version}} --skip-existing
# Deploy for MacOS 64 bits both X86 and aarch64.
build-macos-wheels:
runs-on: ${{ matrix.os }}
strategy:
# Run all matrix jobs even if one is failling (default behaviour is to stop all jobs)
# To be changed when option --skip-existing will be available in maturin
fail-fast: false
matrix:
os: [macOS-latest]
python-version: ['3.12']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Build and publish wheel for Python ${{ matrix.python-version }} on ${{ matrix.os }}
# We do not use environement variable for user, because it seems that the way of providing it in the command
# line is not the same for macos and for windows. We should create 2 different actions (see
# https://docs.github.com/en/actions/reference/encrypted-secrets )
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN_FXP }}
run: |
rustup target add aarch64-apple-darwin
rustup target add x86_64-apple-darwin
pip install maturin
cd crates/cli
maturin publish -b bin --interpreter python${{matrix.python_version}} --target universal2-apple-darwin --skip-existing
maturin publish -b bin --interpreter python${{matrix.python_version}} --skip-existing