-
Notifications
You must be signed in to change notification settings - Fork 94
129 lines (107 loc) · 3.63 KB
/
cibuildwheel.yml
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
name: Build wheels
on:
# Run CI when changes are pushed to master
push:
branches:
- master
tags:
- "v*"
# Run CI when a PR is openend or changes are pushed to the PR
pull_request:
types:
- opened
- synchronize
- reopened
# Run CI every Monday at 7AM to catch bugs due to changes in the ecosystem
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
- cron: "0 7 * * 1"
# Run CI whenever someone with the appropriate privileges requests it
workflow_dispatch:
defaults:
run:
shell: sh
jobs:
################################################################################
# Build and test binary release for Python package
################################################################################
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
steps:
- uses: actions/checkout@v4
- # Workaround for out-of-memory error
# See: https://github.com/pypa/cibuildwheel/issues/1586
if: runner.os == 'Linux'
run: docker system prune -a -f
- name: Build wheel
uses: pypa/[email protected]
with:
output-dir: "./wheelhouse"
config-file: "{package}/pyproject.toml"
env:
MACOSX_DEPLOYMENT_TARGET: "10.9"
- uses: actions/upload-artifact@v4
with:
name: wheelhouse-${{ runner.os }}
path: ./wheelhouse/*.whl
################################################################################
# Publish package to GitHub Releases
################################################################################
publish_package_to_github_releases:
name: Publish package to GitHub Releases
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
needs:
- build_wheels
permissions:
contents: write
steps:
- name: Download wheelhouse
uses: actions/download-artifact@v4
with:
pattern: wheelhouse-*
path: wheelhouse
merge-multiple: true
- name: Publish to GitHub Releases
uses: softprops/action-gh-release@v2
with:
files: wheelhouse/*.whl
fail_on_unmatched_files: true
################################################################################
# Publish package to PyPI
################################################################################
publish_package_to_pypi:
name: Publish package to PyPI
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
needs:
- build_wheels
environment:
name: pypi
url: https://pypi.org/p/maraboupy
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: Download wheelhouse
uses: actions/download-artifact@v4
with:
pattern: wheelhouse-*
path: wheelhouse
merge-multiple: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: wheelhouse