Repository navigation
118 lines (110 loc) · 4.18 KB
/
Copy pathbuild-cwcwidth.yml
File metadata and controls
118 lines (110 loc) · 4.18 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
# SPDX-FileCopyrightText: 2026 The RISE Project
# SPDX-License-Identifier: MIT
---
# This workflow is based on upstream's own wheel builder:
# https://github.com/sebastinas/cwcwidth/blob/v0.1.12/.github/workflows/publish-twine.yaml
name: Build cwcwidth wheels (riscv64)
on:
workflow_dispatch:
inputs:
version:
description: 'Version glob to (re)build; empty builds every version of docs/packages/cwcwidth.yaml not released yet'
required: false
default: ''
cancel-in-progress:
description: Cancel an in-progress run in the same concurrency group.
required: false
type: boolean
default: true
pull_request:
branches: [main]
paths:
- '.github/workflows/build-cwcwidth.yml'
- 'docs/packages/cwcwidth.yaml'
push:
branches: [main]
paths:
- '.github/workflows/build-cwcwidth.yml'
- 'docs/packages/cwcwidth.yaml'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ case(github.event_name == 'pull_request', true, github.event_name == 'workflow_dispatch', inputs['cancel-in-progress'], false) }}
permissions:
contents: read # to fetch code (actions/checkout)
env:
MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64
jobs:
setup:
uses: $/.github/workflows/_setup.yml
with:
package: cwcwidth
version: ${{ inputs.version }}
# setup.py hardcodes py_limited_api="cp311" whenever USE_LIMITED_API is set, so
# the wheel is tagged cp311-abi3 regardless of which interpreter builds it.
# Build on cp311 itself (CLAUDE.md gotcha 96) rather than our usual cp312 floor,
# then reuse+test that wheel on cp312/cp313/cp314 (find_compatible_wheel).
build_abi3:
needs: [setup]
if: needs.setup.outputs.versions != '[]'
strategy:
fail-fast: false
matrix:
version: ${{ fromJSON(needs.setup.outputs.versions) }}
name: Build cwcwidth ${{ matrix.version }} cp311-abi3-manylinux_riscv64
# Free-threaded wheel: setup.py's py_limited_api flag has no free-threaded ABI
# to target, so this is an ordinary per-interpreter build.
uses: $/.github/workflows/_build-cibuildwheel.yml
with:
package: "cwcwidth"
version: "${{ matrix.version }}"
repository: "sebastinas/cwcwidth"
ref: "v${{ matrix.version }}"
artifact-tag: "cp311-abi3-manylinux_riscv64"
timeout-minutes: 90
cibw-build: "cp311-* cp312-* cp313-* cp314-*"
cibw-environment-linux: "USE_LIMITED_API=1"
# tests/ is a package (has __init__.py): pytest's prepend import mode
# would otherwise put the checkout root on sys.path[0] and shadow the
# installed wheel with the uncompiled cwcwidth/ source tree.
cibw-test-sources: "tests"
cibw-test-requires: "pytest"
cibw-test-command: "pytest tests -v"
cibw-test-environment: "LC_ALL=C.UTF-8 LANG=C.UTF-8"
build_freethreaded:
needs: [setup]
if: needs.setup.outputs.versions != '[]'
strategy:
fail-fast: false
matrix:
version: ${{ fromJSON(needs.setup.outputs.versions) }}
name: Build cwcwidth ${{ matrix.version }} cp314t-manylinux_riscv64
uses: $/.github/workflows/_build-cibuildwheel.yml
with:
package: "cwcwidth"
version: "${{ matrix.version }}"
repository: "sebastinas/cwcwidth"
ref: "v${{ matrix.version }}"
artifact-tag: "cp314t-manylinux_riscv64"
timeout-minutes: 90
cibw-build: "cp314t-*"
cibw-test-sources: "tests"
cibw-test-requires: "pytest"
cibw-test-command: "pytest tests -v"
cibw-test-environment: "LC_ALL=C.UTF-8 LANG=C.UTF-8"
publish:
name: Publish cwcwidth ${{ matrix.version }}
needs: [setup, build_abi3, build_freethreaded]
if: needs.setup.outputs.versions != '[]'
strategy:
fail-fast: false
matrix:
version: ${{ fromJSON(needs.setup.outputs.versions) }}
permissions:
contents: write
pull-requests: write
uses: $/.github/workflows/_publish-wheel.yml
secrets:
app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }}
with:
matrix: ${{ needs.setup.outputs.matrix }}
artifact-pattern: cwcwidth-${{ matrix.version }}-*-manylinux_riscv64