forked from metab0t/PyOptInterface
-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (91 loc) · 2.88 KB
/
wheel.yml
File metadata and controls
105 lines (91 loc) · 2.88 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
name: cibuildwheel
on:
workflow_dispatch:
inputs:
publish:
description: 'Publish wheels to PyPI: (testpypi/pypi/none)'
required: false
type: choice
options:
- testpypi
- pypi
- none
default: none
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest-large, macos-latest]
steps:
- uses: actions/checkout@v6
- name: Build wheels
uses: pypa/cibuildwheel@v3.4.0
env:
# Select wheels
CIBW_BUILD: "*-manylinux_x86_64 *-manylinux_aarch64 *-win_amd64 *-macosx_x86_64 *-macosx_arm64"
CIBW_SKIP: "cp38-* cp3??t-*"
CIBW_ARCHS: "native"
# use manylinux2014
CIBW_MANYLINUX_X86_64_IMAGE: "quay.io/pypa/manylinux2014_x86_64"
CIBW_MANYLINUX_AARCH64_IMAGE: "quay.io/pypa/manylinux2014_aarch64"
CIBW_ENVIRONMENT_MACOS: >
MACOSX_DEPLOYMENT_TARGET=10.14
CIBW_TEST_COMMAND: "python -c \"import pyoptinterface as poi; print(dir(poi))\""
with:
package-dir: .
output-dir: wheelhouse
config-file: "{package}/pyproject.toml"
- uses: actions/upload-artifact@v7
with:
name: cibw-wheels-${{ runner.os }}-${{ runner.arch }}
path: ./wheelhouse/*.whl
publish-to-testpypi:
name: Publish Python wheels to TestPyPI
needs:
- build_wheels
runs-on: ubuntu-latest
if: github.event.inputs.publish == 'testpypi'
environment:
name: testpypi
url: https://test.pypi.org/p/pyoptinterface
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v8
with:
pattern: cibw-wheels-*
merge-multiple: true
path: dist/
- name: List all the dists
run: ls -l dist/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
publish-to-pypi:
name: Publish Python wheels to PyPI
needs:
- build_wheels
runs-on: ubuntu-latest
if: github.event.inputs.publish == 'pypi'
environment:
name: pypi
url: https://pypi.org/project/pyoptinterface/
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v8
with:
pattern: cibw-wheels-*
merge-multiple: true
path: dist/
- name: List all the dists
run: ls -l dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://upload.pypi.org/legacy/