-
Notifications
You must be signed in to change notification settings - Fork 0
143 lines (113 loc) · 3.07 KB
/
release.yml
File metadata and controls
143 lines (113 loc) · 3.07 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
name: Release Artifacts
on:
push:
tags:
- "v*"
workflow_dispatch:
jobs:
release-version-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Validate tag, project version, and PyPI version
run: python scripts/check_release_version.py
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
version: "0.10.8"
- name: Install project
run: uv sync --no-dev
- name: Run pyright
run: uvx pyright
sdist:
runs-on: ubuntu-latest
needs:
- release-version-check
- typecheck
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
version: "0.10.8"
- name: Build sdist
run: uv build --sdist --no-sources
- name: Check sdist metadata
run: uvx --from twine twine check dist/*.tar.gz
- name: Smoke test sdist
run: uv run --isolated --no-project --with dist/*.tar.gz tests/smoke_test.py
- name: Upload sdist artifact
uses: actions/upload-artifact@v4
with:
name: rapidobj-sdist
path: dist/*.tar.gz
wheels:
runs-on: ${{ matrix.os }}
needs:
- release-version-check
- typecheck
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
steps:
- uses: actions/checkout@v4
- uses: pypa/cibuildwheel@v3.2.1
with:
output-dir: wheelhouse
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install twine
run: python -m pip install twine
- name: Check wheel metadata
shell: bash
run: python -m twine check wheelhouse/*.whl
- name: Upload wheel artifacts
uses: actions/upload-artifact@v4
with:
name: rapidobj-wheels-${{ matrix.os }}
path: wheelhouse/*.whl
publish-pypi:
name: Publish to PyPI
runs-on: ubuntu-latest
needs:
- release-version-check
- sdist
- wheels
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
environment:
name: pypi
url: https://pypi.org/p/rapidobj
permissions:
id-token: write
contents: read
steps:
- name: Download sdist artifact
uses: actions/download-artifact@v4
with:
name: rapidobj-sdist
path: dist
- name: Download wheel artifacts
uses: actions/download-artifact@v4
with:
pattern: rapidobj-wheels-*
merge-multiple: true
path: dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1