-
Notifications
You must be signed in to change notification settings - Fork 73
221 lines (185 loc) · 5.62 KB
/
package.yml
File metadata and controls
221 lines (185 loc) · 5.62 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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
name: PyPI Packages
on:
push:
branches:
- main
- future/*
- series/*
pull_request:
release:
types: [published]
jobs:
sdist:
name: Build sdist
runs-on: ubuntu-latest
outputs:
lenskit-version: ${{steps.version.outputs.version}}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 🏷️ Fetch Git tags
run: git fetch --tags
- name: Install mise-en-place
uses: jdx/mise-action@v2
- name: 🕶️ Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.12.5"
activate-environment: true
- name: Install dependencies
run: uv sync --only-group=scripting
env:
UV_LOCKED: 1
- name: Identify version
id: version
run: |
mise run version -- --github
- name: Build source distribution
id: sdist
run: |
mise run build:dist -- -ds
- name: Save archive
uses: actions/upload-artifact@v4
with:
name: pypi-dist-src
path: |
dist
!dist/CACHEDIR.TAG
- name: List dist dir
run: ls -R dist
wheels:
name: Build wheels for ${{matrix.plat.target}} on ${{ matrix.plat.host }}
needs: [sdist]
runs-on: ${{ matrix.plat.host }}
strategy:
matrix:
plat:
- host: ubuntu-22.04
pyarch: x64
target: x86_64
manylinux: 2_28
- host: ubuntu-24.04-arm
pyarch: arm64
target: aarch64
manylinux: 2_28
- host: windows-latest
pyarch: x64
target: x64
manylinux: auto
- host: macos-14
pyarch: arm64
target: aarch64
manylinux: auto
steps:
- name: Fetch source distribution
uses: actions/download-artifact@v4
with:
name: pypi-dist-src
path: dist
- name: List distribution directory
run: ls dist
- name: Extract source distribution
run: |
tar xvf dist/lenskit-${{needs.sdist.outputs.lenskit-version}}.tar.gz --strip-components=1
- uses: actions/setup-python@v5
with:
python-version: "3.12.5"
architecture: ${{matrix.plat.pyarch}}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
args: --release --out dist
target: ${{ matrix.plat.target }}
manylinux: ${{ matrix.plat.manylinux }}
- name: Build free-threaded wheels
uses: PyO3/maturin-action@v1
if: matrix.plat.host != 'windows-latest'
with:
args: --release --out dist -i 3.14t
target: ${{ matrix.plat.target }}
manylinux: ${{ matrix.plat.manylinux }}
- uses: actions/upload-artifact@v4
with:
name: pypi-dist-wheels-${{ matrix.plat.host }}-${{ matrix.plat.target }}
path: ./dist/*.whl
dev-publish:
name: Publish to INERTIAL PyPI
runs-on: ubuntu-latest
needs: [sdist, wheels]
if: github.event_name == 'push' || github.event_name == 'release'
environment: local-pip
steps:
- name: Fetch compiled package distributions
uses: actions/download-artifact@v4
with:
pattern: pypi-dist-*
path: dist
merge-multiple: true
- name: List packages
run: ls dist
- name: 🕶️ Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.12.5"
activate-environment: true
- name: Set up Rclone configuration
run: |
sudo apt install -y rclone
mkdir -p ~/.config/rclone
pass=$(rclone obscure $WEBDAV_PASSWORD)
cat >~/.config/rclone/rclone.conf <<EOF
[inertial-pypi]
type = webdav
url = https://inertial.cci.drexel.edu/dist/lenskit-dev/
vendor = other
user = $WEBDAV_USER
pass = $pass
EOF
env:
WEBDAV_USER: ${{vars.WEBDAV_USER}}
WEBDAV_PASSWORD: ${{secrets.WEBDAV_PASSWORD}}
- name: List remote
run: "rclone lsd inertial-pypi:"
- name: Upload packages
run: |
rclone copy --exclude=CACHEDIR.TAG dist inertial-pypi:packages/
- name: List all packages
run: |
rclone lsf inertial-pypi:packages/ |tee packages.lst
- name: Prepare package index
run: |
uvx dumb-pypi --output-dir index --package-list packages.lst --packages-url https://inertial.cci.drexel.edu/dist/lenskit-dev/packages/
- name: Upload package index
run: |
rclone copy index inertial-pypi:
- name: "🧑🏼🎤 Activate central index update"
uses: actions/script@v7
with:
github-token: "${{ secrets.INDEX_TOKEN }}"
script: |
github.rest.actions.createWorkflowDispatch({
owner: 'lenskit',
repo: 'lenskit-pypi',
workflow_id: 'publish.yml',
ref: 'main',
})
pypi-publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [sdist, wheels]
if: github.event_name == 'release'
environment: release
permissions:
id-token: write
steps:
- name: Fetch compiled package distributions
uses: actions/download-artifact@v4
with:
pattern: pypi-dist-*
path: dist
merge-multiple: true
- name: List distribution artifacts
run: ls -R dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1