Repository navigation
149 lines (134 loc) · 4.6 KB
/
Copy pathbuild.yml
File metadata and controls
149 lines (134 loc) · 4.6 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
# The "build" workflow produces wheels (and the sdist) for all python
# versions/platforms. Where possible (i.e. the build is not a cross-compile),
# the test suite is also run for the wheel (this test covers fewer
# configurations than the "test" workflow and tox.ini).
name: Build
on:
push:
branches:
# Run on release branches. This gives us a chance to detect rot in this
# configuration before pushing a tag (which we'd rather not have to undo).
- "branch[0-9]*"
tags:
# The main purpose of this workflow is to build wheels for release tags.
# It runs automatically on tags matching this pattern and pushes to pypi.
- "v*"
workflow_dispatch:
# Allow this workflow to be run manually (pushing to testpypi instead of pypi)
permissions:
contents: read
env:
# [[[cog cog.outl(f"python-version: '3.{default_python_minor}'")]]]
python-version: '3.13'
# [[[end]]]
jobs:
build_sdist:
name: Build sdist
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-python@v6
name: Install Python
with:
python-version: ${{ env.python-version }}
- name: Install dependencies
run: python -m pip install setuptools
- name: Check metadata
run: "python setup.py check"
- name: Build sdist
run: "python setup.py sdist && ls -l dist"
- uses: actions/upload-artifact@v7
with:
name: artifacts-sdist
path: ./dist/tornado-*.tar.gz
build_wheels:
name: Build wheels on ${{ matrix.os }}${{ matrix.name_suffix || '' }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, ubuntu-24.04-arm, windows-2025, windows-11-arm, macos-15]
emulated: [false]
include:
- os: ubuntu-24.04
emulated: true
arch: "riscv64"
name_suffix: "-riscv64"
- os: ubuntu-24.04
emulated: true
arch: "ppc64le"
name_suffix: "-ppc64le"
- os: ubuntu-24.04
emulated: true
arch: "s390x"
name_suffix: "-s390x"
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-python@v6
name: Install Python
with:
python-version: ${{ env.python-version }}
- name: Set up QEMU
if: matrix.emulated
uses: docker/setup-qemu-action@v4
with:
platforms: ${{ matrix.arch }}
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS: ${{ matrix.emulated && matrix.arch || '' }}
# Increase timeouts for emulated archs
CIBW_ENVIRONMENT: ${{ matrix.emulated && 'ASYNC_TEST_TIMEOUT=30 EMULATION=1' || '' }}
- uses: actions/upload-artifact@v7
with:
name: artifacts-${{ matrix.os }}${{ matrix.name_suffix || '' }}
path: ./wheelhouse/*.whl
upload_pypi_test:
name: Upload to PyPI (test)
needs: [build_wheels, build_sdist]
runs-on: ubuntu-24.04
timeout-minutes: 10
if: github.repository == 'tornadoweb/tornado' && github.event_name == 'workflow_dispatch'
permissions:
# This permission is required for pypi's "trusted publisher" feature
id-token: write
environment:
name: testpypi
url: https://test.pypi.org/project/tornado/
steps:
- uses: actions/download-artifact@v7
with:
pattern: artifacts-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
upload_pypi:
name: Upload to PyPI (prod)
needs: [build_wheels, build_sdist]
runs-on: ubuntu-24.04
timeout-minutes: 10
if: github.repository == 'tornadoweb/tornado' && github.event_name == 'push' && github.ref_type == 'tag' && startsWith(github.ref_name, 'v')
permissions:
# This permission is required for pypi's "trusted publisher" feature
id-token: write
environment:
# The pypi environment is configured to require approval before a job starts, so
# the build will stop here until the final release is approved by a maintainer.
name: pypi
url: https://pypi.org/project/tornado/
steps:
- uses: actions/download-artifact@v7
with:
pattern: artifacts-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1