File: build.yml

package info (click to toggle)
python-tornado 6.5.4-0.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,208 kB
  • sloc: python: 28,773; javascript: 156; sh: 100; ansic: 72; makefile: 49; xml: 49; sql: 23
file content (113 lines) | stat: -rw-r--r-- 3,501 bytes parent folder | download
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
# 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: {}

env:
  python-version: '3.9'

jobs:
  build_sdist:
    name: Build sdist
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v4
        with:
          persist-credentials: false
      - uses: actions/setup-python@v5
        name: Install Python
        with:
          python-version: ${{ env.python-version }}

      - name: Check metadata
        run: "python setup.py check"
      - name: Build sdist
        run: "python setup.py sdist && ls -l dist"

      - uses: actions/upload-artifact@v4
        with:
          name: artifacts-sdist
          path: ./dist/tornado-*.tar.gz

  build_wheels:
    name: Build wheels on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-22.04, ubuntu-22.04-arm, windows-2022, macos-15]

    steps:
      - uses: actions/checkout@v4
        with:
          persist-credentials: false
      - uses: actions/setup-python@v5
        name: Install Python
        with:
          python-version: ${{ env.python-version }}

      - name: Build wheels
        uses: pypa/cibuildwheel@v2.22

      - name: Audit ABI3 compliance
        # This may be moved into cibuildwheel itself in the future. See
        # https://github.com/pypa/cibuildwheel/issues/1342
        run: "pip install abi3audit && abi3audit --verbose --summary ./wheelhouse/*.whl"

      - uses: actions/upload-artifact@v4
        with:
          name: artifacts-${{ matrix.os }}
          path: ./wheelhouse/*.whl

  upload_pypi_test:
    name: Upload to PyPI (test)
    needs: [build_wheels, build_sdist]
    runs-on: ubuntu-22.04
    if: github.repository == 'tornadoweb/tornado' && github.event_name == 'workflow_dispatch'
    permissions:
      # This permission is required for pypi's "trusted publisher" feature
      id-token: write
    steps:
      - uses: actions/download-artifact@v4
        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-22.04
    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
    steps:
      - uses: actions/download-artifact@v4
        with:
          pattern: artifacts-*
          path: dist
          merge-multiple: true

      - uses: pypa/gh-action-pypi-publish@release/v1