-
Notifications
You must be signed in to change notification settings - Fork 152
209 lines (191 loc) · 6.72 KB
/
Copy pathpypackaging.yml
File metadata and controls
209 lines (191 loc) · 6.72 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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# SPDX-FileCopyrightText: 2026 Oak Ridge National Laboratory and Contributors
#
# SPDX-License-Identifier: Apache-2.0
name: Python Packaging
on:
workflow_dispatch:
inputs:
overrideVersion:
description: Manually force a version
pypiServer:
description: Server to publish the pip package
required: true
default: 'testpypi'
type: choice
options:
- 'testpypi'
- 'pypi'
pull_request:
push:
branches:
- master
- release_[0-9]+
tags:
- v[0-9]+.[0-9]+.[0-9]+*
release:
types:
- published
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
ADIOS2_CUSTOM_VERSION_OVERRIDE: ${{ github.event.inputs.overrideVersion }}
jobs:
make_sdist:
name: Make SDist
runs-on: ubuntu-latest
permissions:
contents: read
actions: write # for upload-artifact
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
with:
fetch-depth: 0
- name: Generate common version file
run: cmake -P scripts/ci/gh-actions/config/adios-version.cmake && echo VERSION.TXT
- name: Build SDist
run: pipx run build --sdist
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v4
with:
name: artifact_sdist
path: dist/*.tar.gz
build_wheels_legacy:
name: Wheels cp39–cp311
runs-on: ubuntu-latest
permissions:
contents: read
actions: write # for upload-artifact
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
with:
fetch-depth: 0
- name: Generate common version file
run: cmake -P scripts/ci/gh-actions/config/adios-version.cmake && echo VERSION.TXT
- uses: pypa/cibuildwheel@294735312765b09d24a2fbec22660ce817587d55 # v4.1.0
env:
CIBW_BEFORE_ALL: yum install -y libcurl-devel openssl-devel libsodium-devel
CIBW_BUILD: >-
cp39-manylinux_x86_64
cp310-manylinux_x86_64
cp311-manylinux_x86_64
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v4
with:
name: artifact_wheels_legacy
path: wheelhouse/*.whl
build_wheels_stable:
name: Wheels cp312-abi3
runs-on: ubuntu-latest
permissions:
contents: read
actions: write # for upload-artifact
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
with:
fetch-depth: 0
- name: Generate common version file
run: cmake -P scripts/ci/gh-actions/config/adios-version.cmake && echo VERSION.TXT
- uses: pypa/cibuildwheel@294735312765b09d24a2fbec22660ce817587d55 # v4.1.0
env:
CIBW_BEFORE_ALL: yum install -y libcurl-devel openssl-devel libsodium-devel
# abi3 wheel valid for all CPython >= 3.12 (enabled via pyproject.toml override)
CIBW_BUILD: cp312-manylinux_x86_64
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v4
with:
name: artifact_wheels_stable
path: wheelhouse/*.whl
build_wheels_freethreaded:
name: Wheels cp314t
runs-on: ubuntu-latest
permissions:
contents: read
actions: write # for upload-artifact
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
with:
fetch-depth: 0
- name: Generate common version file
run: cmake -P scripts/ci/gh-actions/config/adios-version.cmake && echo VERSION.TXT
- uses: pypa/cibuildwheel@294735312765b09d24a2fbec22660ce817587d55 # v4.1.0
env:
CIBW_BEFORE_ALL: yum install -y libcurl-devel openssl-devel libsodium-devel
# cp314t free-threaded (no-GIL) wheel, enabled via pyproject.toml override.
# cibuildwheel v4 dropped cp313t support; cp314t builds by default.
CIBW_BUILD: cp314t-manylinux_x86_64
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v4
with:
name: artifact_wheels_freethreaded
path: wheelhouse/*.whl
test_wheels:
name: Test wheel on ubuntu
needs: [build_wheels_legacy, build_wheels_stable, build_wheels_freethreaded]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v4
with:
pattern: artifact_wheels_*
path: dist
merge-multiple: true
- run: python -m pip install --find-links=dist adios2
- run: python -c "import adios2"
test_sdist:
name: Test SDist on ${{ matrix.os }}
needs: make_sdist
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest]
steps:
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: '3.12'
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v4
with:
name: artifact_sdist
path: dist
- run: python -m pip install -vvv dist/*.tar.gz
shell: bash
- run: python -c "import adios2"
shell: bash
upload_pypi:
needs: [build_wheels_legacy, build_wheels_stable, build_wheels_freethreaded, make_sdist]
environment: pypi
permissions:
contents: read
actions: read # for download-artifact
id-token: write
runs-on: ubuntu-latest
if: |
github.event_name == 'workflow_dispatch' && github.event.inputs.pypiServer == 'pypi' ||
(
github.event_name == 'release' &&
github.event.action == 'published'
)
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v4
with:
path: dist
merge-multiple: true
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1
upload_test_pypi:
needs: [build_wheels_legacy, build_wheels_stable, build_wheels_freethreaded, make_sdist]
environment: testpypi
permissions:
contents: read
actions: read # for download-artifact
id-token: write
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch' && github.event.inputs.pypiServer == 'testpypi'
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v4
with:
path: dist
merge-multiple: true
- run: ls -R dist
- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1
with:
repository-url: https://test.pypi.org/legacy/