Repository navigation
151 lines (135 loc) · 4.52 KB
/
Copy pathpypi.yml
File metadata and controls
151 lines (135 loc) · 4.52 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
name: "📦 PyPI "
on:
workflow_dispatch:
permissions:
contents: read
jobs:
# loop-interpolation-core is the Rust core behind the optional extra
# loop-interpolation[native]. It has compiled wheels, so it is built by
# core-wheels.yml and not by the sdist matrix below. No other package
# waits for it: a failed core upload does not stop their release.
build_core:
name: Build loop-interpolation-core
uses: ./.github/workflows/core-wheels.yml
# Trusted publishing (OIDC): no password. PyPI must list this repository
# and the workflow file pypi.yml as a trusted publisher of the project.
upload_core_to_pypi:
name: Upload loop-interpolation-core to PyPI
needs: ["build_core"]
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: core-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
verbose: true
# loop_common/loop_interpolation/loopstructural_visualisation are
# workspace-local deps of LoopStructural (see [tool.uv.sources] in
# pyproject.toml) — loop_common/loop_interpolation are runtime deps,
# loopstructural_visualisation backs the `visualisation`/`docs` extras.
# They must land on PyPI before the LoopStructural sdist below is
# uploaded, or `pip install LoopStructural[...]` breaks for anyone not
# using uv. map2loop (ROADMAP.md Stage 4, outcome 7) has no such reverse
# dependency — it rides in the same matrix purely for its own independent
# PyPI publishing, not for a gating reason.
make_sdist_packages:
name: Make SDist (${{ matrix.package }})
runs-on: ubuntu-latest
strategy:
matrix:
package: [loop_common, loop_interpolation, map2loop, loopstructural_visualisation]
steps:
- uses: actions/checkout@v4
- name: Build SDist
working-directory: packages/${{ matrix.package }}
run: |
pip install build
python -m build
- uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.package }}
path: packages/${{ matrix.package }}/dist/
upload_packages_to_pypi:
name: Upload ${{ matrix.package }} to PyPI
needs: ["make_sdist_packages"]
runs-on: "ubuntu-latest"
strategy:
matrix:
package: [loop_common, loop_interpolation, map2loop, loopstructural_visualisation]
steps:
- uses: actions/download-artifact@v4
with:
name: dist-${{ matrix.package }}
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
skip_existing: true
verbose: true
user: ${{ secrets.PYPI_USERNAME }}
password: ${{ secrets.PYPI_PASSWORD }}
# loop-link is not a dependency of LoopStructural, so no other job waits
# for it. Trusted publishing (OIDC): no password. PyPI must list this
# repository and the workflow file pypi.yml as a trusted publisher of
# the project loop-link.
make_sdist_loop_link:
name: Make SDist (loop_link)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build SDist
working-directory: packages/loop_link
run: |
pip install build
python -m build
- uses: actions/upload-artifact@v4
with:
name: dist-loop_link
path: packages/loop_link/dist/
upload_loop_link_to_pypi:
name: Upload loop-link to PyPI
needs: ["make_sdist_loop_link"]
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: dist-loop_link
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
verbose: true
make_sdist:
name: Make SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build SDist
run: |
pip install build
python -m build
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
upload_to_pypi:
needs: ["make_sdist", "upload_packages_to_pypi"]
runs-on: "ubuntu-latest"
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
skip_existing: true
verbose: true
user: ${{ secrets.PYPI_USERNAME }}
password: ${{ secrets.PYPI_PASSWORD }}