-
Notifications
You must be signed in to change notification settings - Fork 3
162 lines (141 loc) · 4.24 KB
/
release.yml
File metadata and controls
162 lines (141 loc) · 4.24 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
permissions:
contents: write
id-token: write
jobs:
linux-wheels:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
target:
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
if: matrix.target == 'aarch64-unknown-linux-gnu'
uses: docker/setup-qemu-action@v3
- name: Build wheel
uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380
with:
maturin-version: v1.13.1
target: ${{ matrix.target }}
manylinux: "2_28"
args: --release --locked --compatibility pypi --out dist --no-default-features --features python,openblas-static -i python${{ matrix.python-version }}
- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: wheels-linux-${{ matrix.target }}-py${{ matrix.python-version }}
path: dist/*
macos-wheels:
strategy:
fail-fast: false
matrix:
include:
- runner: macos-13
target: x86_64-apple-darwin
- runner: macos-14
target: aarch64-apple-darwin
python-version: ["3.10", "3.11", "3.12", "3.13"]
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install build dependencies
run: |
brew install gcc
python -m pip install --upgrade pip
python -m pip install maturin delocate
- name: Build wheel
run: |
python -m maturin build \
--release \
--locked \
--no-default-features \
--features python,openblas-static \
--out dist \
-i python
- name: Repair wheel
run: |
mkdir -p wheelhouse
if [[ "${{ matrix.target }}" == x86_64-* ]]; then
ARCHS=x86_64
else
ARCHS=arm64
fi
for wheel in dist/*.whl; do
delocate-wheel --require-archs "$ARCHS" -w wheelhouse "$wheel"
done
- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: wheels-macos-${{ matrix.target }}-py${{ matrix.python-version }}
path: wheelhouse/*
sdist:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Build sdist
uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380
with:
maturin-version: v1.13.1
command: sdist
args: --out dist
- name: Upload sdist artifact
uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*
github-release:
if: startsWith(github.ref, 'refs/tags/')
needs: [linux-wheels, macos-wheels, sdist]
runs-on: ubuntu-24.04
steps:
- uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
files: artifacts/**/*
publish-pypi:
if: startsWith(github.ref, 'refs/tags/')
needs: [linux-wheels, macos-wheels, sdist]
runs-on: ubuntu-24.04
environment:
name: pypi
url: https://pypi.org/p/clostera
steps:
- uses: actions/download-artifact@v4
with:
path: artifacts
- name: Collect distribution files
run: |
mkdir -p dist
find artifacts -type f \( -name '*.whl' -o -name '*.tar.gz' \) -exec cp {} dist/ \;
ls -lh dist
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Validate distribution metadata
run: |
python -m pip install --upgrade pip twine
python -m twine check --strict dist/*
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist