-
Notifications
You must be signed in to change notification settings - Fork 12
134 lines (122 loc) · 4.17 KB
/
publish-pypi.yaml
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
on:
release:
types: [created, edited]
pull_request:
types: [opened, reopened]
name: publish pypi
jobs:
# derived from pydantic-core build:
# https://github.com/pydantic/pydantic-core/blob/8568136ee9abdca8a1c8b631750a4896bb25522e/.github/workflows/ci.yml#L399
build:
name: build for ${{ matrix.os }} / ${{ matrix.target }} / ${{ matrix.interpreter }}
# only run on release or if PR has label "Full Build"
if: startsWith(github.ref, 'refs/tags/') || contains(github.event.pull_request.labels.*.name, 'Full Build')
strategy:
fail-fast: true
matrix:
# placeholder matrix, so the various cases are explicitly listed below
os: [foo]
target: [foo]
manylinux: [foo]
exclude:
- os: foo
target: foo
manylinux: foo
include:
#
# Linux
#
- os: linux
manylinux: auto
interpreter: 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10
target: x86_64
- os: linux
manylinux: auto
interpreter: 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10
target: aarch64
- os: linux
manylinux: auto
interpreter: 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10
target: i686
- os: linux
manylinux: auto
interpreter: 3.9 3.10 3.11 3.12 3.13 # no pypy
target: armv7
# not supported by zydis/zycore:
# target: ppc64le
# target: s390x
#
# macOS
#
- os: macos
interpreter: 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10
target: x86_64
- os: macos
interpreter: 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10
target: aarch64
#
# Windows
#
- os: windows
interpreter: 3.9 3.10 3.11 3.12 3.13 # no pypy
# pypy doesn't seem to link today? needs investigation
# https://github.com/williballenthin/lancelot/actions/runs/11592290081/job/32273843597
target: x86_64
- os: windows
interpreter: 3.9 3.10 3.11 3.12 3.13 # no pypy
target: i686
python-architecture: x86
runs-on: ${{ (matrix.os == 'linux' && 'ubuntu') || matrix.os }}-latest
steps:
- uses: actions/checkout@v4
- name: set up python
uses: actions/setup-python@v5
with:
python-version: '3.13'
architecture: ${{ matrix.python-architecture || 'x64' }}
- name: build pylancelot wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
manylinux: ${{ matrix.manylinux }}
args: --release --out dist --interpreter ${{ matrix.interpreter }} --manifest-path=./pylancelot/Cargo.toml
rust-toolchain: nightly
docker-options: -e CI
- name: build pyflirt wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
manylinux: ${{ matrix.manylinux }}
args: --release --out dist --interpreter ${{ matrix.interpreter }} --manifest-path=./pyflirt/Cargo.toml
rust-toolchain: nightly
docker-options: -e CI
- run: ${{ (matrix.os == 'windows' && 'dir') || 'ls -lh' }} dist/
- uses: actions/upload-artifact@v4
with:
name: pypi_files_${{ matrix.os }}_${{ matrix.target }}_${{ matrix.interpreter || 'all' }}_${{ matrix.manylinux }}
path: dist
pypi-publish:
runs-on: ubuntu-latest
# only run on release, not on any PR
if: "startsWith(github.ref, 'refs/tags/')"
needs: [ build ]
environment:
name: release
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
path: artifacts/
- name: move files to dist/
run: |
shopt -s globstar # Enable recursive globbing (**)
rm -rf dist/
mkdir dist/
cp -r artifacts/**/*.whl dist/
- name: publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
verbose: true
print-hash: true