Repository navigation
119 lines (102 loc) · 3.42 KB
/
Copy pathwheels.yml
File metadata and controls
119 lines (102 loc) · 3.42 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
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
name: Wheels
# the cibuildwheel settings are in pyproject.toml
on:
push:
branches: [master]
tags: ["v*"]
# not for tags
paths:
- ".github/workflows/wheels.yml"
- "tools/wheels/**"
- "pyproject.toml"
- "setup.py"
- "MANIFEST.in"
workflow_dispatch:
jobs:
wheels:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Linux x86_64 and aarch64, macOS x86_64 and arm64
os: [ubuntu-latest, ubuntu-24.04-arm, macos-15-intel, macos-latest]
steps:
- uses: actions/checkout@v7
- uses: pypa/cibuildwheel@v4.3.5
- name: Check the licenses of the libraries in the Linux wheels
if: runner.os == 'Linux'
run: |
for whl in wheelhouse/*.whl; do
python3 -m zipfile -e "$whl" /tmp/whl
grep -q 'Apache License' /tmp/whl/*.dist-info/licenses/LICENSE
grep -q 'Daniel Stenberg' /tmp/whl/*.dist-info/licenses/LICENSE
rm -rf /tmp/whl
done
- uses: actions/upload-artifact@v7
with:
name: wheels-${{ matrix.os }}
path: wheelhouse/*.whl
sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Build the source distribution
run: pipx run build --sdist
- name: Check the metadata
run: pipx run twine check --strict dist/*
- uses: actions/upload-artifact@v7
with:
name: sdist
path: dist/*.tar.gz
# the libcurl in the Linux wheels has no CA bundle of its own: check HTTPS
# on other distributions than the one the wheels are built on
https:
needs: wheels
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
image: ["ubuntu:24.04", "debian:13", "fedora:latest", "opensuse/tumbleweed"]
container: ${{ matrix.image }}
steps:
- name: Install Python
run: |
if command -v apt-get; then
apt-get update && apt-get install -y python3-venv ca-certificates
elif command -v dnf; then
dnf install -y python3
else
zypper --non-interactive install python3
fi
- uses: actions/checkout@v7
- uses: actions/download-artifact@v8
with:
name: wheels-ubuntu-latest
path: wheelhouse
- name: Install the wheel
run: |
python3 -m venv /tmp/venv
/tmp/venv/bin/pip install numpy
/tmp/venv/bin/pip install --no-index --find-links wheelhouse pycorearray
- name: Read a file over HTTPS
run: /tmp/venv/bin/python tools/wheels/check_https.py
# a tag like v0.2.0rc1 goes to TestPyPI, and a final tag like v0.2.0 to PyPI
publish:
if: startsWith(github.ref, 'refs/tags/v')
needs: [wheels, sdist, https]
runs-on: ubuntu-latest
environment: ${{ contains(github.ref_name, 'rc') && 'testpypi' || 'pypi' }}
# for Trusted Publishing
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v8
with:
path: dist
merge-multiple: true
# a version can not be uploaded twice
- name: Check that the tag is the version of the package
run: test -f "dist/pycorearray-${GITHUB_REF_NAME#v}.tar.gz"
- uses: pypa/gh-action-pypi-publish@v1.14.3
with:
repository-url: ${{ contains(github.ref_name, 'rc') && 'https://test.pypi.org/legacy/' || 'https://upload.pypi.org/legacy/' }}